Commit d7e1fea3 authored by Daniel Wortmann's avatar Daniel Wortmann

Modified cmake files to:

-make it nicer :-)
-make it work for GPU
parent f12cb850
......@@ -12,10 +12,10 @@ project(FLEUR LANGUAGES C Fortran)
set(FLEUR_LIBRARIES ${FLEUR_LIBRARIES} $ENV{FLEUR_LIBRARIES})
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${FLEUR_Fortran_FLAGS} $ENV{CMAKE_Fortran_FLAGS}")
if (DEFINED ENV{FLEUR_NO_SERIAL})
set(FLEUR_USE_SERIAL false)
if (DEFINED ENV{FLEUR_USE_SERIAL})
set(FLEUR_USE_SERIAL ENV{FLEUR_USE_SERIAL})
else()
set(FLEUR_USE_SERIAL true)
set(FLEUR_USE_SERIAL TRUE)
endif()
......
set(FLEUR_DEFINITIONS ${FLEUR_DEFINITIONS} "CPP_DOUBLE")
set(FLEUR_MPI_DEFINITIONS ${FLEUR_MPI_DEFINITIONS} "CPP_DOUBLE")
include("cmake/tests/test_doxygen.cmake")
include("cmake/compilerflags.cmake")
include("cmake/tests/test_XML.cmake")
include("cmake/tests/test_LAPACK.cmake")
include("cmake/tests/test_MPI.cmake")
include("cmake/tests/test_HDF5.cmake")
include("cmake/tests/test_MAGMA.cmake")
include("cmake/tests/test_GPU.cmake")
if (FLEUR_USE_MPI)
include("cmake/tests/test_SCALAPACK.cmake")
include("cmake/tests/test_ELPA.cmake")
......
message("************Summary***************")
message("Compiler: ${CMAKE_Fortran_COMPILER}")
message("Compiler ID:${CMAKE_Fortran_COMPILER_ID}")
message("Flags: ${CMAKE_Fortran_FLAGS}")
message("Libraries:${FLEUR_LIBRARIES}")
message("\nThese Libraries are required:")
message("XML Library found:${FLEUR_USE_XML}")
message("LAPACK Library found:${FLEUR_USE_LAPACK}")
message("\nThese Libraries are optional:")
message("HDF5 Library found:${FLEUR_USE_HDF5}")
message("MPI Library found:${FLEUR_USE_MPI}")
if(NOT WIN32)
string(ASCII 27 Esc)
set(CReset "${Esc}[m")
set(Bold "${Esc}[1m")
set(Red "${Esc}[31m")
set(Green "${Esc}[32m")
set(BRed "${Esc}[1;31m")
set(BGreen "${Esc}[1;32m")
endif()
message("${BRed}\n\n************************Summary***************************${CReset}")
message("${Green}Compiler : ${CReset}${CMAKE_Fortran_COMPILER}")
message("${Green}Compiler ID: ${CReset}${CMAKE_Fortran_COMPILER_ID}")
message("${Green}Flags : ${CReset}${CMAKE_Fortran_FLAGS}")
message("${Green}Libraries : ${CReset}${FLEUR_LIBRARIES}")
message("\n${Red}These Libraries are required:${CReset}")
message("${Green} XML Library found :${CReset} ${FLEUR_USE_XML}")
message("${Green} LAPACK Library found:${CReset} ${FLEUR_USE_LAPACK}")
message("${Red}These Libraries are optional:${CReset}")
message("${Green} HDF5 Library found :${CReset} ${FLEUR_USE_HDF5}")
message("${Green} MAGMA Library found:${CReset} ${FLEUR_USE_MAGMA}")
message("${Green} MPI Library found :${CReset} ${FLEUR_USE_MPI}")
if (FLEUR_USE_MPI)
message("SCALAPACK Library found:${FLEUR_USE_SCALAPACK}")
message("ELPA Library found:${FLEUR_USE_ELPA}")
message("${Green} SCALAPACK Library found:${CReset}${FLEUR_USE_SCALAPACK}")
message("${Green} ELPA Library found :${CReset}${FLEUR_USE_ELPA}")
else()
message("${Green} SCALAPACK Library found:${CReset} ---")
message("${Green} ELPA Library found :${CReset} ---")
endif()
message("${Green} Compile GPU version: ${CReset} ${FLEUR_USE_GPU}")
message("\n${Green}Compile serial version : ${CReset}${FLEUR_USE_SERIAL}")
message("${Green}Compile parallel version: ${CReset}${FLEUR_USE_MPI}")
message("\n${Green}Git describe : ${CReset}${git_describe}")
message("${Green}Git hash : ${CReset}${git_hash}")
message("${Green}Doxygen found : ${CReset}${FLEUR_USE_DOXYGEN}")
message("${BRed}************************-------***************************${CReset}")
#some checks
if (NOT FLEUR_USE_XML)
message(FATAL_ERROR "${BRed}No libxml2 Library found. This is required.${CReset}")
endif()
if (NOT FLEUR_USE_LAPACK)
message(FATAL_ERROR "${BRed}No LAPACK Library found. This is required.${CReset}")
endif()
message("Git describe:${git_describe}")
message("Git hash:${git_hash}")
message("************-------***************")
if (NOT (FLEUR_USE_SERIAL OR FLEUR_USE_MPI))
message(FATAL_ERROR "You should either compile a parallel or serial version (or both)")
endif()
......@@ -54,6 +54,20 @@ if ( FLEUR_USE_HDF5)
endif()
message("HDF5 Library found:${FLEUR_USE_HDF5}")
if (DEFINED ENV{FLEUR_USE_HDF5})
if (ENV{FLEUR_USE_HDF5})
if (NOT FLEUR_USE_HDF5)
message(FATAL_ERROR "You asked for HDF5 but cmake couldn't find it. Please set HDF5_ROOT and or give additional compiler/linker flags")
endif()
else()
if (FLEUR_USE_HDF5)
message("HDF5 library found, but you explicitely asked not to use it")
set(FLEUR_USE_HDF5 FALSE)
endif()
endif()
endif()
if (FLEUR_USE_HDF5)
message("Parallel HDF5 Library found:${FLEUR_USE_HDF5}")
set(FLEUR_DEFINITIONS ${FLEUR_DEFINITIONS} "CPP_HDF")
......
......@@ -5,6 +5,19 @@ LINK_LIBRARIES ${FLEUR_LIBRARIES}
message("MPI Library found:${FLEUR_USE_MPI}")
if (DEFINED ENV{FLEUR_USE_MPI})
if (ENV{FLEUR_USE_MPI})
if (NOT FLEUR_USE_MPI)
message(FATAL_ERROR "You asked for MPI but cmake couldn't find it. Please check your Fortran compiler settings")
endif()
else()
if (FLEUR_USE_MPI)
message("MPI library found, but you explicitely asked not to use it")
set(FLEUR_USE_MPI FALSE)
endif()
endif()
endif()
if (FLEUR_USE_MPI)
set(FLEUR_MPI_DEFINITIONS ${FLEUR_MPI_DEFINITIONS} "CPP_MPI")
endif()
\ No newline at end of file
# add a target to generate API documentation with Doxygen
find_package(Doxygen)
if(DOXYGEN_FOUND)
if(FLEUR_USE_DOXYGEN)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/docs/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/docs/Doxyfile @ONLY)
add_custom_target(doc
${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/docs/Doxyfile
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/docs
COMMENT "Generating API documentation with Doxygen" VERBATIM
)
endif(DOXYGEN_FOUND)
endif()
......@@ -30,3 +30,6 @@ eigen/tlo.f90
eigen/vacfun.f90
eigen/vec_for_lo.f90
)
if (FLEUR_USE_GPU)
set(fleur_F90 ${fleur_F90} eigen/hsmt_nonsph_GPU.F90)
endif()
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