diff options
Diffstat (limited to 'fortran')
-rw-r--r-- | fortran/CMakeLists.txt | 19 | ||||
-rw-r--r-- | fortran/examples/CMakeLists.txt | 36 | ||||
-rw-r--r-- | fortran/test/CMakeLists.txt | 2 | ||||
-rw-r--r-- | fortran/testpar/CMakeLists.txt | 49 |
4 files changed, 95 insertions, 11 deletions
diff --git a/fortran/CMakeLists.txt b/fortran/CMakeLists.txt index 9fc9ba0..a4bfb17 100644 --- a/fortran/CMakeLists.txt +++ b/fortran/CMakeLists.txt @@ -110,19 +110,19 @@ CHECK_FORTRAN_FEATURE(RealIsNotDouble #----------------------------------------------------------------------------- # Make sure generated files and modules are picked up correctly #----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES( - ${CMAKE_Fortran_MODULE_DIRECTORY} - ${HDF5_F90_BINARY_DIR} - ) +INCLUDE_DIRECTORIES ( + ${CMAKE_Fortran_MODULE_DIRECTORY} + ${HDF5_F90_BINARY_DIR} +) #----------------------------------------------------------------------------- # Add debug information (intel Fortran : JB) #----------------------------------------------------------------------------- IF (CMAKE_Fortran_COMPILER MATCHES ifort) - IF (WIN32) - SET (CMAKE_Fortran_FLAGS_DEBUG "/debug:full /dbglibs " CACHE "flags" STRING FORCE) - SET (CMAKE_EXE_LINKER_FLAGS_DEBUG "/DEBUG" CACHE "flags" STRING FORCE) - ENDIF (WIN32) + IF (WIN32) + SET (CMAKE_Fortran_FLAGS_DEBUG "/debug:full /dbglibs " CACHE "flags" STRING FORCE) + SET (CMAKE_EXE_LINKER_FLAGS_DEBUG "/DEBUG" CACHE "flags" STRING FORCE) + ENDIF (WIN32) ENDIF (CMAKE_Fortran_COMPILER MATCHES ifort) #----------------------------------------------------------------------------- @@ -149,4 +149,7 @@ ENDIF (HDF5_BUILD_EXAMPLES) #----------------------------------------------------------------------------- IF (BUILD_TESTING) ADD_SUBDIRECTORY (${HDF5_F90_SOURCE_DIR}/test ${HDF5_F90_BINARY_DIR}/test) + IF (H5_HAVE_PARALLEL) + ADD_SUBDIRECTORY (${HDF5_F90_SOURCE_DIR}/testpar ${HDF5_F90_BINARY_DIR}/testpar) + ENDIF (H5_HAVE_PARALLEL) ENDIF (BUILD_TESTING) diff --git a/fortran/examples/CMakeLists.txt b/fortran/examples/CMakeLists.txt index f8a453e..f1ed52f 100644 --- a/fortran/examples/CMakeLists.txt +++ b/fortran/examples/CMakeLists.txt @@ -1,14 +1,14 @@ cmake_minimum_required (VERSION 2.8) +PROJECT (HDF5_F90_EXAMPLES C CXX Fortran) # -------------------------------------------------------------------- # Notes: When creating examples they should be prefixed # with "f90_ex_". This allows for easier filtering of the examples. # -------------------------------------------------------------------- -PROJECT (HDF5_F90_EXAMPLES C CXX Fortran) #----------------------------------------------------------------------------- # Setup include Directories #----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES (${CMAKE_Fortran_MODULE_DIRECTORY} ${HDF5_F90_BINARY_DIR} ${HDF5_F90_SOURCE_DIR}/src) +INCLUDE_DIRECTORIES (${CMAKE_Fortran_MODULE_DIRECTORY} ${HDF5_F90_BINARY_DIR} ${HDF5_F90_SRC_DIR}/src) LINK_DIRECTORIES ( ${CMAKE_Fortran_MODULE_DIRECTORY} ${HDF5_F90_BINARY_DIR} @@ -66,3 +66,35 @@ FOREACH (example ${examples}) ${HDF5_LIB_TARGET} ) ENDFOREACH (example ${examples}) + +IF (H5_HAVE_PARALLEL) + ADD_EXECUTABLE (f90_ex_ph5example ${HDF5_F90_EXAMPLES_SOURCE_DIR}/ph5example.f90) + H5_NAMING (f90_ex_ph5example) + IF (WIN32) + IF (BUILD_SHARED_LIBS) + IF (MSVC) + SET_TARGET_PROPERTIES (f90_ex_ph5example + PROPERTIES + COMPILE_FLAGS "/dll" + LINK_FLAGS "/SUBSYSTEM:CONSOLE" + ) + ENDIF (MSVC) + ELSE (BUILD_SHARED_LIBS) + IF (MSVC) + SET_TARGET_PROPERTIES (f90_ex_ph5example + PROPERTIES + LINK_FLAGS "/NODEFAULTLIB:MSVCRT" + ) + ENDIF (MSVC) + ENDIF (BUILD_SHARED_LIBS) + SET_PROPERTY (TARGET f90_ex_ph5example + APPEND PROPERTY COMPILE_DEFINITIONS + HDF5F90_WINDOWS + ) + SET_TARGET_PROPERTIES (f90_ex_ph5example PROPERTIES LINKER_LANGUAGE Fortran) + ENDIF (WIN32) + TARGET_LINK_LIBRARIES (f90_ex_ph5example + ${HDF5_F90_LIB_TARGET} + ${HDF5_LIB_TARGET} + ) +ENDIF (H5_HAVE_PARALLEL) diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt index 7875f97..26475e6 100644 --- a/fortran/test/CMakeLists.txt +++ b/fortran/test/CMakeLists.txt @@ -4,7 +4,7 @@ PROJECT (HDF5_FORTRAN_TESTS C CXX Fortran) #----------------------------------------------------------------------------- # Setup include Directories #----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES (${CMAKE_Fortran_MODULE_DIRECTORY} ${HDF5_F90_BINARY_DIR} ${HDF5_F90_SOURCE_DIR}/src) +INCLUDE_DIRECTORIES (${CMAKE_Fortran_MODULE_DIRECTORY} ${HDF5_F90_BINARY_DIR} ${HDF5_F90_SRC_DIR}/src) LINK_DIRECTORIES ( ${CMAKE_Fortran_MODULE_DIRECTORY} ${HDF5_F90_BINARY_DIR} diff --git a/fortran/testpar/CMakeLists.txt b/fortran/testpar/CMakeLists.txt new file mode 100644 index 0000000..4b9d4f1 --- /dev/null +++ b/fortran/testpar/CMakeLists.txt @@ -0,0 +1,49 @@ +cmake_minimum_required (VERSION 2.8) +PROJECT (HDF5_FORTRAN_TESTPAR C CXX Fortran) + +#----------------------------------------------------------------------------- +# Setup include Directories +#----------------------------------------------------------------------------- +INCLUDE_DIRECTORIES (${CMAKE_Fortran_MODULE_DIRECTORY} ${HDF5_F90_BINARY_DIR} ${HDF5_F90_SRC_DIR}/src) +LINK_DIRECTORIES ( + ${CMAKE_Fortran_MODULE_DIRECTORY} + ${HDF5_F90_BINARY_DIR} + ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} +) + +#----------------------------------------------------------------------------- +# Add Tests +#----------------------------------------------------------------------------- + +#-- Adding test for parallel_test +ADD_EXECUTABLE (parallel_test + ptest.f90 + hyper.f90 + mdset.f90 +) +H5_NAMING (parallel_test) +TARGET_LINK_LIBRARIES (parallel_test + ${HDF5_F90_TEST_LIB_TARGET} + ${HDF5_F90_LIB_TARGET} + ${HDF5_LIB_TARGET} +) +IF (WIN32) + IF (MSVC) + TARGET_LINK_LIBRARIES (parallel_test "ws2_32.lib") + IF (BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (parallel_test + PROPERTIES + COMPILE_FLAGS "/dll" + LINK_FLAGS "/SUBSYSTEM:CONSOLE" + ) + ELSE (BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (parallel_test + PROPERTIES + LINK_FLAGS "/NODEFAULTLIB:MSVCRT" + ) + ENDIF (BUILD_SHARED_LIBS) + ENDIF (MSVC) +ENDIF (WIN32) +SET_TARGET_PROPERTIES (parallel_test PROPERTIES LINKER_LANGUAGE Fortran) + +ADD_TEST (NAME parallel_test COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $<TARGET_FILE:parallel_test>) |