You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Target aliases such as MPI::MPI_C populated by the find_package command for MPI can introduce unwanted artifacts such as RUNPATH entries in the final build.
I am building ScaLAPACK in a HPC systems where MPI libraries are loaded with modules. For some MPI modules, CMake inserts into the linker flags, MPI_<language>_LINK_FLAGS, run path entries -Wl,-rpath -Wl,<path>. These entries are not removed from the RUNPATH of the installed executable. I have more details in the Stack Overflow issue "Use of MPI::MPI_C alias".
Since the find module for MPI offers no control on how it sets up the alias targets it exposes, it seems that the only solution is to use exposed variables, such as MPI_C_INCLUDE_DIRS and MPI_C_LIBRARIES to explicitly set up all the required target properties.
Aliases are a convenient abstraction, but without a well designed API using them across projects causes issues. Would it make sense to replace aliases in the CMake scripts with explicit variables?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Target aliases such as
MPI::MPI_C
populated by thefind_package
command for MPI can introduce unwanted artifacts such asRUNPATH
entries in the final build.I am building ScaLAPACK in a HPC systems where MPI libraries are loaded with modules. For some MPI modules, CMake inserts into the linker flags,
MPI_<language>_LINK_FLAGS
, run path entries-Wl,-rpath -Wl,<path>
. These entries are not removed from theRUNPATH
of the installed executable. I have more details in the Stack Overflow issue "Use of MPI::MPI_C alias".Since the find module for MPI offers no control on how it sets up the alias targets it exposes, it seems that the only solution is to use exposed variables, such as
MPI_C_INCLUDE_DIRS
andMPI_C_LIBRARIES
to explicitly set up all the required target properties.Aliases are a convenient abstraction, but without a well designed API using them across projects causes issues. Would it make sense to replace aliases in the CMake scripts with explicit variables?
P.S.
I know that this is not the official repository for ScaLAPACK, but
Beta Was this translation helpful? Give feedback.
All reactions