Commit 3aa2d9cd authored by Daniel Wortmann's avatar Daniel Wortmann

Updated cmake scripts to relove issues with compiling hdf5,libxc

parent 1bdbe1b6
......@@ -75,13 +75,14 @@ set_source_files_properties(${inpgen_F77} PROPERTIES Fortran_FORMAT FIXED)
string(REPLACE ";" " " CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${FLEUR_PRECISION_OPTION}")
message("Flags: ${CMAKE_Fortran_FLAGS}")
set(FLEUR_LINK_LIBRARIES "${FLEUR_LINK_LIBRARIES};juDFT")
if (${FLEUR_USE_SERIAL})
#Serial executables
add_executable(fleur ${fleur_SRC} ${c_filesFleur})
target_compile_definitions(fleur PUBLIC ${FLEUR_DEFINITIONS})
target_link_libraries(fleur ${FLEUR_LIBRARIES})
target_link_libraries(fleur juDFT)
target_link_libraries(fleur ${FLEUR_LINK_LIBRARIES})
set_target_properties(fleur PROPERTIES Fortran_MODULE_DIRECTORY modules/fleur COMPILE_OPTIONS -Imodules/fleur)
endif()
#parallel executables
......@@ -90,7 +91,7 @@ if(${FLEUR_USE_MPI})
add_executable(fleur_MPI ${juDFT_HDF} ${juDFT_SRC_F90} ${fleur_SRC} ${c_filesFleur} ${fleur_SRC_MPI})
target_compile_definitions(fleur_MPI PUBLIC ${FLEUR_MPI_DEFINITIONS})
target_link_libraries(fleur_MPI ${FLEUR_LIBRARIES})
target_link_libraries(fleur_MPI juDFT)
target_link_libraries(fleur_MPI ${FLEUR_LINK_LIBRARIES})
set_target_properties(fleur_MPI PROPERTIES Fortran_MODULE_DIRECTORY modules/fleur_MPI COMPILE_OPTIONS -Imodules/fleur_MPI)
endif ()
......
......@@ -58,12 +58,13 @@ if (DEFINED CLI_FLEUR_USE_HDF5)
else()
set(HDF5_ENABLE_PARALLEL OFF CACHE BOOL "Enable parallel build (requires MPI)")
endif()
set(CMAKE_Fortran_MODULE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/modules/hdf5")
set(CMAKE_Fortran_MODULE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/modules/external")
add_subdirectory (external/hdf5-git EXCLUDE_FROM_ALL)
set(FLEUR_USE_HDF5 TRUE)
set(FLEUR_USE_HDF5MPI FLEUR_USE_MPI)
set(FLEUR_COMPILE_HDF true)
include_directories("${CMAKE_CURRENT_BINARY_DIR}/modules/hdf5/static")
include_directories("${CMAKE_CURRENT_BINARY_DIR}/modules/external")
include_directories("${CMAKE_CURRENT_BINARY_DIR}/modules/external/static")
endif()
else()
if (FLEUR_USE_HDF5)
......
......@@ -24,9 +24,11 @@ if (DEFINED CLI_FLEUR_USE_LIBXC)
set(ENABLE_FORTRAN ON CACHE BOOL "Build Fortran 90 interface")
set(ENABLE_FORTRAN03 ON CACHE BOOL "Build Fortran 2003 interface")
set(CMAKE_Fortran_MODULE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/modules/external")
add_subdirectory (external/libxc-git EXCLUDE_FROM_ALL)
include_directories("${CMAKE_CURRENT_BINARY_DIR}/modules/external")
set(FLEUR_USE_LIBXC TRUE)
set(FLEUR_LIBRARIES "${FLEUR_LIBRARIES};xcf90;xcf03")
set(FLEUR_LINK_LIBRARIES "${FLEUR_LINK_LIBRARIES};xcf90;xcf03")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -I${CMAKE_CURRENT_BINARY_DIR}/external/libxc-git")
endif()
else()
......
......@@ -5,7 +5,9 @@ LINK_LIBRARIES ${FLEUR_LIBRARIES}
#Try typical mkl string
if (NOT FLEUR_USE_SCALAPACK)
message("Test for SCALAPCK with mkl flags")
set(TEST_LIBRARIES "${FLEUR_LIBRARIES};-lmkl_scalapack_lp64;-lmkl_blacs_intelmpi_lp64")
message("Testlibraries:${TEST_LIBRARIES}")
try_compile(FLEUR_USE_SCALAPACK ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/cmake/tests/test_SCALAPACK.f90
LINK_LIBRARIES ${TEST_LIBRARIES}
)
......
......@@ -10,7 +10,7 @@ endif()
set(JUDFT_USE_MPI ${FLEUR_USE_MPI} CACHE BOOL "Compile with MPI, will also work in serial")
set(JUDFT_USE_HDF5 ${FLEUR_USE_HDF5} CACHE BOOL "Compile with HDF5")
if (DEFINED FLEUR_COMPILE_HDF)
set(JUDFT_COMPILE_HDF ON CHACHE BOOL "The HDF5 is compiled as submodule")
set(JUDFT_COMPILE_HDF ON CACHE BOOL "The HDF5 is compiled as submodule")
endif()
if (DEFINED FLEUR_USE_HDF5MPI)
set(JUDFT_USE_HDF5MPI FLEUR_USE_HDF5MPI CACHE BOOL "Is the HDF5 version able to do parallel IO" )
......
Subproject commit ca6f7114b9fffe0964ca9e8d24e09ef15b300316
Subproject commit 3cb2231abf1d47fbd8b3e21c8478e9f26a73ce5f
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