From: Nabil Ghodbane Date: Tue, 7 Mar 2023 15:02:08 +0000 (+0100) Subject: spns #33861 support hdf5 1.12.0 X-Git-Tag: V9_11_0~97 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=34d63729fe0f6f656ef6db9a5cab598146843b1e;p=tools%2Fsat_salome.git spns #33861 support hdf5 1.12.0 --- diff --git a/products/compil_scripts/med-4.1.1.sh b/products/compil_scripts/med-4.1.1.sh index 0a0124b..e963b86 100755 --- a/products/compil_scripts/med-4.1.1.sh +++ b/products/compil_scripts/med-4.1.1.sh @@ -8,8 +8,13 @@ CONFIGURE_FLAGS= CONFIGURE_FLAGS+=' CFLAGS=-m64 CXXFLAGS=-m64' CONFIGURE_FLAGS+=' --enable-python=yes' CONFIGURE_FLAGS+=' --enable-mesgerr' -if [ -n "$SAT_HPC" ] -then + +if [ "$HDF5_VERSION" == "1.12.1" ]; then + echo "WARNING: ensure compatibility with HDF 1.12" + CONFIGURE_FLAGS+=' CPPFLAGS=-DH5_USE_110_API' +fi + +if [ -n "$SAT_HPC" ]; then export CXX=${MPI_CXX_COMPILER} export CC=${MPI_C_COMPILER} CONFIGURE_FLAGS+=' --with-swig=yes' @@ -39,8 +44,7 @@ fi echo echo "*** make" $MAKE_OPTIONS make $MAKE_OPTIONS -if [ $? -ne 0 ] -then +if [ $? -ne 0 ]; then echo "ERROR on make" exit 2 fi @@ -48,8 +52,7 @@ fi echo echo "*** make install" make install -if [ $? -ne 0 ] -then +if [ $? -ne 0 ]; then echo "ERROR on make install" exit 3 fi diff --git a/products/compil_scripts/med.sh b/products/compil_scripts/med.sh index 812b5a1..5716a07 100755 --- a/products/compil_scripts/med.sh +++ b/products/compil_scripts/med.sh @@ -5,36 +5,28 @@ echo "med" $VERSION echo "##########################################################################" +CONFIGURE_FLAGS= +CONFIGURE_FLAGS+=' CFLAGS=-m64 CXXFLAGS=-m64' +CONFIGURE_FLAGS+=' --enable-python=no' +echo $HDF5_VERSION -CONFIGURE_FLAGS=$CONFIGURE_FLAGS'CFLAGS=-m64 CXXFLAGS=-m64' -# OP 06/02/2017 -# Putting option enable-python=no -# Reason : compilation failure of python interface modules on FD24 (generated by swig in medfile) -# CEA decision 13/02/2017 : deactivation of the compilation of python interface modules because no need python interface -CONFIGURE_FLAGS=$CONFIGURE_FLAGS' --enable-python=no' +function version_ge() { test "$(echo "$@" | tr " " "\n" | sort -rV | head -n 1)" == "$1"; } -if [ -n "$SAT_HPC" ] -then - CONFIGURE_FLAGS=$CONFIGURE_FLAGS' --enable-parallel' +if version_ge "$HDF5_VERSION" "1.12" ; then + echo "WARNING: ensure compatibility with HDF 1.12" + CONFIGURE_FLAGS+=' CPPFLAGS=-DH5_USE_110_API' +fi + +if [ -n "$SAT_HPC" ]; then + CONFIGURE_FLAGS+=' --enable-parallel' else - # CNC 24/01/2017 - # the line "export F77=gfortran" is commented, as we think it is not useful. - # at least it should'n. - # If it happens to be necessary, we will correct automake procedure. - # - # SRE 27/01/2017 - # In fact this line is necessary because when the g77 compiler exists on the machine, - # it is found before gfortran and it makes the compilation fail. - # A mail has been sent to Eric Fayolle to fix this bug. - # En attendant, on remet la ligne. export F77=gfortran fi if [ "$SALOME_USE_64BIT_IDS" == "1" ]; then echo "WARNING: user requested 64 bits encoding for integers..." - export FFLAGS=-fdefault-integer-8 - export FFLAGS=$FFLAGS' -g -O2 -ffixed-line-length-none' - CONFIGURE_FLAGS=$CONFIGURE_FLAGS' --with-med_int=long' + export FFLAGS='-fdefault-integer-8 -g -O2 -ffixed-line-length-none' + CONFIGURE_FLAGS+=' --with-med_int=long' else FFLAGS="-g -O2 -ffixed-line-length-none" fi @@ -42,16 +34,15 @@ fi echo echo "*** configure --prefix=$PRODUCT_INSTALL FFLAGS=${FFLAGS} $CONFIGURE_FLAGS" $SOURCE_DIR/configure --prefix=$PRODUCT_INSTALL FFLAGS="${FFLAGS}" $CONFIGURE_FLAGS -if [ $? -ne 0 ] -then +if [ $? -ne 0 ]; then echo "ERROR on configure" exit 1 fi + echo echo "*** make" $MAKE_OPTIONS make $MAKE_OPTIONS -if [ $? -ne 0 ] -then +if [ $? -ne 0 ]; then echo "ERROR on make" exit 2 fi @@ -59,8 +50,7 @@ fi echo echo "*** make install" make install -if [ $? -ne 0 ] -then +if [ $? -ne 0 ]; then echo "ERROR on make install" exit 3 fi diff --git a/products/medfile.pyconf b/products/medfile.pyconf index b45a5bb..dd2a63a 100644 --- a/products/medfile.pyconf +++ b/products/medfile.pyconf @@ -79,17 +79,25 @@ version_4_1_1_FD36 : # needed in order to screen with windows version - see below version_4_1_0 : { + compil_script : "med-4.1.0.sh" patches : [] } # needed in order to screen with windows version - see below version_4_1_0_hdf5 : { - compil_script : "med.sh" + compil_script : "med-4.1.0.sh" test_build : "make check" patches : ['medfile-4.1.0-hdf5.patch'] } +version_4_1_0_hdf5_1_12 : +{ + compil_script : "med-4.1.0.sh" + test_build : "make check" + patches : ['med-4.1.0_hdf5-1.12.0.patch'] +} + version_4_1_0_win : { patches : ['med-4.1.0_win_3x_files_support.patch', 'med-4.1.0_hdf5_native_long.patch'] diff --git a/products/patches/med-4.1.0_hdf5-1.12.0.patch b/products/patches/med-4.1.0_hdf5-1.12.0.patch new file mode 100644 index 0000000..75ff287 --- /dev/null +++ b/products/patches/med-4.1.0_hdf5-1.12.0.patch @@ -0,0 +1,123 @@ +--- med-4.1.0_ref/configure 2020-03-11 12:53:46.000000000 +0100 ++++ med-4.1.0_dev/configure 2023-03-01 14:45:28.321320038 +0100 +@@ -3197,7 +3197,7 @@ + #med_check_hdf5.m4 + HDF_VERSION_REF=5-1.10.2 + HDF_VERSION_MAJOR_REF=1 +-HDF_VERSION_MINOR_REF=10 ++HDF_VERSION_MINOR_REF=13 + HDF_VERSION_RELEASE_REF=2 + + +@@ -7573,16 +7573,16 @@ + HDF5_VERSION="0" + if test -n "$HDF5_ABS_PATH" ; then + HDF5_USED_VER=` grep H5_VERS_INFO $HDF5_ABS_PATH | sed 's/\([^"]*\)\(".*"\)\([^"]*\)/\2/g' ` +- H5_VER_MAJOR=` grep '#define *H5_VERS_MAJOR' $HDF5_ABS_PATH | sed 's/^.*H5_VERS_MAJOR[[ \t]]*\([0-9]*\)[[ \t]]*.*$/\1/g' ` +- H5_VER_MINOR=` grep '#define *H5_VERS_MINOR' $HDF5_ABS_PATH | sed 's/^.*H5_VERS_MINOR[[ \t]]*\([0-9]*\)[[ \t]]*.*$/\1/g' ` +- H5_VER_RELEASE=`grep '#define *H5_VERS_RELEASE' $HDF5_ABS_PATH | sed 's/^.*H5_VERS_RELEASE[[ \t]]*\([0-9]*\)[[ \t]]*.*$/\1/g' ` ++ H5_VER_MAJOR=` grep '#define *H5_VERS_MAJOR' $HDF5_ABS_PATH | cut -d ' ' -f3 ` ++ H5_VER_MINOR=` grep '#define *H5_VERS_MINOR' $HDF5_ABS_PATH | cut -d ' ' -f3 ` ++ H5_VER_RELEASE=`grep '#define *H5_VERS_RELEASE' $HDF5_ABS_PATH | cut -d ' ' -f3 ` + HDF5_VERSION=` expr 10000 \* ${H5_VER_MAJOR} + 100 \* ${H5_VER_MINOR} + ${H5_VER_RELEASE} ` +- test "0${HDF5_VERSION}" -gt "11100" || test "0${HDF5_VERSION}" -lt "11002" && as_fn_error $? " +-This HDF5 version ${H5_VER_MAJOR}.${H5_VER_MINOR}.${H5_VER_RELEASE} must not be used with med-fichier${MED_NUM_MAJEUR}.${MED_NUM_MINEUR}.${MED_NUM_RELEASE}. +-The HDF5 library version used by med-fichier${MED_NUM_MAJEUR}.y.z MUST NOT be > 1.10 and have to be at least HDF${HDF_VERSION_REF}. +-DO NOT TRY TO COMPILE med-fichier${MED_NUM_MAJEUR}.${MED_NUM_MINEUR}.${MED_NUM_RELEASE} version with an HDF5 library which would generate an hdf5 file not compliant with HDF5-${HDF_VERSION_MAJOR_REF}.${HDF_VERSION_MINOR_REF}.z library. +-This would BREAK med-fichier compatibility between files with the same revision number ! +- " "$LINENO" 5 ++# test "0${HDF5_VERSION}" -gt "11100" || test "0${HDF5_VERSION}" -lt "11002" && as_fn_error $? " ++# This HDF5 version ${H5_VER_MAJOR}.${H5_VER_MINOR}.${H5_VER_RELEASE} must not be used with med-fichier${MED_NUM_MAJEUR}.${MED_NUM_MINEUR}.${MED_NUM_RELEASE}. ++# The HDF5 library version used by med-fichier${MED_NUM_MAJEUR}.y.z MUST NOT be > 1.10 and have to be at least HDF${HDF_VERSION_REF}. ++# DO NOT TRY TO COMPILE med-fichier${MED_NUM_MAJEUR}.${MED_NUM_MINEUR}.${MED_NUM_RELEASE} version with an HDF5 library which would generate an hdf5 file not compliant with HDF5-${HDF_VERSION_MAJOR_REF}.${HDF_VERSION_MINOR_REF}.z library. ++# This would BREAK med-fichier compatibility between files with the same revision number ! ++# " "$LINENO" 5 + else + ## In case user explicitly ask to not use hdf5 ! + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Can't compile MED without hdf5" >&5 +@@ -31697,7 +31697,8 @@ + case $am_cv_python_pythondir in + $am_py_prefix*) + am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'` +- am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,$PYTHON_PREFIX,"` ++ # am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,$PYTHON_PREFIX,"` ++ am_cv_python_pythondir="\${PYTHON_PREFIX}/lib/python$PYTHON_VERSION/site-packages" + ;; + *) + case $am_py_prefix in +@@ -31741,7 +31742,8 @@ + case $am_cv_python_pyexecdir in + $am_py_exec_prefix*) + am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'` +- am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,$PYTHON_EXEC_PREFIX,"` ++ # am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,$PYTHON_EXEC_PREFIX,"` ++ am_cv_python_pyexecdir="\${PYTHON_EXEC_PREFIX}/lib/python$PYTHON_VERSION/site-packages" + ;; + *) + case $am_py_exec_prefix in +--- med-4.1.0_ref/src/hdfi/_MEDparFileCreate.c 2020-03-11 10:36:37.000000000 +0100 ++++ med-4.1.0_dev/src/hdfi/_MEDparFileCreate.c 2023-03-01 14:38:44.653666031 +0100 +@@ -64,7 +64,7 @@ + * En HDF5-1.10.0p1 cela n'a aucun effet ! + * Un test autoconf permet de fixer un intervalle de version HDF à MED. + */ +-#if H5_VERS_MINOR > 10 ++#if H5_VERS_MINOR > 12 + #error "Don't forget to change the compatibility version of the library !" + #endif + +--- med-4.1.0_ref/src/hdfi/_MEDmemFileOpen.c 2020-03-11 11:06:04.000000000 +0100 ++++ med-4.1.0_dev/src/hdfi/_MEDmemFileOpen.c 2023-03-01 14:39:16.990279182 +0100 +@@ -434,7 +434,7 @@ + goto ERROR; + } + +-#if H5_VERS_MINOR > 10 ++#if H5_VERS_MINOR > 12 + #error "Don't forget to change the compatibility version of the library !" + #endif + if ( H5Pset_libver_bounds( _fapl, H5F_LIBVER_18, H5F_LIBVER_18) ) { +--- med-4.1.0_ref/src/hdfi/_MEDfileCreate.c 2020-03-11 10:36:37.000000000 +0100 ++++ med-4.1.0_dev/src/hdfi/_MEDfileCreate.c 2023-03-01 14:42:38.690103638 +0100 +@@ -159,7 +159,7 @@ + * En HDF5-1.10.0p1 cela n'a aucun effet ! + * Un test autoconf permet de fixer un intervalle de version HDF à MED. + */ +-#if H5_VERS_MINOR > 10 ++#if H5_VERS_MINOR > 12 + #error "Don't forget to change the compatibility version of the library !" + #endif + +--- med-4.1.0_ref/src/hdfi/_MEDparFileOpen.c 2020-03-11 10:36:36.000000000 +0100 ++++ med-4.1.0_dev/src/hdfi/_MEDparFileOpen.c 2023-03-01 14:43:12.134737789 +0100 +@@ -55,7 +55,7 @@ + MED_ERR_(_fid,MED_ERR_INIT,MED_ERR_PROPERTY,MED_ERR_PARALLEL_MSG); + goto ERROR; + } +-#if H5_VERS_MINOR > 10 ++#if H5_VERS_MINOR > 12 + #error "Don't forget to change the compatibility version of the library !" + #endif + if ( H5Pset_libver_bounds( _fapl, H5F_LIBVER_18, H5F_LIBVER_18 ) ) { +--- med-4.1.0_ref/src/hdfi/_MEDfileOpen.c 2020-03-12 16:27:49.000000000 +0100 ++++ med-4.1.0_dev/src/hdfi/_MEDfileOpen.c 2023-03-01 14:43:45.131363443 +0100 +@@ -72,7 +72,7 @@ + + • The creation order tracking property, H5P_CRT_ORDER_TRACKED, has been set in the group creation property list (see H5Pset_link_creation_order). + */ +-#if H5_VERS_MINOR > 10 ++#if H5_VERS_MINOR > 12 + #error "Don't forget to change the compatibility version of the library !" + #endif + /* L'avantage de bloquer le modèle interne HDF5 +--- med-4.1.0_ref/src/ci/MEDfileCompatibility.c 2020-03-11 10:36:34.000000000 +0100 ++++ med-4.1.0_dev/src/ci/MEDfileCompatibility.c 2023-03-01 14:38:09.220994176 +0100 +@@ -113,7 +113,7 @@ + #if MED_NUM_MAJEUR != 4 + #error "Don't forget to update the test version here when you change the major version of the library !" + #endif +-#if H5_VERS_MINOR > 10 ++#if H5_VERS_MINOR > 12 + #error "Don't forget to check the compatibility version of the library, depending on the internal hdf model choice !" + #error "Cf. _MEDfileCreate ..." + #endif