From 9233a2c41b0af238f24f22420f04fffcdb391101 Mon Sep 17 00:00:00 2001 From: Nabil Ghodbane Date: Mon, 15 Jan 2024 14:33:51 +0100 Subject: [PATCH] - numpy 1.20: np.float removed - https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations - gdal: compilation script: ensure no lib64 directory is present. - medfile: on fedora, presence of lib64\n-nlopt: on fedora, presence of lib64. --- applications/SALOME-9.12.0-native.pyconf | 3 ++ applications/SALOME-master-native.pyconf | 3 ++ products/HOMARD.pyconf | 10 ++++++ products/PyFMI.pyconf | 2 +- products/SHAPER.pyconf | 10 ++++++ products/SOLVERLAB.pyconf | 10 ++++++ products/compil_scripts/gdal-2.4.0.sh | 15 +++++++++ products/compil_scripts/gdal-2.4.4.sh | 15 +++++++++ products/compil_scripts/med-4.1.1.sh | 13 ++++++++ products/compil_scripts/nlopt-2.5.0.sh | 31 +++++++++++++++++++ products/compil_scripts/nlopt-2.6.0.sh | 31 +++++++++++++++++++ .../HOMARD-V9_12_0-numpy-1.20.-np.float.patch | 13 ++++++++ .../PyFMI-2.6-numpy-1.20-np.float.patch | 11 +++++++ .../SHAPER-V9_12_0-numpy-1.20-np.float.patch | 13 ++++++++ ...LVERLAB-V9_12_0-numpy-1.20.-np.float.patch | 26 ++++++++++++++++ 15 files changed, 205 insertions(+), 1 deletion(-) create mode 100644 products/patches/HOMARD-V9_12_0-numpy-1.20.-np.float.patch create mode 100644 products/patches/PyFMI-2.6-numpy-1.20-np.float.patch create mode 100644 products/patches/SHAPER-V9_12_0-numpy-1.20-np.float.patch create mode 100644 products/patches/SOLVERLAB-V9_12_0-numpy-1.20.-np.float.patch diff --git a/applications/SALOME-9.12.0-native.pyconf b/applications/SALOME-9.12.0-native.pyconf index 7a88ef4..013501c 100644 --- a/applications/SALOME-9.12.0-native.pyconf +++ b/applications/SALOME-9.12.0-native.pyconf @@ -267,6 +267,9 @@ __overwrite__ : 'APPLICATION.products.nlopt' : '2.5.0' 'APPLICATION.products.openturns' : {tag: '1.21', base: 'no', section: 'version_1_21_DB12' } 'APPLICATION.products.ParaView' : {tag: '5.11.0', base: 'no', section: 'version_5_11_0_MPI_DB12', hpc: 'yes' } + 'APPLICATION.products.HOMARD' : {tag: 'V9_12_0', base: 'no', section: 'version_V9_12_0_DB12'} + 'APPLICATION.products.SHAPER' : {tag: 'V9_12_0', base: 'no', section: 'version_V9_12_0_DB12'} + 'APPLICATION.products.SOLVERLAB' : {tag: 'V9_12_0', base: 'no', section: 'version_V9_12_0_DB12'} } { # CentOS 8 repositories don't include sphinxintl package which must be installed through pip. diff --git a/applications/SALOME-master-native.pyconf b/applications/SALOME-master-native.pyconf index c39c73e..33fb4bf 100644 --- a/applications/SALOME-master-native.pyconf +++ b/applications/SALOME-master-native.pyconf @@ -267,6 +267,9 @@ __overwrite__ : 'APPLICATION.products.nlopt' : '2.5.0' 'APPLICATION.products.openturns' : {tag: '1.21', base: 'no', section: 'version_1_21_DB12' } 'APPLICATION.products.ParaView' : {tag: '5.11.0', base: 'no', section: 'version_5_11_0_MPI_DB12', hpc: 'yes' } + 'APPLICATION.products.HOMARD' : {tag: 'master', base: 'no', section: 'version_master_DB12'} + 'APPLICATION.products.SHAPER' : {tag: 'master', base: 'no', section: 'version_master_DB12'} + 'APPLICATION.products.SOLVERLAB' : {tag: 'master', base: 'no', section: 'version_master_DB12'} } { # CentOS 8 repositories don't include sphinxintl package which must be installed through pip. diff --git a/products/HOMARD.pyconf b/products/HOMARD.pyconf index 4b5964f..4d2410a 100644 --- a/products/HOMARD.pyconf +++ b/products/HOMARD.pyconf @@ -40,6 +40,16 @@ default_MPI : opt_depend : ['openmpi'] } +version_master_DB12 : +{ + patches : ['HOMARD-V9_12_0-numpy-1.20.-np.float.patch'] +} + +version_V9_12_0_DB12 : +{ + patches : ['HOMARD-V9_12_0-numpy-1.20.-np.float.patch'] +} + version_V9_10_0_MPI : { cmake_options : "-DSWIG_EXECUTABLE=${SWIG_ROOT_DIR}/bin/swig -DCMAKE_CXX_COMPILER:STRING=${MPI_CXX_COMPILER} -DCMAKE_C_COMPILER:STRING=${MPI_C_COMPILER} -DSALOME_USE_MPI=ON " diff --git a/products/PyFMI.pyconf b/products/PyFMI.pyconf index f30da84..c22857a 100644 --- a/products/PyFMI.pyconf +++ b/products/PyFMI.pyconf @@ -53,7 +53,7 @@ version_2_6_win : version_2_6_DB12: { - patches: ['pyfmi-2.6-python-3.1x.01.patch'] + patches: ['pyfmi-2.6-python-3.1x.01.patch', 'PyFMI-2.6-numpy-1.20-np.float.patch'] compil_script : "PyFMI-2.6.sh" properties: { diff --git a/products/SHAPER.pyconf b/products/SHAPER.pyconf index 4e98383..a1b7ced 100644 --- a/products/SHAPER.pyconf +++ b/products/SHAPER.pyconf @@ -53,6 +53,16 @@ default_win : cmake_options : " -DNO_SolveSpace=TRUE -DSWIG_EXECUTABLE=%SWIG_ROOT_DIR:\=/%/bin/swig.exe " } +version_master_DB12 : +{ + patches : ['SHAPER-V9_12_0-numpy-1.20-np.float.patch'] +} + +version_V9_12_0_DB12 : +{ + patches : ['SHAPER-V9_12_0-numpy-1.20-np.float.patch'] +} + version_V9_10_0_FD37: { patches : ['SPNS-32377-SHAPER-V9_10_0-FD37.patch'] diff --git a/products/SOLVERLAB.pyconf b/products/SOLVERLAB.pyconf index 48d18ed..ecb662f 100644 --- a/products/SOLVERLAB.pyconf +++ b/products/SOLVERLAB.pyconf @@ -60,6 +60,16 @@ default_MPI : opt_depend : ['mpi4py'] } +version_master_DB12 : +{ + patches : ['SOLVERLAB-V9_12_0-numpy-1.20.-np.float.patch'] +} + +version_V9_12_0_DB12 : +{ + patches : ['SOLVERLAB-V9_12_0-numpy-1.20.-np.float.patch'] +} + version_V9_10_0 : { properties: diff --git a/products/compil_scripts/gdal-2.4.0.sh b/products/compil_scripts/gdal-2.4.0.sh index 1c2fd54..bfc9850 100755 --- a/products/compil_scripts/gdal-2.4.0.sh +++ b/products/compil_scripts/gdal-2.4.0.sh @@ -63,6 +63,21 @@ then exit 3 fi +# finally ensure a consistent installation +if [ -d "${PRODUCT_INSTALL}/lib64" ]; then + echo "WARNING: moving lib64 to lib" + mv ${PRODUCT_INSTALL}/lib64/* ${PRODUCT_INSTALL}/lib/ + rm -rf ${PRODUCT_INSTALL}/lib64 +elif [ -d "${PRODUCT_INSTALL}/local/lib64" ]; then + echo "WARNING: moving local/lib64 to lib" + mv ${PRODUCT_INSTALL}/local/lib64/* ${PRODUCT_INSTALL}/lib/ + rm -rf ${PRODUCT_INSTALL}/local/lib64 +fi + +if [ -d ${PRODUCT_INSTALL}/lib/python${PYTHON_VERSION}/dist-packages ]; then + mv ${PRODUCT_INSTALL}/lib/python${PYTHON_VERSION}/dist-packages ${PRODUCT_INSTALL}/lib/python${PYTHON_VERSION}/site-packages +fi + echo echo "########## END" diff --git a/products/compil_scripts/gdal-2.4.4.sh b/products/compil_scripts/gdal-2.4.4.sh index 675a456..6cf1e2c 100755 --- a/products/compil_scripts/gdal-2.4.4.sh +++ b/products/compil_scripts/gdal-2.4.4.sh @@ -64,6 +64,21 @@ then exit 3 fi +# finally ensure a consistent installation +if [ -d "${PRODUCT_INSTALL}/lib64" ]; then + echo "WARNING: moving lib64 to lib" + mv ${PRODUCT_INSTALL}/lib64/* ${PRODUCT_INSTALL}/lib/ + rm -rf ${PRODUCT_INSTALL}/lib64 +elif [ -d "${PRODUCT_INSTALL}/local/lib64" ]; then + echo "WARNING: moving local/lib64 to lib" + mv ${PRODUCT_INSTALL}/local/lib64/* ${PRODUCT_INSTALL}/lib/ + rm -rf ${PRODUCT_INSTALL}/local/lib64 +fi + +if [ -d ${PRODUCT_INSTALL}/lib/python${PYTHON_VERSION}/dist-packages ]; then + mv ${PRODUCT_INSTALL}/lib/python${PYTHON_VERSION}/dist-packages ${PRODUCT_INSTALL}/lib/python${PYTHON_VERSION}/site-packages +fi + echo echo "########## END" diff --git a/products/compil_scripts/med-4.1.1.sh b/products/compil_scripts/med-4.1.1.sh index b3155aa..f9cd344 100755 --- a/products/compil_scripts/med-4.1.1.sh +++ b/products/compil_scripts/med-4.1.1.sh @@ -76,6 +76,19 @@ case $LINUX_DISTRIBUTION in ;; esac +if [ -d "${PRODUCT_INSTALL}/lib64" ]; then + echo "WARNING: moving lib64 to lib" + mv ${PRODUCT_INSTALL}/lib64/* ${PRODUCT_INSTALL}/lib/ + rm -rf ${PRODUCT_INSTALL}/lib64 +elif [ -d "${PRODUCT_INSTALL}/local/lib64" ]; then + echo "WARNING: moving local/lib64 to lib" + mv ${PRODUCT_INSTALL}/local/lib64/* ${PRODUCT_INSTALL}/lib/ + rm -rf ${PRODUCT_INSTALL}/local/lib64 +fi + +if [ -d ${PRODUCT_INSTALL}/lib/python${PYTHON_VERSION}/dist-packages ]; then + mv ${PRODUCT_INSTALL}/lib/python${PYTHON_VERSION}/dist-packages ${PRODUCT_INSTALL}/lib/python${PYTHON_VERSION}/site-packages +fi #TODO: figure out which environment variable uses this dist-dir if [ -d $PRODUCT_INSTALL/local/lib/python${PYTHON_VERSION} ]; then diff --git a/products/compil_scripts/nlopt-2.5.0.sh b/products/compil_scripts/nlopt-2.5.0.sh index 856bbd1..1fca7b9 100755 --- a/products/compil_scripts/nlopt-2.5.0.sh +++ b/products/compil_scripts/nlopt-2.5.0.sh @@ -56,6 +56,37 @@ then exit 3 fi +if [ -d "${PRODUCT_INSTALL}/lib64" ]; then + echo "WARNING: moving lib64 to lib" + mv ${PRODUCT_INSTALL}/lib64/* ${PRODUCT_INSTALL}/lib/ + rm -rf ${PRODUCT_INSTALL}/lib64 +elif [ -d "${PRODUCT_INSTALL}/local/lib64" ]; then + echo "WARNING: moving local/lib64 to lib" + mv ${PRODUCT_INSTALL}/local/lib64/* ${PRODUCT_INSTALL}/lib/ + rm -rf ${PRODUCT_INSTALL}/local/lib64 +fi + +if [ -d ${PRODUCT_INSTALL}/lib/python${PYTHON_VERSION}/dist-packages ]; then + mv ${PRODUCT_INSTALL}/lib/python${PYTHON_VERSION}/dist-packages ${PRODUCT_INSTALL}/lib/python${PYTHON_VERSION}/site-packages +fi + +#TODO: figure out which environment variable uses this dist-dir +if [ -d $PRODUCT_INSTALL/local/lib/python${PYTHON_VERSION} ]; then + mv $PRODUCT_INSTALL/local/lib/python${PYTHON_VERSION} $PRODUCT_INSTALL/lib +fi +if [ -d $PRODUCT_INSTALL/local/bin ]; then + mv $PRODUCT_INSTALL/local/bin/* $PRODUCT_INSTALL/bin +fi +if [ -d $PRODUCT_INSTALL/local/share ]; then + mv $PRODUCT_INSTALL/local/share/* $PRODUCT_INSTALL/share +fi +if [ -d $PRODUCT_INSTALL/local ]; then + rm -rf $PRODUCT_INSTALL/local +fi +if [ -d $PRODUCT_INSTALL/lib/python${PYTHON_VERSION}/dist-packages ]; then + mv $PRODUCT_INSTALL/lib/python${PYTHON_VERSION}/dist-packages $PRODUCT_INSTALL/lib/python${PYTHON_VERSION}/site-packages +fi + echo echo "########## END" diff --git a/products/compil_scripts/nlopt-2.6.0.sh b/products/compil_scripts/nlopt-2.6.0.sh index 856bbd1..1fca7b9 100755 --- a/products/compil_scripts/nlopt-2.6.0.sh +++ b/products/compil_scripts/nlopt-2.6.0.sh @@ -56,6 +56,37 @@ then exit 3 fi +if [ -d "${PRODUCT_INSTALL}/lib64" ]; then + echo "WARNING: moving lib64 to lib" + mv ${PRODUCT_INSTALL}/lib64/* ${PRODUCT_INSTALL}/lib/ + rm -rf ${PRODUCT_INSTALL}/lib64 +elif [ -d "${PRODUCT_INSTALL}/local/lib64" ]; then + echo "WARNING: moving local/lib64 to lib" + mv ${PRODUCT_INSTALL}/local/lib64/* ${PRODUCT_INSTALL}/lib/ + rm -rf ${PRODUCT_INSTALL}/local/lib64 +fi + +if [ -d ${PRODUCT_INSTALL}/lib/python${PYTHON_VERSION}/dist-packages ]; then + mv ${PRODUCT_INSTALL}/lib/python${PYTHON_VERSION}/dist-packages ${PRODUCT_INSTALL}/lib/python${PYTHON_VERSION}/site-packages +fi + +#TODO: figure out which environment variable uses this dist-dir +if [ -d $PRODUCT_INSTALL/local/lib/python${PYTHON_VERSION} ]; then + mv $PRODUCT_INSTALL/local/lib/python${PYTHON_VERSION} $PRODUCT_INSTALL/lib +fi +if [ -d $PRODUCT_INSTALL/local/bin ]; then + mv $PRODUCT_INSTALL/local/bin/* $PRODUCT_INSTALL/bin +fi +if [ -d $PRODUCT_INSTALL/local/share ]; then + mv $PRODUCT_INSTALL/local/share/* $PRODUCT_INSTALL/share +fi +if [ -d $PRODUCT_INSTALL/local ]; then + rm -rf $PRODUCT_INSTALL/local +fi +if [ -d $PRODUCT_INSTALL/lib/python${PYTHON_VERSION}/dist-packages ]; then + mv $PRODUCT_INSTALL/lib/python${PYTHON_VERSION}/dist-packages $PRODUCT_INSTALL/lib/python${PYTHON_VERSION}/site-packages +fi + echo echo "########## END" diff --git a/products/patches/HOMARD-V9_12_0-numpy-1.20.-np.float.patch b/products/patches/HOMARD-V9_12_0-numpy-1.20.-np.float.patch new file mode 100644 index 0000000..3a6dbed --- /dev/null +++ b/products/patches/HOMARD-V9_12_0-numpy-1.20.-np.float.patch @@ -0,0 +1,13 @@ +diff --git a/src/tests/Test/test_5.py b/src/tests/Test/test_5.py +index 01baaa9..af1ec47 100755 +--- a/src/tests/Test/test_5.py ++++ b/src/tests/Test/test_5.py +@@ -179,7 +179,7 @@ Python script for MEDCoupling + cg_hexa = cg_hexa_ml.toNumPyArray() + # Target + # ====== +- xyz_p = np.zeros(3, dtype=np.float) ++ xyz_p = np.zeros(3, dtype=np.float32) + xyz_p[0] = -0.20*float(1-niter) * LG_X + xyz_p[1] = -0.15*float(1-niter) * LG_Y + xyz_p[2] = -0.10*float(1-niter) * LG_Z diff --git a/products/patches/PyFMI-2.6-numpy-1.20-np.float.patch b/products/patches/PyFMI-2.6-numpy-1.20-np.float.patch new file mode 100644 index 0000000..e30db41 --- /dev/null +++ b/products/patches/PyFMI-2.6-numpy-1.20-np.float.patch @@ -0,0 +1,11 @@ +--- PyFMI-2.6_ref/src/pyfmi/fmi_coupled.pyx 2024-01-15 10:37:54.999574589 +0100 ++++ PyFMI-2.6_dev/src/pyfmi/fmi_coupled.pyx 2024-01-15 10:37:43.735520048 +0100 +@@ -1004,7 +1004,7 @@ + Calls the low-level FMI function: fmi2SetReal + """ + input_valueref = np.array(valueref, ndmin=1).ravel() +- set_value = np.array(values, dtype=np.float, ndmin=1).ravel() ++ set_value = np.array(values, dtype=np.float64, ndmin=1).ravel() + + if input_valueref.size != set_value.size: + raise fmi.FMUException('The length of valueref and values are inconsistent.') diff --git a/products/patches/SHAPER-V9_12_0-numpy-1.20-np.float.patch b/products/patches/SHAPER-V9_12_0-numpy-1.20-np.float.patch new file mode 100644 index 0000000..69cb4df --- /dev/null +++ b/products/patches/SHAPER-V9_12_0-numpy-1.20-np.float.patch @@ -0,0 +1,13 @@ +diff --git a/src/PythonAddons/macros/pipeNetwork/feature.py b/src/PythonAddons/macros/pipeNetwork/feature.py +index 1ff9ec621..6fddccc34 100755 +--- a/src/PythonAddons/macros/pipeNetwork/feature.py ++++ b/src/PythonAddons/macros/pipeNetwork/feature.py +@@ -232,7 +232,7 @@ Sorties : + coox = self.infoPoints[l_noeuds[iaux+jaux]]["X"] + cooy = self.infoPoints[l_noeuds[iaux+jaux]]["Y"] + cooz = self.infoPoints[l_noeuds[iaux+jaux]]["Z"] +- vect.append(np.array((coox,cooy,cooz),np.float)) ++ vect.append(np.array((coox,cooy,cooz),np.float32)) + cosinus = np.dot(vect[1]-vect[0],vect[1]-vect[2])/(np.linalg.norm(vect[1]-vect[0])* np.linalg.norm(vect[1]-vect[2])) + #print ("cosinus = {}".format(cosinus)) + # Si l'angle est plat, c'est que les 3 points sont alignés : on arrête... sauf si ce point est un départ d'une autre ! diff --git a/products/patches/SOLVERLAB-V9_12_0-numpy-1.20.-np.float.patch b/products/patches/SOLVERLAB-V9_12_0-numpy-1.20.-np.float.patch new file mode 100644 index 0000000..cee329b --- /dev/null +++ b/products/patches/SOLVERLAB-V9_12_0-numpy-1.20.-np.float.patch @@ -0,0 +1,26 @@ +diff --git a/CDMATH/tests/doc/3DPoissonEF/FiniteElements3DPoisson_CUBE.html b/CDMATH/tests/doc/3DPoissonEF/FiniteElements3DPoisson_CUBE.html +index a33c3d7..f738ac2 100644 +--- a/CDMATH/tests/doc/3DPoissonEF/FiniteElements3DPoisson_CUBE.html ++++ b/CDMATH/tests/doc/3DPoissonEF/FiniteElements3DPoisson_CUBE.html +@@ -12105,7 +12105,7 @@ A. Hannukainen, S. Korotov, M. Křı́žek, Maximum angle condition is not neces + #Here are: Sparse matrix using scipy and vector using numpy + #========================================================== + #B = np.zeros(nbInteriorNodes) +-#A = coo_matrix((nbInteriorNodes, nbInteriorNodes), dtype=np.float).toarray() ++#A = coo_matrix((nbInteriorNodes, nbInteriorNodes), dtype=np.float64).toarray() + + # Vecteurs gradient de la fonction de forme associée à chaque noeud d'un triangle (hypothèse 2D) + GradShapeFunc0=cdmath.Vector(3)#en 3D GradShapeFunc0=cdmath.Vector(3) +diff --git a/CDMATH/tests/doc/3DPoissonEF/FiniteElements3DPoisson_CUBE.ipynb b/CDMATH/tests/doc/3DPoissonEF/FiniteElements3DPoisson_CUBE.ipynb +index ad39e47..292bfd5 100644 +--- a/CDMATH/tests/doc/3DPoissonEF/FiniteElements3DPoisson_CUBE.ipynb ++++ b/CDMATH/tests/doc/3DPoissonEF/FiniteElements3DPoisson_CUBE.ipynb +@@ -291,7 +291,7 @@ + "#Here are: Sparse matrix using scipy and vector using numpy \n", + "#==========================================================\n", + "#B = np.zeros(nbInteriorNodes)\n", +- "#A = coo_matrix((nbInteriorNodes, nbInteriorNodes), dtype=np.float).toarray()\n", ++ "#A = coo_matrix((nbInteriorNodes, nbInteriorNodes), dtype=np.float32).toarray()\n", + "\n", + "# Vecteurs gradient de la fonction de forme associée à chaque noeud d'un triangle (hypothèse 2D)\n", + "GradShapeFunc0=cdmath.Vector(3)#en 3D GradShapeFunc0=cdmath.Vector(3)\n", -- 2.39.2