Commit 5338dd6d authored by Daniel Wortmann's avatar Daniel Wortmann

Added a cmake rule for gfortran. If the environment variable FC=gfortran it will be used

parent c87593c4
#generic Makefile for gfortran
enable_language(C Fortran)
set (Fleur_uses_serial TRUE)
find_package(LibXml2 REQUIRED)
find_package(LAPACK REQUIRED)
find_package(MPI)
find_package(HDF5)
set(CMAKE_C_FLAGS "-I${LIBXML2_INCLUDE_DIR}")
#MPI can be switched off with NO_MPI variable
if (NOT DEFINED ENV{NO_MPI} )
if (MPI_Fortran_FOUND)
set (CMAKE_Fortran_COMPILER ${MPI_Fortran_COMPILER})
set(Fleur_uses_MPI TRUE)
endif()
else ()
set(Fleur_uses_MPI FALSE)
endif ()
#Check for HDF5
if ((NOT DEFINED ENV{NO_HDF}) AND (DEFINED HDF5_Fortran_LIBRARIES}))
set (HDF5_INCL "-I$ENV{HDF5_ROOT}/include")
set(HDF5_LIBS "-L${HDF5_Fortran_LIBRARIES} -lhdf5_fortran -lhdf5 ")
set(Fleur_uses_HDF5 TRUE)
add_definitions(-DCPP_HDF)
else ()
message("No hdf support found")
message("You might want to set HDF5_ROOT")
endif ()
#The Fortran compile flags
set(CMAKE_Fortran_FLAGS "${MPI_Fortran_COMPILE_FLAGS} ${HDF5_INCL} -ffree-line-length-none -fdefault-real-8 " )
set(CMAKE_Fortran_FLAGS_RELEASE " -O4 -fopenmp" )
set(CMAKE_Fortran_FLAGS_DEBUG " -CB -O0 -g" )
set(LAPACK_LIBS "-lxml2 -lblas -llapack")
#The following pathes probably have to ba adjusted
if (DEFINED ENV{SCALAPACK_ROOT})
set(Fleur_uses_SCALAPACK TRUE)
set(LAPACK_LIBS "${LAPACK_LIBS} -lmkl_scalapack_lp64 -lmkl_blacs_intelmpi_lp64")
endif()
if (DEFINED ENV{ELPA_ROOT})
set(Fleur_uses_ELPA TRUE)
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")
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_APC)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment