]> SALOME platform Git repositories - tools/sat_salome.git/commitdiff
Salome HOME
spns #42158: build Python 2.7.16 with pip support - add a dedicated section for scipy
authorNabil Ghodbane <nabil.ghodbane@cea.fr>
Thu, 20 Jun 2024 08:45:10 +0000 (10:45 +0200)
committerNabil Ghodbane <nabil.ghodbane@cea.fr>
Thu, 20 Jun 2024 08:45:10 +0000 (10:45 +0200)
products/Python.pyconf
products/compil_scripts/Python-2.7.16.sh [new file with mode: 0644]
products/compil_scripts/scipy-0.18.1.sh [new file with mode: 0755]
products/scipy.pyconf

index 5dba14ddccdf2edad05d3855a02a6d2d575f25a0..dda31118eb9b03136679d5bbfcc52c37a3f91c6f 100755 (executable)
@@ -40,6 +40,11 @@ version_2_7_10 :
     patches : ['Python-2.7.10-ssl.patch']
 }
 
+version_2_7_16_CO9 :
+{
+   compil_script: 'Python-2.7.16.sh'
+}
+
 version_3_6_5 :
 {
  patches : []
diff --git a/products/compil_scripts/Python-2.7.16.sh b/products/compil_scripts/Python-2.7.16.sh
new file mode 100644 (file)
index 0000000..9315db9
--- /dev/null
@@ -0,0 +1,56 @@
+#!/bin/bash
+
+echo "##########################################################################"
+echo "Python" $VERSION
+echo "##########################################################################"
+
+rm -rf $BUILD_DIR
+mkdir $BUILD_DIR
+cd $BUILD_DIR
+
+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}"
+PYTHON_VERSION_MAJ=${PYTHON_VERSION:0:1}
+
+# --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  --enable-unicode=ucs4"
+if [ "${SAT_ENABLE_PYTHON_PYMALLOC}" == "1" ]; then
+         CONFIGURE_ARGUMENTS+=" --with-pymalloc"
+else
+         CONFIGURE_ARGUMENTS+=" --without-pymalloc"
+fi
+
+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
+
+echo
+echo "########## END"
+
diff --git a/products/compil_scripts/scipy-0.18.1.sh b/products/compil_scripts/scipy-0.18.1.sh
new file mode 100755 (executable)
index 0000000..84f882d
--- /dev/null
@@ -0,0 +1,28 @@
+#!/bin/bash                                                                                                                                                                              
+
+echo "##########################################################################"
+echo "scipy" $VERSION
+echo "##########################################################################"
+
+LINUX_DISTRIBUTION="$DIST_NAME$DIST_VERSION"
+
+echo "*** check installation"
+mkdir -p ${PRODUCT_INSTALL}
+rm -rf $BUILD_DIR
+mkdir -p $BUILD_DIR/cache/pip
+cd $BUILD_DIR
+
+export PYTHONPATH=${PRODUCT_INSTALL}/lib/python${PYTHON_VERSION}/site-packages:$PYTHONPATH
+export PATH=${PRODUCT_INSTALL}/bin:$PATH
+
+WHEELS=('scipy-0.18.1-cp27-cp27m-manylinux1_x86_64.whl')
+for WHEEL in "${WHEELS[@]}"; do
+    ${PYTHONBIN} -m pip install --cache-dir=$BUILD_DIR/cache/pip  $SOURCE_DIR/$WHEEL --no-deps --target=$PRODUCT_INSTALL/lib/python${PYTHON_VERSION}/site-packages
+    if [ $? -ne 0 ]; then
+        echo "ERROR: could not install $WHEEL"
+        exit 1
+    fi
+done
+
+echo
+echo "########## END"
index 07c0a0a5bb88778d1cb7eba4c30ae5a1f7872001..38378acc763510ed4d641d43623b40b8d8ee6ab9 100755 (executable)
@@ -72,7 +72,14 @@ version_1_3_0_win :
 version_0_18_1 :
 {
     compil_script : "scipy.sh"
-    depend : ['numpy','lapack']
+    depend : ['numpy','lapack', 'setuptools']
+}
+
+version_0_18_1_x86_64 :
+{
+    archive_info : {archive_name : "scipy-0.18.1-x86_64.tar.gz"}
+    compil_script : "scipy-0.18.1.sh"
+    depend : ['numpy','lapack', 'setuptools']
 }
 
 version_0_15_1 :