]> SALOME platform Git repositories - tools/sat_salome.git/commitdiff
Salome HOME
spns #33796: build for Ubuntu 22.04
authorNabil Ghodbane <nabil.ghodbane@cea.fr>
Wed, 15 Feb 2023 15:06:16 +0000 (16:06 +0100)
committerNabil Ghodbane <nabil.ghodbane@cea.fr>
Wed, 15 Feb 2023 15:06:16 +0000 (16:06 +0100)
applications/MEDCOUPLING-9.8.0.pyconf
products/Python.pyconf
products/compil_scripts/Python-3.8.sh [new file with mode: 0755]

index 6774d9ccd8bf52ca37946289468758326d46f507..d43201c22a2ca498de7ec93b8d8fd89e5a0cdcd7 100644 (file)
@@ -92,4 +92,9 @@ __overwrite__ :
         __condition__: "VARS.dist in ['FD34']"
         'PRODUCTS.Python.version_3_6_5.patches' : ["python_3.6.5-allocation.patch"] # https://github.com/pyenv/pyenv/issues/1889
     }
-]
\ No newline at end of file
+  {
+    __condition__ : "VARS.dist in ['UB22.04']"
+      'APPLICATION.products.Python': '3.8.10'
+      'APPLICATION.products.hdf5'  : 'native'
+  }
+]
index ca4be1b830a832237f0056b92bc7b3c840d77806..150345497833feb11b9dcae3cfbc88d8c40529fb 100755 (executable)
@@ -124,6 +124,12 @@ version_3_7_14_win :
     build_depend : ['perl']
 }
  
+version_3_8_10_UB22_04:
+{
+ compil_script : "Python-3.8.sh"
+  patches: []
+}
+
 version_3_9_14 :
 {
  compil_script : "Python-3.9.sh"
diff --git a/products/compil_scripts/Python-3.8.sh b/products/compil_scripts/Python-3.8.sh
new file mode 100755 (executable)
index 0000000..e76fd74
--- /dev/null
@@ -0,0 +1,81 @@
+#!/bin/bash
+
+echo "##########################################################################"
+echo "Python" $VERSION
+echo "##########################################################################"
+
+if [ ${#VERSION} -lt 5 ]
+then
+    echo "ERROR : VERSION argument of Python compilation script has not the expected x.y.z format"
+    exit 1
+fi
+PYTHON_VERSION="${VERSION:0:3}"
+
+# --enable-shared   : enable building shared python library
+# --with-threads    : enable thread support
+# --without-pymalloc: disable specialized mallocs
+# --with-ensurepip  : installation using bundled pip
+# --enable-optimizations:  recommandé et utilisé par Nijni -> mais trop long!
+CONFIGURE_ARGUMENTS="--enable-shared --with-threads --with-ensurepip=install --with-ssl --enable-loadable-sqlite-extensions --with-pymalloc"
+
+echo
+echo   "*** configure --prefix=$PRODUCT_INSTALL $CONFIGURE_ARGUMENTS"
+$SOURCE_DIR/configure --prefix=$PRODUCT_INSTALL $CONFIGURE_ARGUMENTS
+if [ $? -ne 0 ]
+then
+    echo "ERROR on configure"
+    exit 1
+fi
+
+echo
+echo "*** make" $MAKE_OPTIONS
+make $MAKE_OPTIONS
+if [ $? -ne 0 ]
+then
+    echo "ERROR on make"
+    exit 2
+fi
+
+echo
+echo "*** make install"
+make install
+if [ $? -ne 0 ]
+then
+    echo "ERROR on make install"
+    exit 3
+fi
+
+cd ${PRODUCT_INSTALL}/lib/python${PYTHON_VERSION}/config-${PYTHON_VERSION}*
+
+if [ ! -e libpython${PYTHON_VERSION}.so ]
+then
+    echo
+    echo "*** create missing link"
+    ln -sf ../../libpython${PYTHON_VERSION}.so .
+    if [ $? -ne 0 ]
+    then
+        echo "ERROR when creating missing link"
+        # no error here
+    fi
+fi
+cd ${PRODUCT_INSTALL}/bin
+ln -s python3 python
+ln -s pip3 pip
+#
+if [ "${SAT_ENABLE_PYTHON_PYMALLOC}" == "1" ]; then
+    cd ${PRODUCT_INSTALL}/include
+    if [ ! -d python3.8 ]; then
+       ln -s python3.8m python3.8
+    fi
+fi
+
+# fix the path... 
+L="2to3  2to3-3.8 easy_install-3.8 idle3 idle3.8 pip3 pip3.8 pydoc3 pydoc3.8 pyvenv pyvenv-3.8"
+cd ${PRODUCT_INSTALL}/bin
+for f in  $L; do
+    awk '$0 = NR==1 ? replace : $0' replace="#!/usr/bin/env python3" $f > $f.t && mv $f.t $f && chmod 755 $f
+done
+
+echo
+echo "########## END"
+