cmake.jureca.config 2.26 KB
Newer Older
1 2 3 4 5 6
#Cmake file for jureca

# this requires the following modules to be loaded:
# Intel, ParaStationMPI, libxml2, imkl, CMake


7
set(CMAKE_Fortran_COMPILER mpif90)
8
enable_language(C Fortran)
9 10
set(Fleur_uses_serial FALSE)

11 12 13
find_package(LibXml2 REQUIRED)
set(CMAKE_C_FLAGS "-I${LIBXML2_INCLUDE_DIR}")

14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
if ((NOT DEFINED ENV{NO_HDF}) AND (DEFINED ENV{HDF5_ROOT})) 
  set (HDF5_INCL "-I$ENV{HDF5_ROOT}/include")
  set(HDF5_LIBS "-L$ENV{HDF5_ROOT}/lib -lhdf5_fortran -lhdf5 -lz")
  set(Fleur_uses_HDF5 TRUE)
  add_definitions(-DCPP_HDF)
else ()
  message("No hdf support found")
  message("You might want to set HDF5_ROOT")
endif ()

if (${CMAKE_Fortran_COMPILER} MATCHES ".*mpif90")
       set(Fleur_uses_MPI TRUE)
else ()
       set(Fleur_uses_MPI FALSE)
       message(FATAL_ERROR "No MPI found, your compiler should be set to mpif90 ...")
endif ()

31
set(LAPACK_LIBS "-lxml2 -mkl -lmatmul -qopenmp -lpthread")
32
set(CMAKE_Fortran_FLAGS "${HDF5_INCL} -mkl -warn nousage -assume byterecl -r8" )
33
set(CMAKE_Fortran_FLAGS_RELEASE " -O4 -g -qopenmp -xSSE3 -axSSE4.2 " )    
34
set(CMAKE_Fortran_FLAGS_DEBUG   " -O0 -g -qopenmp" )
35 36 37 38 39 40 41 42 43 44

if (DEFINED ENV{SCALAPACK_ROOT})
   set(Fleur_uses_SCALAPACK TRUE)
   set(LAPACK_LIBS "${LAPACK_LIBS} -L${SCALAPACK_ROOT}/lib  -lmkl_scalapack_lp64 -lmkl_blacs_intelmpi_lp64")
endif() 

if (DEFINED ENV{ELPA_ROOT})
    set(Fleur_uses_ELPA TRUE)
    add_definitions(-DCPP_ELPA_NEW)
    set(LAPACK_LIBS "${LAPACK_LIBS} -L$ENV{ELPA_ROOT}/lib -lelpa_openmp -lmkl_scalapack_lp64 -lmkl_blacs_intelmpi_lp64 -lstdc++")
45
    set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -I$ENV{ELPA_INCLUDE} -I$ENV{ELPA_INCLUDE}/elpa -I$ENV{ELPA_MODULES}" )
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
endif()

if (DEFINED ENV{ELEMENTAL_ROOT})
   set(Fleur_uses_ELEMENTAL TRUE)
   set(LAPACK_LIBS "${LAPACK_LIBS} fleur_elemental.o -L$ENV{ELEMENTAL_ROOT}/lib -lelemental -lpmrrr -llapack-addons -lstdc++") 
endif()

if (${MPI_Fortran_FOUND})
  if (${CMAKE_Fortran_COMPILER} MATCHES ".*mpi.*")
       set(FLEUR_MPI TRUE)
  else (${CMAKE_Fortran_COMPILER} MATCHES ".*mpi.*")
       set(FLEUR_MPI FALSE)
       message("MPI found but your compiler should be set to mpif90, mpiifort ...")
  endif (${CMAKE_Fortran_COMPILER} MATCHES ".*mpi.*")
else (${MPI_Fortran_FOUND})
  set(FLEUR_MPI FALSE)
endif (${MPI_Fortran_FOUND})


add_definitions(-DCPP_IO -DCPP_DOUBLE -DCPP_APC)