Commit 9f955ba4 authored by Daniel Wortmann's avatar Daniel Wortmann

Added default cmake files for popular compilers

parent 5c6811f0
......@@ -9,8 +9,12 @@ site_name(sitename)
set (configfile "NOTFOUND")
if (${Fleur_custom_toolchain})
set (configfile "cmake/cmake.config")
elseif ($ENV{FC} MATCHES "pgf.*")
set (configfile "cmake/cmake.pgfortran.config")
elseif ($ENV{FC} MATCHES "gfortran.*")
set (configfile "cmake/cmake.gfortran.config")
elseif ($ENV{FC} MATCHES "ifort.*")
set (configfile "cmake/cmake.ifort.config")
elseif (${sitename} MATCHES "iff.*")
set (configfile "cmake/cmake.iff.config")
elseif (${sitename} MATCHES "jrl.*")
......
#generic Makefile for the ifort compiler
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(Fleur_uses_MPI TRUE)
endif()
else ()
set(Fleur_uses_MPI FALSE)
endif ()
#Check for HDF5
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 ()
#The Fortran compile flags
set(CMAKE_Fortran_FLAGS "${HDF5_INCL} -mkl -warn nousage -assume byterecl -r8 " )
set(CMAKE_Fortran_FLAGS_RELEASE " -O3 -xHost -openmp" )
set(CMAKE_Fortran_FLAGS_DEBUG " -traceback -ftrapuv -CB -openmp -O0 -g" )
set(LAPACK_LIBS "-lxml2 -mkl -lmatmul -openmp -lpthread")
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)
#generic Makefile for the pgi compiler
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_SHARED_LIBRARY_LINK_C_FLAGS)
set(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS)
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(Fleur_uses_MPI TRUE)
endif()
else ()
set(Fleur_uses_MPI FALSE)
endif ()
#Check for HDF5
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 ()
#The Fortran compile flags
set(CMAKE_Fortran_FLAGS "${HDF5_INCL} -Mr8 -Mr8intrinsics" )
set(CMAKE_Fortran_FLAGS_RELEASE " -O3 -fast -mp" )
set(CMAKE_Fortran_FLAGS_DEBUG " -traceback -C -mp -O0 -g -Mchkstk -Mchkptr" )
set(LAPACK_LIBS "-Meh_frame -lxml2 -llapack -lblas")
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_AIX)
......@@ -7,7 +7,9 @@ MODULE m_magma
!**********************************************************
CONTAINS
SUBROUTINE magma_diag(nsize,a,b,z,eig,ne)
#ifdef CPP_MAGMA
use magma
#endif
#include"cpp_double.h"
IMPLICIT NONE
......@@ -25,6 +27,7 @@ CONTAINS
COMPLEX, ALLOCATABLE, INTENT (INOUT) :: z(:,:)
#endif
#ifdef CPP_MAGMA
! ... Local Variables ..
INTEGER iind,ind1,ind2,info,lwork,liwork,lrwork,err,i,mout(1)
......@@ -100,7 +103,7 @@ CONTAINS
DO i = 1, ne
eig(i) = eigTemp(i)
END DO
#endif
END SUBROUTINE magma_diag
END MODULE m_magma
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