use relative paths to object files when compiling shared libraries in the OpenFOAM easyblock#3388
Conversation
|
Actually, this makefile was introduced in 4.x for the .org fork. For older versions, the file does not exist, but in that case the change just won't be applied (as it checks if the file exists), which should be fine. For the .com version, this file should be present for all versions. |
|
Successful build with the EESSI bot for skylake: EESSI/software-layer#563 (comment) |
|
@boegelbot please test @ generoso |
|
@bedroge: Request for testing this PR well received on login1 PR test command '
Test results coming soon (I hope)... Details- notification for comment with ID 2218652517 processed Message to humans: this is just bookkeeping information for me, |
|
Test report by @boegelbot Overview of tested easyconfigs (in order)
Build succeeded for 9 out of 9 (9 easyconfigs in total) |
In EESSI we ran into the following error when compiling OpenFOAM v2312 for Intel Skylake (see EESSI/software-layer#563 (comment)):
This worked fine for other CPU targets, but due to the CPU target names that we use, Skylake has the longest installation path ("intel/skylake_avx512"). Apparently, this makes the entire command for building the shared library
libOpenFOAM.sojust a bit too long. This command includes a large number (~600) of absolute paths to object files:This PR fixes the issue by replacing the absolute paths to all these object files by relative ones. It does that by replacing the
$WM_PROJECT_DIR(main installation path of this OpenFOAM version) part of the path by the relative path (relative to the current working dir) to this main installation directory for every object file. This means that the ~600 paths will then look something like:And this greatly reduces the length of this entire command, which made it compile without issues for our Skylake installation path.
Since the same code seems to be part of both different OpenFOAM forks and in all the versions that I checked, I haven't restricted this to a specific fork/version.