IBM XL incompatibility when linking mixed C++/Fortran project with OpenMP
Test case: https://github.com/matthiasdiener/cmaketest
When configuring this test case with XL (CC=xlc_r CXX=xlC_r FC=xlf_r cmake ..
), the libxlomp_ser
library ends up in CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES
, and is linked to the final binary. When linking against libxlomp_ser, OpenMP is effectively disabled.
A potential workaround is to configure this project with CC=xlc_r CXX=xlC_r FC=xlf_r FFLAGS="-qsmp=omp" cmake ..
, but this overrides the OpenMP detection.
Tested with cmake 3.12 and XL 16.1.1 on Linux.
Edited by Matthias Diener