summaryrefslogtreecommitdiffstats
path: root/fortran
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2018-01-11 15:09:18 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2018-01-11 15:09:18 (GMT)
commitf18d8a68bf44ee05d2c97914751265d531827d21 (patch)
tree71d3c29ccd3abd5ee03ce3d57daf5c7836726224 /fortran
parent88574bf85618adc96142bebf865ac2caf82c8f09 (diff)
parentc7e8a0788c68c2fe05b6b70591a499ad277c8fa5 (diff)
downloadhdf5-f18d8a68bf44ee05d2c97914751265d531827d21.zip
hdf5-f18d8a68bf44ee05d2c97914751265d531827d21.tar.gz
hdf5-f18d8a68bf44ee05d2c97914751265d531827d21.tar.bz2
Merge pull request #855 in HDFFV/hdf5 from ~BYRN/hdf5_adb:develop to develop
* commit 'c7e8a0788c68c2fe05b6b70591a499ad277c8fa5': Correct whitespace HDFFV-10385 multi-config builders need folder set HDFFV-10385 fix packaging Fix typo HDFFV-8745 remove obsolete files HDFFV-10385 includes cleanup HDFFV-10385 - add release note HDFFV-10385 fix fortran references Correct folder typo HDFFV-8745 fix minor defects HDFFV-10385 fix platform errors HDFFV-10385 refactor CMAKE_BUILD_TYPE usage
Diffstat (limited to 'fortran')
-rw-r--r--fortran/examples/h5_crtatt.f904
-rw-r--r--fortran/src/CMakeLists.txt49
-rw-r--r--fortran/test/CMakeLists.txt29
3 files changed, 39 insertions, 43 deletions
diff --git a/fortran/examples/h5_crtatt.f90 b/fortran/examples/h5_crtatt.f90
index 7e287c6..d3df380 100644
--- a/fortran/examples/h5_crtatt.f90
+++ b/fortran/examples/h5_crtatt.f90
@@ -84,6 +84,10 @@ PROGRAM H5_CRTATT
!
CALL h5aclose_f(attr_id, error)
!
+ ! Close the attribute datatype.
+ !
+ CALL h5tclose_f(atype_id, error)
+ !
! Terminate access to the data space.
!
CALL h5sclose_f(aspace_id, error)
diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt
index 18d6d80..c377d62 100644
--- a/fortran/src/CMakeLists.txt
+++ b/fortran/src/CMakeLists.txt
@@ -66,17 +66,10 @@ set_target_properties (H5_buildiface PROPERTIES
if (BUILD_SHARED_LIBS)
file (MAKE_DIRECTORY "${HDF5_F90_BINARY_DIR}/shared")
- if (WIN32)
- set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${CMAKE_BUILD_TYPE})
- else ()
- set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared)
- endif ()
-endif ()
-if (WIN32)
- set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${CMAKE_BUILD_TYPE})
-else ()
- set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static)
+ set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${HDF5_CFG_BUILD_TYPE})
endif ()
+file (MAKE_DIRECTORY "${HDF5_F90_BINARY_DIR}/static")
+set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${HDF5_CFG_BUILD_TYPE})
INCLUDE_DIRECTORIES (${HDF5_F90_BINARY_DIR} ${CMAKE_Fortran_MODULE_DIRECTORY})
@@ -87,14 +80,14 @@ add_executable (H5match_types
)
set (CMD $<TARGET_FILE:H5match_types>)
add_custom_command (
- OUTPUT ${HDF5_F90_BINARY_DIR}/H5f90i_gen.h
- ${HDF5_F90_BINARY_DIR}/H5fortran_types.F90
+ OUTPUT ${HDF5_F90_BINARY_DIR}/static/H5f90i_gen.h
+ ${HDF5_F90_BINARY_DIR}/static/H5fortran_types.F90
COMMAND ${CMD}
- WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR}
+ WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR}/static
DEPENDS H5match_types
)
-set_source_files_properties (${HDF5_F90_BINARY_DIR}/H5f90i_gen.h PROPERTIES GENERATED TRUE)
-set_source_files_properties (${HDF5_F90_BINARY_DIR}/H5fortran_types.F90 PROPERTIES GENERATED TRUE)
+set_source_files_properties (${HDF5_F90_BINARY_DIR}/static/H5f90i_gen.h PROPERTIES GENERATED TRUE)
+set_source_files_properties (${HDF5_F90_BINARY_DIR}/static/H5fortran_types.F90 PROPERTIES GENERATED TRUE)
if (BUILD_SHARED_LIBS)
set (CMDSH $<TARGET_FILE:H5match_types>)
add_custom_command (
@@ -133,10 +126,15 @@ set_source_files_properties (${f90CStub_C_SOURCES} PROPERTIES LANGUAGE C)
set (f90CStub_C_HDRS
# generated files
- ${HDF5_F90_BINARY_DIR}/H5f90i_gen.h
+ ${HDF5_F90_BINARY_DIR}/static/H5f90i_gen.h
+)
+set (f90CStub_C_SHHDRS
+ # generated files
+ ${HDF5_F90_BINARY_DIR}/shared/H5f90i_gen.h
)
add_library (${HDF5_F90_C_LIB_TARGET} STATIC ${f90CStub_C_SOURCES} ${f90CStub_C_HDRS})
+target_include_directories(${HDF5_F90_C_LIB_TARGET} PRIVATE ${HDF5_F90_BINARY_DIR}/static)
TARGET_C_PROPERTIES (${HDF5_F90_C_LIB_TARGET} STATIC " " " ")
target_link_libraries (${HDF5_F90_C_LIB_TARGET} PUBLIC ${HDF5_LIB_TARGET})
set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_F90_C_LIB_TARGET}")
@@ -149,7 +147,8 @@ set_target_properties (${HDF5_F90_C_LIB_TARGET} PROPERTIES
set (install_targets ${HDF5_F90_C_LIB_TARGET})
if (BUILD_SHARED_LIBS)
- add_library (${HDF5_F90_C_LIBSH_TARGET} SHARED ${f90CStub_C_SOURCES} ${f90CStub_C_HDRS})
+ add_library (${HDF5_F90_C_LIBSH_TARGET} SHARED ${f90CStub_C_SOURCES} ${f90CStub_C_SHHDRS})
+ target_include_directories(${HDF5_F90_C_LIBSH_TARGET} PRIVATE ${HDF5_F90_BINARY_DIR}/shared)
TARGET_C_PROPERTIES (${HDF5_F90_C_LIBSH_TARGET} SHARED " " " ")
target_link_libraries (${HDF5_F90_C_LIBSH_TARGET} PUBLIC ${HDF5_LIBSH_TARGET})
set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_F90_C_LIBSH_TARGET}")
@@ -174,16 +173,16 @@ set (f90_F_GEN_SOURCES
)
set (CMD $<TARGET_FILE:H5_buildiface>)
add_custom_command (
- OUTPUT ${HDF5_F90_BINARY_DIR}/H5_gen.F90
+ OUTPUT ${HDF5_F90_BINARY_DIR}/static/H5_gen.F90
COMMAND ${CMD}
- WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR}
+ WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR}/static
DEPENDS ${f90_F_GEN_SOURCES}
COMMENT "Generating the H5_gen.F90 file"
)
add_custom_target (H5gen ALL
- DEPENDS ${HDF5_F90_BINARY_DIR}/H5_gen.F90
+ DEPENDS ${HDF5_F90_BINARY_DIR}/static/H5_gen.F90
)
-set_source_files_properties (${HDF5_F90_BINARY_DIR}/H5_gen.F90 PROPERTIES GENERATED TRUE)
+set_source_files_properties (${HDF5_F90_BINARY_DIR}/static/H5_gen.F90 PROPERTIES GENERATED TRUE)
if (BUILD_SHARED_LIBS)
set (CMDSH $<TARGET_FILE:H5_buildiface>)
@@ -222,12 +221,12 @@ set (f90_F_BASE_SOURCES
set (f90_F_SOURCES
# generated file
- ${HDF5_F90_BINARY_DIR}/H5fortran_types.F90
+ ${HDF5_F90_BINARY_DIR}/static/H5fortran_types.F90
${f90_F_BASE_SOURCES}
# generated file
- ${HDF5_F90_BINARY_DIR}/H5_gen.F90
+ ${HDF5_F90_BINARY_DIR}/static/H5_gen.F90
# normal distribution
${HDF5_F90_SRC_SOURCE_DIR}/HDF5.F90
@@ -315,8 +314,8 @@ install (
${HDF5_F90_SRC_SOURCE_DIR}/H5f90.h
${HDF5_F90_SRC_SOURCE_DIR}/H5f90i.h
${HDF5_F90_SRC_SOURCE_DIR}/H5f90proto.h
- ${HDF5_F90_BINARY_DIR}/H5f90i_gen.h
- ${HDF5_F90_BINARY_DIR}/H5fortran_types.F90
+ ${HDF5_F90_BINARY_DIR}/static/H5f90i_gen.h
+ ${HDF5_F90_BINARY_DIR}/static/H5fortran_types.F90
DESTINATION
${HDF5_INSTALL_INCLUDE_DIR}
COMPONENT
diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt
index 3c3eb8f..9946aa0 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 (${HDF5_F90_BINARY_DIR} ${HDF5_F90_SRC_DIR}/src)
+INCLUDE_DIRECTORIES (${CMAKE_Fortran_MODULE_DIRECTORY} ${HDF5_F90_BINARY_DIR} ${HDF5_F90_SRC_DIR}/src)
#-----------------------------------------------------------------------------
# Setup the Fortran auto-detection utilities
@@ -34,25 +34,17 @@ set_target_properties (H5_test_buildiface PROPERTIES
if (BUILD_SHARED_LIBS)
file (MAKE_DIRECTORY "${HDF5_F90_BINARY_DIR}/shared")
- if (WIN32)
- set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${CMAKE_BUILD_TYPE})
- else ()
- set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared)
- endif ()
+ set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${HDF5_CFG_BUILD_TYPE})
endif ()
-if (WIN32)
- set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${CMAKE_BUILD_TYPE})
-else ()
- set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static)
-endif ()
-
-INCLUDE_DIRECTORIES (${CMAKE_Fortran_MODULE_DIRECTORY} ${MOD_BUILD_DIR})
+file (MAKE_DIRECTORY "${HDF5_F90_BINARY_DIR}/static")
+set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${HDF5_CFG_BUILD_TYPE})
#-----------------------------------------------------------------------------
# Add Test Lib
#-----------------------------------------------------------------------------
add_library (${HDF5_F90_C_TEST_LIB_TARGET} STATIC t.c)
set_source_files_properties (t.c PROPERTIES LANGUAGE C)
+target_include_directories(${HDF5_F90_C_TEST_LIB_TARGET} PRIVATE ${HDF5_F90_BINARY_DIR}/static)
TARGET_C_PROPERTIES (${HDF5_F90_C_TEST_LIB_TARGET} STATIC " " " ")
target_link_libraries (${HDF5_F90_C_TEST_LIB_TARGET}
${HDF5_F90_C_LIB_TARGET}
@@ -66,6 +58,7 @@ set_target_properties (${HDF5_F90_C_TEST_LIB_TARGET} PROPERTIES
)
if (BUILD_SHARED_LIBS)
add_library (${HDF5_F90_C_TEST_LIBSH_TARGET} SHARED t.c)
+ target_include_directories(${HDF5_F90_C_TEST_LIBSH_TARGET} PRIVATE ${HDF5_F90_BINARY_DIR}/shared)
TARGET_C_PROPERTIES (${HDF5_F90_C_TEST_LIBSH_TARGET} SHARED " " " ")
target_link_libraries (${HDF5_F90_C_TEST_LIBSH_TARGET}
${HDF5_F90_C_LIBSH_TARGET}
@@ -83,16 +76,16 @@ endif ()
set (CMD $<TARGET_FILE:H5_test_buildiface>)
add_custom_command (
- OUTPUT ${HDF5_F90_BINARY_DIR}/tf_gen.F90
+ OUTPUT ${HDF5_F90_BINARY_DIR}/static/tf_gen.F90
COMMAND ${CMD}
- WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR}
+ WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR}/static
DEPENDS H5_test_buildiface
COMMENT "Generating the tf_gen.F90 file"
)
add_custom_target (H5testgen ALL
- DEPENDS ${HDF5_F90_BINARY_DIR}/tf_gen.F90
+ DEPENDS ${HDF5_F90_BINARY_DIR}/static/tf_gen.F90
)
-set_source_files_properties (${HDF5_F90_BINARY_DIR}/tf_gen.F90 PROPERTIES GENERATED TRUE)
+set_source_files_properties (${HDF5_F90_BINARY_DIR}/static/tf_gen.F90 PROPERTIES GENERATED TRUE)
if (BUILD_SHARED_LIBS)
set (CMDSH $<TARGET_FILE:H5_test_buildiface>)
@@ -111,7 +104,7 @@ endif ()
set (HDF5_F90_TF_SOURCES
# generated files
- ${HDF5_F90_BINARY_DIR}/tf_gen.F90
+ ${HDF5_F90_BINARY_DIR}/static/tf_gen.F90
# normal distribution
tf.F90