Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hey everyone,
This pull request is meant to allow safe parallel building of the project.
What happened
We encountered a few issues compiling Wi4MPI in the lab in a parallel environment. For a high number of jobs, compilation would systematically fail, but would succeed after retrying once or twice. The errors would look like such:
Why it happened
Turns out CMake is having a hard time dealing with the multiple fake libraries built by Wi4MPI. Setting the
SOVERSION
flag inset_target_properties
will trigger the creation of 'helper' symlinks to allow ease of access to the library.wi4mpi/src/CMakeLists.txt
Lines 469 to 474 in 60bee2a
From https://cmake.org/cmake/help/latest/prop_tgt/SOVERSION.html:
The created symlinks omit the major:
For single version library creations, that is fine, but for this specific use case, the symlinks conflict with each other, as multiple links with the same name will be created at the same time.
What this changes
I introduced the
SOVERSION
flag into the project, as it influences the ELF header of the resulting files by setting the version number in it. One may remove it to make this go away, but this will result in inaccurate ELF headers.This pull request introduces build directories based on the version number, using the
LIBRARY_OUTPUT_DIRECTORY
target property. The install directive then reflects this path change, but installs the file at the same location as usual.