diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2010-08-31 20:20:12 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2010-08-31 20:20:12 (GMT) |
commit | c9cf76d5f9abff08e2488b79825551e99adecf42 (patch) | |
tree | 378c8c9f261dd362fe07aac3329eefab3122be72 /fortran | |
parent | 0792a4dd4c5dc399ed4a99c799e999d9e944b5ba (diff) | |
download | hdf5-c9cf76d5f9abff08e2488b79825551e99adecf42.zip hdf5-c9cf76d5f9abff08e2488b79825551e99adecf42.tar.gz hdf5-c9cf76d5f9abff08e2488b79825551e99adecf42.tar.bz2 |
[svn-r19326] Added parallel build commands.
Corrected use/name of source folder aliases.
Duplicated FindMPI.cmake so that non-c++ compiler is found first (recommemded commands did not work).
Bring r19325 from trunk
Tested: local linux with mpich
Diffstat (limited to 'fortran')
-rw-r--r-- | fortran/CMakeLists.txt | 3 | ||||
-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, 87 insertions, 3 deletions
diff --git a/fortran/CMakeLists.txt b/fortran/CMakeLists.txt index 02cd07f..a4bfb17 100644 --- a/fortran/CMakeLists.txt +++ b/fortran/CMakeLists.txt @@ -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>) |