Explicitly select linker for some mixed language libraries. #853
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.
If no linker preference is set for a shared library, CMake is choosing the executable that is used for linking based on the highest linker preference value. If a library consists of C and Fortran sources, the Fortran compiler frontend has the higher linker preference value and it is chosen by default.
For the Intel oneAPI compiler with MSVC-like syntax
icx-cl
as the C and C++ compiler and the Intel oneAPI Fortran compilersifort
orifx
, this leads to the following situation in combination withWINDOWS_EXPORT_ALL_SYMBOLS
:.def
file..def
file to the linker. However, the syntax for these flags match the C compilericx-cl
..def
files need to be passed differently forifx
orifort
than foricx-cl
.That leads to the linked libraries being empty or only exporting the Fortran symbols.
This is probably an issue that should be fixed in CMake. (However, that doesn't seem to be solvable easily.)
To work around the issue, explicitly specify to use the C compiler frontend as the linker for the AMD and CHOLMOD libraries.
Fixes #799.