Error about linking MKL when compile LEM code in Lonestar5

Hi, I’m setting up the enviroment on Lonestar5 and compiling LEM code there, but got this link error when doing make -j8.



And this is the modules I loaded,

I’m using intel compiler, it seems that cmake found the mkl under \opt\intel, but later there are some link error when ‘make’

Then I tried to add ‘-qopenmp’ flag when doing cmake, but still got the same error.

Do you know what’s the reason for this?

Have you tried adding the following option to CMake

# OpenMP
find_package(OpenMP)
if (OPENMP_FOUND)
  if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
    set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
  endif()
endif()

and then configure and compile?

Previously not.

I just add this part to CMakeList.txt. So cmake found openmp, but still got the same error when make

Sorry, use this instead:

find_package(OpenMP)
if (OPENMP_FOUND)
    set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
endif()

Thanks. It works and the code it running now.

1 Like