cmake.jurecaGPU.config 2 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
#Cmakefile for jureca with PGI compiler and GPU support

set(CMAKE_Fortran_COMPILER pgfortran)
enable_language(C Fortran)
set(Fleur_uses_serial TRUE)


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

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 ()

#At the moment we use a openmp+GPU version only
set(Fleur_uses_MPI FALSE)

set(LAPACK_LIBS "-Meh_frame -lxml2 -L/homec/jiff13/jiff1302/jureca/magma -lmagma -lstdc++ -lgcc_s -lblas -Mcudalib=cublas -Mcudalib=cusparse  -L/usr/local/software/jureca/Stages/2016a/software/imkl/11.3.2.181-pmvapich2c-2016a-GDR/lib/intel64/ -lcusparse -liomp5 -lirc -lpthread")
set(N_STREAMS 3)
set(CMAKE_Fortran_FLAGS "-I$ENV{HOME}/jureca/magma/magma-2.0.2/include/ ${HDF5_INCL} -Mr8intrinsics -Mr8 -Mcuda:kepler+ -ta:tesla:cuda7.5 -DUSE_STREAMS -DNUM_STREAMS=${N_STREAMS} -Minfo=accel -acc " )
set(CMAKE_Fortran_FLAGS_RELEASE " -O3 " )    
set(CMAKE_Fortran_FLAGS_DEBUG   " -O0 -g -C -Mchkstk -Mchkptr -traceback" )

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++")
    set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -I$ENV{ELPA_ROOT}/include/elpa_openmp-2014.06.001/modules")
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()



add_definitions(-DCPP_IO -DCPP_DOUBLE -DCPP_AIX -DCPP_MAGMA)