"ADD_LIBRARY called with SHARED option, but target platform does not support dynamic linking"

Hello,

I am trying to install OpenMC from source on Theta at ANL. I am running into a warning when using CMake that I fear may cause issues at runtime. I get the following warning two times when using CMake:

“ADD_LIBRARY called with SHARED option but the target platform does not support dynamic linking. Building a STATIC library instead. This may lead to problems”

The full terminal output is at this gist.

I run the following commands when initializing the shell:

module unload intel
module load cmake
module swap PrgEnv-intel PrgEnv-gnu
module load cray-hdf5-parallel
module load cray-mpich

Is there a setting I am missing that would be causing this warning to pop up? Or is it an issue with Theta?

Best,

–Olek

The Theta user manual says:

Due to hardware differences between login (non-KNL) and compute nodes (Intel Phi 2nd Generation KNL), compilation of application codes on Theta systems normally involves cross-compiling. The module craype-mic-knl loaded by default defines the target architecture along with the appropriate compilation options that tune the compiler optimization to KNL hardware. For that reason, any compiler options preexisting in the application Makefile that auto-tune the code to the automatically recognized CPU architecture of the login node where the compilation proceeds have negative impact on performance of the compiled code, and should be removed.

Are there any places in the CMakeFiles where I could make this change?

@paulromano

Hi @oyardas2,

I happened upon this thread this morning. Maybe @paulromano has already replied to you offline, but you can try changing the following line in the CMakeLists.txt file:

to add_library(libopenmc STATIC ${libopenmc_SOURCES}) if you want to get rid of this warning.

I understand your concern, but it appears that CMake is doing this by default. Are you asking about this mainly to remove the warning or are you noticing problems with the resulting OpenMC executable?

Cheers,

Patrick

I reached out to the Theta people, and this is the answer they gave me:

Try switching to dynamic linking with:
export CRAYPE_LINK_TYPE=dynamic

This worked!

2 Likes