test_ELPA_onenode.cmake 1.29 KB
Newer Older
1 2 3 4 5 6
#First check if we can compile with ELPA
try_compile(FLEUR_USE_ELPA_ONENODE ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/cmake/tests/test_ELPA.f90
LINK_LIBRARIES ${FLEUR_LIBRARIES})

if (NOT FLEUR_USE_ELPA_ONENODE)
   if (DEFINED CLI_ELPA_OPENMP)
7 8
      message ("FLEUR_USE_GPU: ${FLEUR_USES_GPU}")
      if (FLEUR_USE_GPU)
9 10
      set(TEST_LIBRARIES "-lelpa_onenode;${FLEUR_LIBRARIES}")
      else()
11
      set(TEST_LIBRARIES "-lelpa_onenode_openmp;${FLEUR_LIBRARIES}")
12
      endif()
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
   endif()
   try_compile(FLEUR_USE_ELPA_ONENODE ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/cmake/tests/test_ELPA.f90
LINK_LIBRARIES ${TEST_LIBRARIES})
   if (FLEUR_USE_ELPA_ONENODE)
      set(FLEUR_LIBRARIES "${TEST_LIBRARIES}")
   endif()
endif()

message("ELPA (one node) Library found:${FLEUR_USE_ELPA_ONENODE}")

#Now check for version of elpa
if (FLEUR_USE_ELPA_ONENODE)
    set(FLEUR_USE_ELPA_ONENODE false)
try_compile(FLEUR_USE_ELPA_ONENODE_20180525 ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/cmake/tests/test_ELPA_20180525.f90
LINK_LIBRARIES ${FLEUR_LIBRARIES})
    message("Version check for ELPA:")
    message("20180525  ELPA: ${FLEUR_USE_ELPA_ONENODE_20180525}")
   if (FLEUR_USE_ELPA_ONENODE_20180525)
       set(FLEUR_USE_ELPA_ONENODE TRUE)
32
       set(FLEUR_DEFINITIONS ${FLEUR_DEFINITIONS} "CPP_ELPA_ONENODE")
33 34
   endif()
endif()