3 ####################################################################################
4 # File : Numeric-23.7.sh
5 # Created : Thu Dec 18 12:01:00 2002
6 # Author : Vadim SANDLER, Open CASCADE SAS (vadim.sandler@opencascade.com)
8 # Module : Installation Wizard
9 # Copyright : 2002-2007 CEA
11 # This script is the part of the SALOME installation procedure.
13 ####################################################################################
17 ver=`python -c 'import Numeric; print Numeric.__version__' 2>/dev/null`
18 if [ "$ver" == "23.7" ]; then
26 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
27 #$DELIM ${PRODUCT_TYPE} $DELIM
28 export PYTHONPATH=\${INSTALL_ROOT}/${PRODUCT}/lib/python\${PYTHON_VERSION}/site-packages/Numeric:\${PYTHONPATH}
31 (test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
32 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
37 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh <<EOF
38 #$DELIM ${PRODUCT_TYPE}_src $DELIM
42 (test -w ${PRODUCT_DIR}_SRC && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh ${PRODUCT_DIR}_SRC)
43 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
48 try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
49 try_existing ${PRODUCT_DIR}_SRC ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
55 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
56 source ${INSTALL_WORK}/$SHRC
58 check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
60 # to generate environment scripts
64 install_source_and_build()
70 makedir ${PRODUCT_DIR}
72 if test `uname -m` = "x86_64" ; then
76 # check existence of lapack, f77blas, cblas, atlas, g2c libraries
77 check_lib_version liblapack.so $LD_LIBRARY_PATH:/usr/lib
79 check_lib_version libf77blas.so $LD_LIBRARY_PATH:/usr/lib
81 check_lib_version libcblas.so $LD_LIBRARY_PATH:/usr/lib
83 check_lib_version libatlas.so $LD_LIBRARY_PATH:/usr/lib
85 check_lib_version libg2c.so $LD_LIBRARY_PATH:/usr/lib
87 let nfound=$lapack_nf+$f77blas_nf+$cblas_nf+$atlas_nf+$g2c_nf
88 # modify build procedure according to the libraries found
89 if [ $nfound -gt 0 ] ; then
90 cp setup.py setup.py.orig
91 if [ "$lapack_nf" -eq "1" ] ; then
92 sed -e "s%\(^libraries_list = \[\)\('lapack', \)\(.*\)$%\1\3%g" setup.py > _setup.py
95 if [ "$f77blas_nf" -eq "1" ] ; then
96 sed -e "s%\(^libraries_list = \[.*\)\('f77blas', \)\(.*\)$%\1\3%g" setup.py > _setup.py
99 if [ "$cblas_nf" -eq "1" ] ; then
100 sed -e "s%\(^libraries_list = \[.*\)\('cblas', \)\(.*\)$%\1\3%g" setup.py > _setup.py
101 mv _setup.py setup.py
103 if [ "$atlas_nf" -eq "1" ] ; then
104 sed -e "s%\(^libraries_list = \[.*\)\('atlas', \)\(.*\)$%\1\3%g" setup.py > _setup.py
105 mv _setup.py setup.py
107 if [ "$g2c_nf" -eq "1" ] ; then
108 sed -e "s%\(^libraries_list = \[.*\)\('g2c'\)\(.*\)$%\1\3%g" setup.py > _setup.py
109 mv _setup.py setup.py
111 sed -e "s%^use_dotblas = 1%use_dotblas = 0%g" setup.py > _setup.py
112 mv _setup.py setup.py
113 sed -e "s%#\(os.path.join('Src', 'blas_lite.c'),\)%\1%g" setup.py > _setup.py
114 mv _setup.py setup.py
115 sed -e "s%#\(os.path.join('Src', 'f2c_lite.c'),\)%\1%g" setup.py > _setup.py
116 mv _setup.py setup.py
117 sed -e "s%#\(os.path.join('Src', 'zlapack_lite.c'),\)%\1%g" setup.py > _setup.py
118 mv _setup.py setup.py
119 sed -e "s%#\(os.path.join('Src', 'dlapack_lite.c')\)%\1%g" setup.py > _setup.py
120 mv _setup.py setup.py
124 check_job ${PRODUCT_DIR}/INSTALL.LOG python setup.py install --prefix=${PRODUCT_DIR}
126 if test `uname -m` = "x86_64" ; then
127 cd ${PRODUCT_DIR}; ln -sf lib64 lib
130 #du -sk ${PRODUCT_DIR}_SRC > ${PRODUCT_DIR}/size.log
133 # remove sources and temporary files after building
134 if [ ${REMOVE_SRC_TMP} == "TRUE" ] ; then
135 test -d ${PRODUCT_DIR}_SRC && rm -fr ${PRODUCT_DIR}_SRC
138 # to generate environment scripts
144 check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
146 # to generate environment scripts
151 export INSTALL_WORK=$2;
152 export SOURCE_DIR=$3;
153 export INSTALL_ROOT=$4;
154 export PRODUCT_SEQUENCE=$5;
155 export PRODUCT_TYPE=$6;
156 export INSTALL_PRODUCTS=$7;
159 export PRODUCT="Numeric-23.7"
160 export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
161 export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}