4 ver=`python -c 'import Numeric; print Numeric.__version__' 2>/dev/null`
5 if [ "$ver" == "23.7" ]; then
12 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
13 #$DELIM ${PRODUCT_TYPE} $DELIM
14 export PYTHONPATH=\${INSTALL_ROOT}/${PRODUCT}/lib/python\${PYTHON_VERSION}/site-packages/Numeric:\${PYTHONPATH}
17 (test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
18 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
21 # looks for the native product and collects it's environment (used by make_env())
23 numpath=`python -c "import Numeric; print Numeric.__file__" 2>/dev/null`
24 if [ -n "${numpath}" ] ; then
25 numpath=`dirname ${numpath}`
26 ver=`python -c 'import Numeric; print Numeric.__version__' 2>/dev/null | awk -F. '{v=0;for(i=1;i<=NF;i++)v=v*100+$i;print v}'`
27 if [ $ver -ge 2307 ] ; then
28 tmp="${numpath} ${numpath} \${PYTHONPATH} ${PYTHONPATH}";
29 pythonpath=`sort_path ${tmp}`
30 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
31 #$DELIM ${PRODUCT_TYPE} $DELIM
32 export PYTHONPATH=${pythonpath}
35 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
36 if [ $ver -eq 2307 ] ; then
47 try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
53 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
54 source ${INSTALL_WORK}/$SHRC
56 makedir ${PRODUCT_DIR}
58 check_jb tar xfz ${SOURCE_DIR}/Numeric-23.7.tar.gz -C ${INSTALL_WORK}
61 # check existence of lapack, f77blas, cblas, atlas, g2c libraries
62 check_lib_version liblapack.so $LD_LIBRARY_PATH:/usr/lib
64 check_lib_version libf77blas.so $LD_LIBRARY_PATH:/usr/lib
66 check_lib_version libcblas.so $LD_LIBRARY_PATH:/usr/lib
68 check_lib_version libatlas.so $LD_LIBRARY_PATH:/usr/lib
70 check_lib_version libg2c.so $LD_LIBRARY_PATH:/usr/lib
72 let nfound=$lapack_nf+$f77blas_nf+$cblas_nf+$atlas_nf+$g2c_nf
73 # modify build procedure according to the libraries found
74 if [ $nfound -gt 0 ] ; then
75 cp setup.py setup.py.orig
76 if [ "$lapack_nf" -eq "1" ] ; then
77 sed -e "s%\(^libraries_list = \[\)\('lapack', \)\(.*\)$%\1\3%g" setup.py > _setup.py
80 if [ "$f77blas_nf" -eq "1" ] ; then
81 sed -e "s%\(^libraries_list = \[.*\)\('f77blas', \)\(.*\)$%\1\3%g" setup.py > _setup.py
84 if [ "$cblas_nf" -eq "1" ] ; then
85 sed -e "s%\(^libraries_list = \[.*\)\('cblas', \)\(.*\)$%\1\3%g" setup.py > _setup.py
88 if [ "$atlas_nf" -eq "1" ] ; then
89 sed -e "s%\(^libraries_list = \[.*\)\('atlas', \)\(.*\)$%\1\3%g" setup.py > _setup.py
92 if [ "$g2c_nf" -eq "1" ] ; then
93 sed -e "s%\(^libraries_list = \[.*\)\('g2c'\)\(.*\)$%\1\3%g" setup.py > _setup.py
96 sed -e "s%^use_dotblas = 1%use_dotblas = 0%g" setup.py > _setup.py
98 sed -e "s%#\(os.path.join('Src', 'blas_lite.c'),\)%\1%g" setup.py > _setup.py
100 sed -e "s%#\(os.path.join('Src', 'f2c_lite.c'),\)%\1%g" setup.py > _setup.py
101 mv _setup.py setup.py
102 sed -e "s%#\(os.path.join('Src', 'zlapack_lite.c'),\)%\1%g" setup.py > _setup.py
103 mv _setup.py setup.py
104 sed -e "s%#\(os.path.join('Src', 'dlapack_lite.c')\)%\1%g" setup.py > _setup.py
105 mv _setup.py setup.py
109 check_job ${PRODUCT_DIR}/INSTALL.LOG python setup.py install --prefix=${PRODUCT_DIR}
111 #du -sk ${PRODUCT_WORK} > ${PRODUCT_DIR}/size.log
112 cd ${PRODUCT_DIR}; rm -fr ${PRODUCT_WORK}
118 check_jb tar xfz ${SOURCE_DIR}/Numeric-23.7.tar.gz -C ${INSTALL_ROOT}
124 export INSTALL_WORK=$2;
125 export SOURCE_DIR=$3;
126 export INSTALL_ROOT=$4;
127 export PRODUCT_SEQUENCE=$5;
128 if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="numeric" ; fi
129 export PRODUCT="Numeric-23.7"
130 export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
131 export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}