From 31d1844bd20e6e62ed9349b678a2eb37e4778214 Mon Sep 17 00:00:00 2001 From: Nabil Ghodbane Date: Mon, 15 Jan 2024 16:27:03 +0100 Subject: [PATCH] bos #40613 [CEA] deprecated np.float: backport patches to SHAPER, SOLVERLAB, HOMARD and PyFMI for Debian 12 builds --- applications/SALOME-9.12.0-native.pyconf | 3 +++ products/HOMARD.pyconf | 5 ++++ products/PyFMI.pyconf | 2 +- products/SHAPER.pyconf | 5 ++++ products/SOLVERLAB.pyconf | 5 ++++ .../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 +++++++++++++++++++ 9 files changed, 82 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/products/HOMARD.pyconf b/products/HOMARD.pyconf index 4b5964f..b8f4367 100644 --- a/products/HOMARD.pyconf +++ b/products/HOMARD.pyconf @@ -40,6 +40,11 @@ default_MPI : opt_depend : ['openmpi'] } +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..6eaab03 100644 --- a/products/SHAPER.pyconf +++ b/products/SHAPER.pyconf @@ -53,6 +53,11 @@ default_win : cmake_options : " -DNO_SolveSpace=TRUE -DSWIG_EXECUTABLE=%SWIG_ROOT_DIR:\=/%/bin/swig.exe " } +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..5a90b2f 100644 --- a/products/SOLVERLAB.pyconf +++ b/products/SOLVERLAB.pyconf @@ -60,6 +60,11 @@ default_MPI : opt_depend : ['mpi4py'] } +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/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..659ac20 --- /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.float32, 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