summaryrefslogtreecommitdiffstats
path: root/fortran/examples
diff options
context:
space:
mode:
Diffstat (limited to 'fortran/examples')
-rw-r--r--fortran/examples/CMakeLists.txt147
-rw-r--r--fortran/examples/Makefile.in2
2 files changed, 119 insertions, 30 deletions
diff --git a/fortran/examples/CMakeLists.txt b/fortran/examples/CMakeLists.txt
index 8b7333a..0c570c6 100644
--- a/fortran/examples/CMakeLists.txt
+++ b/fortran/examples/CMakeLists.txt
@@ -1,16 +1,11 @@
cmake_minimum_required (VERSION 3.10)
-PROJECT (HDF5_F90_EXAMPLES C CXX Fortran)
+project (HDF5_F90_EXAMPLES C Fortran)
# --------------------------------------------------------------------
# Notes: When creating examples they should be prefixed
# with "f90_ex_". This allows for easier filtering of the examples.
# --------------------------------------------------------------------
#-----------------------------------------------------------------------------
-# Setup include Directories
-#-----------------------------------------------------------------------------
-INCLUDE_DIRECTORIES (${HDF5_F90_BINARY_DIR} ${HDF5_F90_SRC_DIR}/src)
-
-#-----------------------------------------------------------------------------
# Define Sources
#-----------------------------------------------------------------------------
set (examples
@@ -40,12 +35,27 @@ set (F2003_examples
foreach (example ${examples})
add_executable (f90_ex_${example} ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90)
- TARGET_FORTRAN_PROPERTIES (f90_ex_${example} STATIC " " " ")
+ target_include_directories (f90_ex_${example}
+ PRIVATE
+ "${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static"
+ )
+ target_compile_options(f90_ex_${example}
+ PRIVATE
+ $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>
+ )
target_link_libraries (f90_ex_${example}
- ${HDF5_F90_LIB_TARGET}
- ${HDF5_LIB_TARGET}
+ PRIVATE
+ ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET}
)
- target_include_directories (f90_ex_${example} PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static)
+# set_property(TARGET f90_ex_${example} APPEND PROPERTY
+# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">
+# )
+# set_property(TARGET f90_ex_${example} APPEND PROPERTY
+# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:>
+# )
+ if(MSVC)
+ set_property(TARGET f90_ex_${example} PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}")
+ endif()
set_target_properties (f90_ex_${example} PROPERTIES
LINKER_LANGUAGE Fortran
FOLDER examples/fortran
@@ -53,12 +63,27 @@ foreach (example ${examples})
)
if (BUILD_SHARED_LIBS)
add_executable (f90_ex_${example}-shared ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90)
- TARGET_FORTRAN_PROPERTIES (f90_ex_${example}-shared SHARED " " " ")
+ target_include_directories (f90_ex_${example}-shared
+ PRIVATE
+ "${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared"
+ )
+ target_compile_options(f90_ex_${example}-shared
+ PRIVATE
+ $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>
+ )
target_link_libraries (f90_ex_${example}-shared
- ${HDF5_F90_LIBSH_TARGET}
- ${HDF5_LIBSH_TARGET}
+ PRIVATE
+ ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}
)
- target_include_directories (f90_ex_${example}-shared PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/shared)
+# set_property(TARGET f90_ex_${example}-shared APPEND PROPERTY
+# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">
+# )
+# set_property(TARGET f90_ex_${example}-shared APPEND PROPERTY
+# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>
+# )
+ if(MSVC)
+ set_property(TARGET f90_ex_${example}-shared PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}")
+ endif()
set_target_properties (f90_ex_${example}-shared PROPERTIES
LINKER_LANGUAGE Fortran
FOLDER examples/fortran
@@ -69,12 +94,27 @@ endforeach ()
foreach (example ${F2003_examples})
add_executable (f03_ex_${example} ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90)
- TARGET_FORTRAN_PROPERTIES (f03_ex_${example} STATIC " " " ")
+ target_include_directories (f03_ex_${example}
+ PRIVATE
+ "${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static"
+ )
+ target_compile_options(f03_ex_${example}
+ PRIVATE
+ $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>
+ )
target_link_libraries (f03_ex_${example}
- ${HDF5_F90_LIB_TARGET}
- ${HDF5_LIB_TARGET}
+ PRIVATE
+ ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET}
)
- target_include_directories (f03_ex_${example} PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static)
+# set_property(TARGET f03_ex_${example} APPEND PROPERTY
+# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">
+# )
+# set_property(TARGET f03_ex_${example} APPEND PROPERTY
+# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>
+# )
+ if(MSVC)
+ set_property(TARGET f03_ex_${example} PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}")
+ endif()
set_target_properties (f03_ex_${example} PROPERTIES
LINKER_LANGUAGE Fortran
FOLDER examples/fortran03
@@ -82,12 +122,27 @@ foreach (example ${F2003_examples})
)
if (BUILD_SHARED_LIBS)
add_executable (f03_ex_${example}-shared ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90)
- TARGET_FORTRAN_PROPERTIES (f03_ex_${example}-shared SHARED " " " ")
+ target_include_directories (f03_ex_${example}-shared
+ PRIVATE
+ "${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared"
+ )
+ target_compile_options(f03_ex_${example}-shared
+ PRIVATE
+ $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>
+ )
target_link_libraries (f03_ex_${example}-shared
- ${HDF5_F90_LIBSH_TARGET}
- ${HDF5_LIBSH_TARGET}
+ PRIVATE
+ ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}
)
- target_include_directories (f03_ex_${example}-shared PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/shared)
+# set_property(TARGET f03_ex_${example}-shared APPEND PROPERTY
+# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">
+# )
+# set_property(TARGET f03_ex_${example}-shared APPEND PROPERTY
+# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>
+# )
+ if(MSVC)
+ set_property(TARGET f03_ex_${example}-shared PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}")
+ endif()
set_target_properties (f03_ex_${example}-shared PROPERTIES
LINKER_LANGUAGE Fortran
FOLDER examples/fortran03
@@ -98,12 +153,28 @@ endforeach ()
if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND)
add_executable (f90_ex_ph5example ${HDF5_F90_EXAMPLES_SOURCE_DIR}/ph5example.f90)
- TARGET_FORTRAN_PROPERTIES (f90_ex_ph5example STATIC " " " ")
+ target_include_directories (f90_ex_ph5example
+ PRIVATE
+ "${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static;$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_Fortran_INCLUDE_DIRS}>"
+ )
+ target_compile_options(f90_ex_ph5example
+ PRIVATE
+ $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>
+ )
target_link_libraries (f90_ex_ph5example
- ${HDF5_F90_LIB_TARGET}
- ${HDF5_LIB_TARGET}
+ PRIVATE
+ ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET}
+ $<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_Fortran_LIBRARIES}>
)
- target_include_directories (f90_ex_ph5example PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static)
+# set_property(TARGET f90_ex_ph5example APPEND PROPERTY
+# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">
+# )
+# set_property(TARGET f90_ex_ph5example APPEND PROPERTY
+# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>
+# )
+ if(MSVC)
+ set_property(TARGET f90_ex_ph5example PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}")
+ endif()
set_target_properties (f90_ex_ph5example PROPERTIES
LINKER_LANGUAGE Fortran
FOLDER examples/fortran
@@ -111,12 +182,28 @@ if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND)
)
if (BUILD_SHARED_LIBS)
add_executable (f90_ex_ph5example-shared ${HDF5_F90_EXAMPLES_SOURCE_DIR}/ph5example.f90)
- TARGET_FORTRAN_PROPERTIES (f90_ex_ph5example-shared SHARED " " " ")
+ target_include_directories (f90_ex_ph5example-shared
+ PRIVATE
+ "${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared;$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_Fortran_INCLUDE_DIRS}>"
+ )
+ target_compile_options(f90_ex_ph5example-shared
+ PRIVATE
+ $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>
+ )
target_link_libraries (f90_ex_ph5example-shared
- ${HDF5_F90_LIBSH_TARGET}
- ${HDF5_LIBSH_TARGET}
+ PRIVATE
+ ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}
+ $<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_Fortran_LIBRARIES}>
)
- target_include_directories (f90_ex_ph5example-shared PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/shared)
+# set_property(TARGET f90_ex_ph5example-shared APPEND PROPERTY
+# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">
+# )
+# set_property(TARGET f90_ex_ph5example-shared APPEND PROPERTY
+# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>
+# )
+ if(MSVC)
+ set_property(TARGET f90_ex_ph5example-shared PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}")
+ endif()
set_target_properties (f90_ex_ph5example-shared PROPERTIES
LINKER_LANGUAGE Fortran
FOLDER examples/fortran
diff --git a/fortran/examples/Makefile.in b/fortran/examples/Makefile.in
index 347f8a8..9fa7de6 100644
--- a/fortran/examples/Makefile.in
+++ b/fortran/examples/Makefile.in
@@ -490,6 +490,7 @@ JAVA_PATH_NAME = @JAVA_PATH_NAME@
JAVA_VERSION = @JAVA_VERSION@
JNIFLAGS = @JNIFLAGS@
JUNIT = @JUNIT@
+LARGE_PARALLEL_IO = @LARGE_PARALLEL_IO@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
@@ -537,6 +538,7 @@ PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@
PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@
PAC_FORTRAN_NUM_INTEGER_KINDS = @PAC_FORTRAN_NUM_INTEGER_KINDS@
PARALLEL = @PARALLEL@
+PARALLEL_FILTERED_WRITES = @PARALLEL_FILTERED_WRITES@
PATH_SEPARATOR = @PATH_SEPARATOR@
PROFILING = @PROFILING@
RANLIB = @RANLIB@