From 6bc205d9d5057246409533b690b0517b8ac76a98 Mon Sep 17 00:00:00 2001 From: maintenance team Date: Mon, 9 Nov 2009 09:18:57 +0000 Subject: [PATCH] Replacing Python 2.5.4 by 2.4.4. Removing numpy 1.3.0 and adding Numeric 24.2 --- .../{numpy-1.3.0.sh => Numeric-24.2.sh} | 117 +++++++++++------- .../{Python-2.5.4.sh => Python-2.4.4.sh} | 2 +- 2 files changed, 71 insertions(+), 48 deletions(-) rename config_files/{numpy-1.3.0.sh => Numeric-24.2.sh} (51%) rename config_files/{Python-2.5.4.sh => Python-2.4.4.sh} (99%) diff --git a/config_files/numpy-1.3.0.sh b/config_files/Numeric-24.2.sh similarity index 51% rename from config_files/numpy-1.3.0.sh rename to config_files/Numeric-24.2.sh index 624a3e7..610bbd2 100755 --- a/config_files/numpy-1.3.0.sh +++ b/config_files/Numeric-24.2.sh @@ -1,7 +1,7 @@ #!/bin/bash -noprofile #################################################################################### -# File : numpy-1.3.0.sh +# File : Numeric-24.2.sh # Created : Thu Dec 18 12:01:00 2002 # Author : Vadim SANDLER, Open CASCADE SAS (vadim.sandler@opencascade.com) # Project : SALOME @@ -12,17 +12,20 @@ # #################################################################################### -check_version(){ -# It is not necessary to check version! -return 0 +check_version() +{ +ver=`python -c 'import Numeric; print Numeric.__version__' 2>/dev/null` +if [ "$ver" == "24.2" ]; then + return 0 +fi +return 1 } -print_env_bin(){ +print_env_bin() +{ cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh < /dev/null - if [ $? == 0 ] ; then is_debian31=1 ; fi -fi - -if [ $is_debian31 == 1 ] ; then -export LAPACKSUFF="3.1.1" -else -export LAPACKSUFF="3.2" -fi - -export LD_LIBRARY_PATH=${PRODUCT_SRC_DIR}/lapack-${LAPACKSUFF}_SRC:${LD_LIBRARY_PATH} - -check_jb tar xfz ${SOURCE_DIR}/lapack-${LAPACKSUFF}.tar.gz -C ${PRODUCT_SRC_DIR} - - -check_jb tar xfz ${SOURCE_DIR}/numpy-1.3.0.tar.gz -C ${PRODUCT_SRC_DIR} +check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INST_ROOT} # to generate environment scripts try_preinstalled @@ -85,22 +68,62 @@ install_source # build sources test -z ${SINGLE_DIR} && makedir ${PRODUCT_DIR} || mkdir -p ${PRODUCT_DIR} +cd ${PRODUCT_SRC_DIR} + if test `uname -m` = "x86_64" ; then +export CFLAGS=-m64 +export CXXFLAGS=-m64 + fi +# check existence of lapack, f77blas, cblas, atlas, g2c libraries +check_lib_version liblapack.so $LD_LIBRARY_PATH:/usr/lib +lapack_nf=$? +check_lib_version libf77blas.so $LD_LIBRARY_PATH:/usr/lib +f77blas_nf=$? +check_lib_version libcblas.so $LD_LIBRARY_PATH:/usr/lib +cblas_nf=$? +check_lib_version libatlas.so $LD_LIBRARY_PATH:/usr/lib +atlas_nf=$? +check_lib_version libg2c.so $LD_LIBRARY_PATH:/usr/lib +g2c_nf=$? +let nfound=$lapack_nf+$f77blas_nf+$cblas_nf+$atlas_nf+$g2c_nf +# modify build procedure according to the libraries found +if [ $nfound -gt 0 ] ; then + cp setup.py setup.py.orig + if [ "$lapack_nf" -eq "1" ] ; then + sed -e "s%\(^libraries_list = \[\)\('lapack', \)\(.*\)$%\1\3%g" setup.py > _setup.py + mv _setup.py setup.py + fi + if [ "$f77blas_nf" -eq "1" ] ; then + sed -e "s%\(^libraries_list = \[.*\)\('f77blas', \)\(.*\)$%\1\3%g" setup.py > _setup.py + mv _setup.py setup.py + fi + if [ "$cblas_nf" -eq "1" ] ; then + sed -e "s%\(^libraries_list = \[.*\)\('cblas', \)\(.*\)$%\1\3%g" setup.py > _setup.py + mv _setup.py setup.py + fi + if [ "$atlas_nf" -eq "1" ] ; then + sed -e "s%\(^libraries_list = \[.*\)\('atlas', \)\(.*\)$%\1\3%g" setup.py > _setup.py + mv _setup.py setup.py + fi + if [ "$g2c_nf" -eq "1" ] ; then + sed -e "s%\(^libraries_list = \[.*\)\('g2c'\)\(.*\)$%\1\3%g" setup.py > _setup.py + mv _setup.py setup.py + fi + sed -e "s%^use_dotblas = 1%use_dotblas = 0%g" setup.py > _setup.py + mv _setup.py setup.py + sed -e "s%#\(os.path.join('Src', 'blas_lite.c'),\)%\1%g" setup.py > _setup.py + mv _setup.py setup.py + sed -e "s%#\(os.path.join('Src', 'f2c_lite.c'),\)%\1%g" setup.py > _setup.py + mv _setup.py setup.py + sed -e "s%#\(os.path.join('Src', 'zlapack_lite.c'),\)%\1%g" setup.py > _setup.py + mv _setup.py setup.py + sed -e "s%#\(os.path.join('Src', 'dlapack_lite.c')\)%\1%g" setup.py > _setup.py + mv _setup.py setup.py + chmod a+x setup.py +fi -# install -GCC=`which gcc` -cat >> ${PRODUCT_DIR}/MAKE.LOG <0)v1=$1;if(NF>1)v2=$2;if(NF>2)v3=$3;print v1*10000+v2*100+v3}'` PY_LIBVERSION=`echo ${PY_VERSION} | awk -F. '{printf("%d.%d",$1,$2)}'` -- 2.39.2