Commit 29927616 authored by Daniel Wortmann's avatar Daniel Wortmann

Updated HDF5 config script and fixed bug in storing environment variables

parent 1fb45894
......@@ -3,11 +3,11 @@
echo "set(compile_user $USER)" >config.cmake
#Some freqeuntly used Environment variables
if [ -z ${HDF5_ROOT+x} ] ; then FLEUR_LIBDIR="$FLEUR_LIBDIR $HDF5_ROOT/lib" ; FLEUR_INCLUDEDIR="$FLEUR_INCLUDEDIR $HDF5_ROOT/include" ; fi
if [ -z ${HDF5_DIR+x} ] ; then FLEUR_LIBDIR="$FLEUR_LIBDIR $HDF5_DIR/lib" ; FLEUR_INCLUDEDIR="$FLEUR_INCLUDEDIR $HDF5_DIR/include" ; fi
if [ -z ${HDF5_LIB+x} ] ; then FLEUR_LIBDIR="$FLEUR_LIBDIR $HDF5_LIB" ; fi
if [ -z ${HDF5_INCLUDE+x} ] ; then FLEUR_INCLUDEDIR="$FLEUR_INCLUDEDIR $HDF5_INCLUDE" ; fi
if [ -z ${HDF5_MODULES+x} ] ; then FLEUR_INCLUDEDIR="$FLEUR_INCLUDEDIR $HDF5_MODULES" ; fi
if [ -n "$HDF5_ROOT" ] ; then FLEUR_LIBDIR="$FLEUR_LIBDIR $HDF5_ROOT/lib" ; FLEUR_INCLUDEDIR="$FLEUR_INCLUDEDIR $HDF5_ROOT/include" ; fi
if [ -n "$HDF5_DIR"} ] ; then FLEUR_LIBDIR="$FLEUR_LIBDIR $HDF5_DIR/lib" ; FLEUR_INCLUDEDIR="$FLEUR_INCLUDEDIR $HDF5_DIR/include" ; fi
if [ -n "$HDF5_LIB" ] ; then FLEUR_LIBDIR="$FLEUR_LIBDIR $HDF5_LIB" ; fi
if [ -n "$HDF5_INCLUDE" ] ; then FLEUR_INCLUDEDIR="$FLEUR_INCLUDEDIR $HDF5_INCLUDE" ; fi
if [ -n "$HDF5_MODULES" ] ; then FLEUR_INCLUDEDIR="$FLEUR_INCLUDEDIR $HDF5_MODULES" ; fi
......
......@@ -3,7 +3,15 @@ try_compile(FLEUR_USE_HDF5 ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/cmake/tests/t
LINK_LIBRARIES ${FLEUR_LIBRARIES}
)
#now try to find the library by adding the -l stuff to the FLEUR_LIBRARIES
if (NOT FLEUR_USE_HDF5)
foreach(ADD_String "-lhdf5_fortran;-lhdf5"
"-lhdf5_fortran;-lhdf5_f90cstub;-lhdf5"
"-lhdf5_fortran;-lhdf5;-ldl"
"-lhdf5_fortran;-lhdf5_f90cstub;-lhdf5;-ldl"
"-lhdf5_fortran;-lhdf5;-lz"
"-lhdf5_fortran;-lhdf5_f90cstub;-lhdf5;-lz"
"-lhdf5_fortran;-lhdf5;-ldl;-lz"
"-lhdf5_fortran;-lhdf5_f90cstub;-lhdf5;-ldl;-lz"
if (NOT FLEUR_USE_HDF5)
set(TEST_LIBRARIES "${FLEUR_LIBRARIES};-lhdf5_fortran;-lhdf5")
try_compile(FLEUR_USE_HDF5 ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/cmake/tests/test_HDF5.f90
LINK_LIBRARIES ${TEST_LIBRARIES}
......@@ -11,38 +19,8 @@ if (NOT FLEUR_USE_HDF5)
if (FLEUR_USE_HDF5)
set(FLEUR_LIBRARIES ${TEST_LIBRARIES})
endif()
endif()
#now try to find the library by adding the -l stuff to the FLEUR_LIBRARIES
if (NOT FLEUR_USE_HDF5)
set(TEST_LIBRARIES "${FLEUR_LIBRARIES};-lhdf5_fortran;-lhdf5_f90cstub;-lhdf5")
try_compile(FLEUR_USE_HDF5 ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/cmake/tests/test_HDF5.f90
LINK_LIBRARIES ${TEST_LIBRARIES}
)
if (FLEUR_USE_HDF5)
set(FLEUR_LIBRARIES ${TEST_LIBRARIES})
endif()
endif()
#now try the find_package feature
#if (NOT FLEUR_USE_HDF5)
# find_package(HDF5)
# if (NOT HDF5_LIBRARIES MATCHES "NOTFOUND")
# set(TEST_LIBRARIES ${HDF5_Fortran_LIBRARIES} ${FLEUR_LIBRARIES})
# set(STORE_FLAGS ${CMAKE_Fortran_FLAGS})
# set(CMAKE_Fortran_FLAGS "-I${HDF5_INCLUDE_LIBRARIES}" ${CMAKE_Fortran_FLAGS})
#try_compile(FLEUR_USE_HDF5 ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/cmake/tests/test_HDF5.f90
# LINK_LIBRARIES ${TEST_LIBRARIES}
# )
# if (${FLEUR_USE_HDF5})
# set(FLEUR_LIBRARIES ${HDF5_Fortran_LIBRARIES} ${FLEUR_LIBRARIES})
# set(FLEUR_MPI_LIBRARIES ${HDF5_Fortran_LIBRARIES} ${FLEUR_MPI_LIBRARIES})
# else()
# set(CMAKE_Fortran_FLAGS ${STORE_FLAGS})
# endif()
# endif()
#endif()
endif()
endforeach()
#check if HDF is parallel
if ( FLEUR_USE_HDF5)
......
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