diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2010-05-25 16:00:56 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2010-05-25 16:00:56 (GMT) |
commit | ef292895e9817f7134da9d4a6c7c0c699e01ae9e (patch) | |
tree | e488dfbd24af16f0dfc6ffdf518059cfa775271f | |
parent | 9f5a4ed901da65a3b5a6b63f75c99a5fe72c6832 (diff) | |
download | hdf5-ef292895e9817f7134da9d4a6c7c0c699e01ae9e.zip hdf5-ef292895e9817f7134da9d4a6c7c0c699e01ae9e.tar.gz hdf5-ef292895e9817f7134da9d4a6c7c0c699e01ae9e.tar.bz2 |
[svn-r18890] Update CMake fortran configure/build with changes from community.
- Add an install rule to copy compiled fortran module files
- Only build the xlatefile utility if testing and tools are enabled
- Don't do MPI HAVE_XXX checks until MPI_FOUND is true
- Install needs H5version.h & H5overflow.h to be copied
- Add debug information flags to debug compile and link lines for win32 Intel compiler
-rw-r--r-- | CMakeLists.txt | 22 | ||||
-rw-r--r-- | ConfigureChecks.cmake | 9 | ||||
-rw-r--r-- | fortran/CMakeLists.txt | 10 | ||||
-rw-r--r-- | hl/fortran/src/CMakeLists.txt | 3 | ||||
-rw-r--r-- | src/CMakeLists.txt | 2 |
5 files changed, 32 insertions, 14 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 52cd5fb..2efdfbe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -353,6 +353,14 @@ IF (HDF5_ENABLE_PARALLEL) INCLUDE_DIRECTORIES (${MPI_INCLUDE_PATH}) IF (MPI_FOUND) SET (H5_HAVE_PARALLEL 1) + # MPI checks, only do these if MPI_FOUND is true, otherwise they always fail + # and once set, they are cached as false and not regenerated + SET (CMAKE_REQUIRED_INCLUDES "${MPI_INCLUDE_PATH}/mpi.h" ) + SET (CMAKE_REQUIRED_LIBRARIES "${MPI_LIBRARY}" ) + CHECK_FUNCTION_EXISTS (MPI_File_get_size H5_HAVE_MPI_GET_SIZE) + # Used by Fortran + MPI + CHECK_SYMBOL_EXISTS (MPI_Comm_c2f "${MPI_INCLUDE_PATH}/mpi.h" H5_HAVE_MPI_MULTI_LANG_Comm) + CHECK_SYMBOL_EXISTS (MPI_Info_c2f "${MPI_INCLUDE_PATH}/mpi.h" H5_HAVE_MPI_MULTI_LANG_Info) ENDIF (MPI_FOUND) ENDIF (HDF5_ENABLE_PARALLEL) @@ -461,8 +469,10 @@ ADD_SUBDIRECTORY (${HDF5_SOURCE_DIR}/src ${PROJECT_BINARY_DIR}/src) #----------------------------------------------------------------------------- # Build utility to copy and strip X lines of file #----------------------------------------------------------------------------- -SET (XLATE_UTILITY "xlatefile") -ADD_EXECUTABLE(${XLATE_UTILITY} ${HDF5_SOURCE_DIR}/Resources/xlatefile.c) +IF (HDF5_BUILD_TOOLS AND BUILD_TESTING) + SET (XLATE_UTILITY "xlatefile") + ADD_EXECUTABLE(${XLATE_UTILITY} ${HDF5_SOURCE_DIR}/Resources/xlatefile.c) +ENDIF (HDF5_BUILD_TOOLS AND BUILD_TESTING) #----------------------------------------------------------------------------- # Dashboard and Testing Settings @@ -559,6 +569,14 @@ INSTALL ( HDF5-config.cmake ) +# The install rule below copies compiled module files to the install location +# using a "code" rule. The code string should not be broken up, it must be on one line +IF (HDF5_BUILD_FORTRAN) + INSTALL ( CODE + "EXECUTE_PROCESS (COMMAND \"${CMAKE_COMMAND}\" -E copy_directory \"${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}\" \"${CMAKE_INSTALL_PREFIX}/fortran\")" + ) +ENDIF (HDF5_BUILD_FORTRAN) + #----------------------------------------------------------------------------- # Export all exported targets to the build tree for use by parent project #----------------------------------------------------------------------------- diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index 46f85bb..d0ba2e2 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -367,15 +367,6 @@ CHECK_FUNCTION_EXISTS (ftello H5_HAVE_FTELLO) CHECK_FUNCTION_EXISTS (fstat64 H5_HAVE_FSTAT64) CHECK_FUNCTION_EXISTS (stat64 H5_HAVE_STAT64) -# MPI checks -SET (CMAKE_REQUIRED_INCLUDES "${MPI_INCLUDE_PATH}/mpi.h" ) -SET (CMAKE_REQUIRED_LIBRARIES "${MPI_LIBRARY}" ) -CHECK_FUNCTION_EXISTS (MPI_File_get_size H5_HAVE_MPI_GET_SIZE) - -# For Fortran+MPI -CHECK_SYMBOL_EXISTS (MPI_Comm_c2f "${MPI_INCLUDE_PATH}/mpi.h" H5_HAVE_MPI_MULTI_LANG_Comm) -CHECK_SYMBOL_EXISTS (MPI_Info_c2f "${MPI_INCLUDE_PATH}/mpi.h" H5_HAVE_MPI_MULTI_LANG_Info) - #----------------------------------------------------------------------------- #----------------------------------------------------------------------------- diff --git a/fortran/CMakeLists.txt b/fortran/CMakeLists.txt index a649fab..cf003ea 100644 --- a/fortran/CMakeLists.txt +++ b/fortran/CMakeLists.txt @@ -116,6 +116,16 @@ INCLUDE_DIRECTORIES( ) #----------------------------------------------------------------------------- +# Add debug information (intel Fortran : JB) +#----------------------------------------------------------------------------- +IF (CMAKE_Fortran_COMPILER MATCHES ifort) + IF (WIN32) + SET (CMAKE_Fortran_FLAGS_DEBUG "/debug:full " CACHE "flags" STRING FORCE) + SET (CMAKE_EXE_LINKER_FLAGS_DEBUG "/DEBUG" CACHE "flags" STRING FORCE) + ENDIF (WIN32) +ENDIF (CMAKE_Fortran_COMPILER MATCHES ifort) + +#----------------------------------------------------------------------------- # Traverse source subdirectory #----------------------------------------------------------------------------- ADD_SUBDIRECTORY (${HDF5_F90_SOURCE_DIR}/src ${HDF5_F90_BINARY_DIR}/src) diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt index 1ff49d6..da9cde8 100644 --- a/hl/fortran/src/CMakeLists.txt +++ b/hl/fortran/src/CMakeLists.txt @@ -21,9 +21,6 @@ LINK_DIRECTORIES ( #----------------------------------------------------------------------------- # List Source files #----------------------------------------------------------------------------- -#MESSAGE ("Fortran source is in ${HDF5_F90_SOURCE_DIR}/src ") - - SET (HDF5_HL_F90_F_SRCS ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5TBff.f90 ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5LTff.f90 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 506ca80..4a1c5c8 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -17,6 +17,8 @@ SET (H5_HDRS ${HDF5_SRC_DIR}/hdf5.h ${HDF5_SRC_DIR}/H5api_adpt.h ${HDF5_SRC_DIR}/H5public.h + ${HDF5_SRC_DIR}/H5version.h + ${HDF5_SRC_DIR}/H5overflow.h ) IDE_GENERATED_PROPERTIES ("H5" "${H5_HDRS}" "${H5_SRCS}" ) |