Skip to content

Commit d460591

Browse files
authored
Remove H5detect and H5make_libsettings (HDFGroup#3104)
Removes H5detect and H5make_libsettings from the build and replaces their functionality with things that don't affect cross-compiling. H5detect --> floating-point types are now detected on library load H5make_libsettings --> Moved functionality to a new H5build_settings.c template file
1 parent 9e7e2f8 commit d460591

23 files changed

+911
-1531
lines changed

CMakeLists.txt

-6
Original file line numberDiff line numberDiff line change
@@ -1218,10 +1218,4 @@ endif ()
12181218
#-----------------------------------------------------------------------------
12191219
configure_file (${HDF_RESOURCES_DIR}/H5pubconf.h.in ${HDF5_SRC_BINARY_DIR}/H5pubconf.h @ONLY)
12201220

1221-
#-----------------------------------------------------------------------------
1222-
# Options for use by cross compiling and toolchains
1223-
#-----------------------------------------------------------------------------
1224-
option (HDF5_USE_PREGEN "Use pre-generated Files" OFF)
1225-
option (HDF5_BATCH_H5DETECT "Use a batch command for running h5detect" OFF)
1226-
12271221
include (CMakeInstallation.cmake)

bin/batch/knl_H5detect.sl.in.cmake

-20
This file was deleted.

bin/checkposix

+1-5
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,13 @@ foreach $arg (@ARGV) {
3737
# Skip files that don't include H5private.h
3838
# H5system. has to be inspected by hand since it wraps POSIX files
3939
#
40-
# H5detect and H5make_libsettings are created before the library exists
41-
# so calls that link to function replacements won't work. We'll ignore
42-
# it here.
43-
#
4440
# If a user specifies one file, process it no matter what so people
4541
# can inspect files we normally skip (like H5system.c).
4642

4743
$ignore = 0;
4844

4945
# Ignored files in src/
50-
if($#ARGV gt 0 and $filename =~ /H5FDmulti|H5FDstdio|H5VLpassthru|H5system|H5detect|H5make_libsettings/) {
46+
if($#ARGV gt 0 and $filename =~ /H5FDmulti|H5FDstdio|H5VLpassthru|H5system/) {
5147
$ignore = 1;
5248
}
5349
# Ignored atomic test files in test/

config/cmake/libhdf5.settings.cmake.in

+17-15
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ Linking Options:
2828
AM_LDFLAGS: @AM_LDFLAGS@
2929
Extra libraries: @LINK_LIBS@
3030
Archiver: @CMAKE_AR@
31+
AR_FLAGS:
3132
Ranlib: @CMAKE_RANLIB@
3233

3334
Languages:
@@ -44,24 +45,24 @@ Languages:
4445
Static C Library: @H5_ENABLE_STATIC_LIB@
4546

4647
Fortran: @HDF5_BUILD_FORTRAN@
47-
@BUILD_FORTRAN_CONDITIONAL_TRUE@ Fortran Compiler: @CMAKE_Fortran_COMPILER@ @CMAKE_Fortran_COMPILER_VERSION@
48-
@BUILD_FORTRAN_CONDITIONAL_TRUE@ Fortran Flags: @CMAKE_Fortran_FLAGS@
49-
@BUILD_FORTRAN_CONDITIONAL_TRUE@ H5 Fortran Flags: @HDF5_CMAKE_Fortran_FLAGS@
50-
@BUILD_FORTRAN_CONDITIONAL_TRUE@ AM Fortran Flags: @AM_FCFLAGS@
51-
@BUILD_FORTRAN_CONDITIONAL_TRUE@ Shared Fortran Library: @H5_ENABLE_SHARED_LIB@
52-
@BUILD_FORTRAN_CONDITIONAL_TRUE@ Static Fortran Library: @H5_ENABLE_STATIC_LIB@
53-
@BUILD_FORTRAN_CONDITIONAL_TRUE@ Module Directory: @CMAKE_Fortran_MODULE_DIRECTORY@
48+
Fortran Compiler: @CMAKE_Fortran_COMPILER@ @CMAKE_Fortran_COMPILER_VERSION@
49+
Fortran Flags: @CMAKE_Fortran_FLAGS@
50+
H5 Fortran Flags: @HDF5_CMAKE_Fortran_FLAGS@
51+
AM Fortran Flags: @AM_FCFLAGS@
52+
Shared Fortran Library: @H5_ENABLE_SHARED_LIB@
53+
Static Fortran Library: @H5_ENABLE_STATIC_LIB@
54+
Module Directory: @CMAKE_Fortran_MODULE_DIRECTORY@
5455

5556
C++: @HDF5_BUILD_CPP_LIB@
56-
@BUILD_CXX_CONDITIONAL_TRUE@ C++ Compiler: @CMAKE_CXX_COMPILER@ @CMAKE_CXX_COMPILER_VERSION@
57-
@BUILD_CXX_CONDITIONAL_TRUE@ C++ Flags: @CMAKE_CXX_FLAGS@
58-
@BUILD_CXX_CONDITIONAL_TRUE@ H5 C++ Flags: @HDF5_CMAKE_CXX_FLAGS@
59-
@BUILD_CXX_CONDITIONAL_TRUE@ AM C++ Flags: @AM_CXXFLAGS@
60-
@BUILD_CXX_CONDITIONAL_TRUE@ Shared C++ Library: @H5_ENABLE_SHARED_LIB@
61-
@BUILD_CXX_CONDITIONAL_TRUE@ Static C++ Library: @H5_ENABLE_STATIC_LIB@
57+
C++ Compiler: @CMAKE_CXX_COMPILER@ @CMAKE_CXX_COMPILER_VERSION@
58+
C++ Flags: @CMAKE_CXX_FLAGS@
59+
H5 C++ Flags: @HDF5_CMAKE_CXX_FLAGS@
60+
AM C++ Flags: @AM_CXXFLAGS@
61+
Shared C++ Library: @H5_ENABLE_SHARED_LIB@
62+
Static C++ Library: @H5_ENABLE_STATIC_LIB@
6263

63-
JAVA: @HDF5_BUILD_JAVA@
64-
@BUILD_JAVA_CONDITIONAL_TRUE@ JAVA Compiler: @CMAKE_Java_COMPILER@ @Java_VERSION@
64+
JAVA: @HDF5_BUILD_JAVA@
65+
JAVA Compiler: @CMAKE_Java_COMPILER@ @Java_VERSION@
6566

6667
Features:
6768
---------
@@ -77,6 +78,7 @@ Dimension scales w/ new references: @DIMENSION_SCALES_WITH_NEW_REF@
7778
Default API mapping: @DEFAULT_API_VERSION@
7879
With deprecated public symbols: @HDF5_ENABLE_DEPRECATED_SYMBOLS@
7980
I/O filters (external): @EXTERNAL_FILTERS@
81+
Map (H5M) API: @H5_HAVE_MAP_API@
8082
Direct VFD: @H5_HAVE_DIRECT@
8183
Mirror VFD: @H5_HAVE_MIRROR_VFD@
8284
Subfiling VFD: @H5_HAVE_SUBFILING_VFD@

configure.ac

+19-5
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,21 @@ AM_MAINTAINER_MODE([enable])
8181
## This allows multiple src-dir builds within one host.
8282
AC_PREFIX_DEFAULT([`pwd`/hdf5])
8383

84-
## Run post processing on files created by configure.
84+
## Run post processing on files created by configure
85+
##
8586
## src/H5pubconf.h:
8687
## Generate src/H5pubconf.h from src/H5config.h by prepending H5_ to all
8788
## macro names. This avoid name conflict between HDF5 macro names and those
8889
## generated by another software package that uses the HDF5 library.
90+
##
8991
## src/libhdf5.settings:
90-
## Remove all lines begun with "#" which are generated by CONDITIONAL's of
91-
## configure.
92+
## Remove all lines beginning with "#" which are generated by CONDITIONAL's
93+
## of configure.
94+
##
95+
## src/H5build_settings.c
96+
## Remove all lines beginning with "#" which are generated by CONDITIONAL's
97+
## of configure. This uses a check for whitespace after the pound sign
98+
## to avoid clobbering include statements.
9299
AC_CONFIG_COMMANDS([pubconf], [
93100
echo "creating src/H5pubconf.h"
94101
sed 's/#define /#define H5_/' <src/H5config.h |\
@@ -105,6 +112,10 @@ AC_CONFIG_COMMANDS([pubconf], [
105112
sed '/^#/d' < src/libhdf5.settings > libhdf5.settings.TMP
106113
cp libhdf5.settings.TMP src/libhdf5.settings
107114
rm -f libhdf5.settings.TMP
115+
echo "Post process src/H5build_settings.c"
116+
sed '/^# /d' < src/H5build_settings.c > H5build_settings.TMP
117+
cp H5build_settings.TMP src/H5build_settings.c
118+
rm -f H5build_settings.TMP
108119
])
109120

110121
## It's possible to configure for a host other than the one on which
@@ -3725,9 +3736,11 @@ AC_ARG_ENABLE([embedded-libinfo],
37253736

37263737
if test "${enable_embedded_libinfo}" = "yes"; then
37273738
AC_MSG_RESULT([yes])
3739+
BUILD_SETTINGS_FILE="src/H5build_settings.autotools.c.in"
37283740
AC_DEFINE([HAVE_EMBEDDED_LIBINFO], [1],
37293741
[Define if library information should be embedded in the executables])
37303742
else
3743+
BUILD_SETTINGS_FILE="src/H5build_settings.off.c.in"
37313744
AC_MSG_RESULT([no])
37323745
fi
37333746

@@ -3860,10 +3873,11 @@ fi
38603873
##
38613874
AM_CONDITIONAL([HAVE_SHARED_CONDITIONAL], [test "X$enable_shared" = "Xyes"])
38623875

3863-
AC_CONFIG_FILES([src/libhdf5.settings
3864-
Makefile
3876+
AC_CONFIG_FILES([Makefile
38653877
doxygen/Doxyfile
38663878
src/Makefile
3879+
src/libhdf5.settings
3880+
src/H5build_settings.c:${BUILD_SETTINGS_FILE}
38673881
test/Makefile
38683882
test/H5srcdir_str.h
38693883
test/test_abort_fail.sh

release_docs/INSTALL_CMake.txt

-9
Original file line numberDiff line numberDiff line change
@@ -1030,15 +1030,6 @@ References:
10301030
https://stackoverflow.com/questions/54539682/how-to-set-up-cmake-to-cross-compile-with-clang-for-arm-embedded-on-windows?rq=1
10311031
https://developer.android.com/ndk/guides/cmake
10321032

1033-
Predefine H5Tinit.c file
1034-
-------------------------------
1035-
The one file that needs to be pre-generated is the H5Tinit.c file. The variables
1036-
indicated in the error log (see above) are the variables that need to match the target system.
1037-
1038-
The HDF5 CMake variables;
1039-
HDF5_USE_PREGEN: set this to true
1040-
HDF5_USE_PREGEN_DIR: set this path to the preset H5Tinit.c file
1041-
10421033

10431034
========================================================================
10441035
X: Using CMakePresets.json for compiling

release_docs/README_HPC

-19
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ Section II: Obtain HDF5 source
99
Section III: Using ctest command to build and test
1010
Section IV: Cross compiling
1111
Section V: Manual alternatives
12-
Section VI: Other cross compiling options
1312

1413
************************************************************************
1514

@@ -184,21 +183,3 @@ or
184183
for parallel builds.
185184

186185
Tests on machines using LSF will typically use "bsub ctestS.lsf", etc.
187-
188-
========================================================================
189-
VI. Other cross compiling options
190-
========================================================================
191-
Settings for two other cross-compiling options are also in the config/toolchain
192-
files which do not seem to be necessary with the Cray PrgEnv-* modules
193-
194-
1. HDF5_USE_PREGEN. This option, along with the HDF5_USE_PREGEN_DIR CMake
195-
variable would allow the use of an appropriate H5Tinit.c file with type
196-
information generated on a compute node to be used when cross compiling
197-
for those compute nodes. The use of the variables in lines 110 and 111
198-
of HDF5options.cmake file seem to preclude needing this option with the
199-
available Cray modules and CMake option.
200-
201-
2. HDF5_BATCH_H5DETECT and associated CMake variables. This option when
202-
properly configured will run H5detect in a batch job on a compute node
203-
at the beginning of the CMake build process. It was also found to be
204-
unnecessary with the available Cray modules and CMake options.

release_docs/RELEASE.txt

+18
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,24 @@ New Features
4747

4848
Configuration:
4949
-------------
50+
- Removed CMake cross-compiling variables
51+
52+
* HDF5_USE_PREGEN
53+
* HDF5_BATCH_H5DETECT
54+
55+
These were used to work around H5detect and H5make_libsettings and
56+
are no longer required.
57+
58+
- Running H5make_libsettings is no longer required for cross-compiling
59+
60+
The functionality of H5make_libsettings is now handled via template files,
61+
so H5make_libsettings has been removed.
62+
63+
- Running H5detect is no longer required for cross-compiling
64+
65+
The functionality of H5detect is now exercised at library startup,
66+
so H5detect has been removed.
67+
5068
- Removed long double work-around symbols and configure options
5169

5270
Several options and public symbols that were provided to paper over

0 commit comments

Comments
 (0)