Commit 38db84ac authored by Daniel Wortmann's avatar Daniel Wortmann

Updated build system for HDF5

parent ada79934
......@@ -17,7 +17,7 @@ foreach(ADD_String "-lhdf5_fortran;-lhdf5"
LINK_LIBRARIES ${TEST_LIBRARIES}
)
if (FLEUR_USE_HDF5)
set(FLEUR_LIBRARIES ${TEST_LIBRARIES})
set(FLEUR_HDF5_LIBRARIES ${TEST_LIBRARIES})
endif()
endif()
endforeach()
......@@ -25,7 +25,7 @@ endforeach()
#check if HDF is parallel
if ( FLEUR_USE_HDF5)
try_compile(FLEUR_USE_HDF5MPI ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/cmake/tests/test_HDF5MPI.f90
LINK_LIBRARIES ${FLEUR_LIBRARIES}
LINK_LIBRARIES ${FLEUR_HDF5_LIBRARIES}
)
endif()
......@@ -62,7 +62,7 @@ if (DEFINED CLI_FLEUR_USE_HDF5)
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)
set(FLEUR_COMPILE_HDF5 true)
include_directories("${CMAKE_CURRENT_BINARY_DIR}/modules/external")
include_directories("${CMAKE_CURRENT_BINARY_DIR}/modules/external/static")
endif()
......
......@@ -8,12 +8,18 @@ if(NOT EXISTS "${PROJECT_SOURCE_DIR}/juDFT/CMakeLists.txt" )
endif()
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 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" )
if (DEFINED FLEUR_USE_HDF5)
set(JUDFT_USE_HDF5 ${FLEUR_USE_HDF5} CACHE BOOL "Compile with HDF5")
if (DEFINED FLEUR_COMPILE_HDF5)
set(JUDFT_COMPILE_HDF5 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" )
endif()
if (DEFINED FLEUR_HDF5_LIBRARIES)
message("SET:${FLEUR_HDF5_LIBRARIES}")
set(JUDFT_LIBRARIES ${FLEUR_HDF5_LIBRARIES} CACHE STRING "Libraries for linking with HDF5")
endif()
endif()
#In addition you might want to set
set(JUDFT_COMPILEOPTS ${FLEUR_PRECISION_OPTION})
......
......@@ -7,7 +7,7 @@ option(JUDFT_USE_HDF5 "Compile HDF5 tools" OFF)
option(JUDFT_USE_HDF5MPI "Is the HDF5 version able to do parallel IO" OFF)
option(JUDFT_USE_COLLECT "Collect usage data" ON)
option(JUDFT_USE_DEBUG "Set CPP_DEBUG when compiling code" OFF)
option(JUDFT_COMPILE_HDF "HDF5 is compiled as submodule" OFF)
option(JUDFT_COMPILE_HDF5 "HDF5 is compiled as submodule" OFF)
#In addition you might want to set
#set(JUDFT_LIBRARIES "-lsomething")
#set(JUFDT_COMPILEOPTS "-r8")
......@@ -47,10 +47,9 @@ if (JUDFT_USE_MPI)
endif()
if (JUDFT_USE_HDF5)
target_compile_definitions(juDFT PUBLIC CPP_HDF)
target_link_libraries(juDFT hdf5_fortran hdf5)
if (JUDFT_COMPILE_HDF)
target_link_libraries(juDFT hdf5_fortran-static)
endif()
if (JUDFT_COMPILE_HDF5)
target_link_libraries(juDFT PUBLIC hdf5_fortran-static)
endif()
endif()
if (JUDFT_USE_HDF5MPI)
target_compile_definitions(juDFT PUBLIC CPP_HDFMPI)
......
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