]> SALOME platform Git repositories - tools/install.git/blob - config_files/Numeric-23.7.sh
Salome HOME
Remove v3.1.0 beta1 release notes
[tools/install.git] / config_files / Numeric-23.7.sh
1 #!/bin/sh
2
3 check_version(){
4 ver=`python -c 'import Numeric; print Numeric.__version__' 2>/dev/null`
5 if [ "$ver" == "23.7" ]; then
6    return 0
7 fi
8 return 1
9 }
10
11 print_env(){
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}
15 ##
16 EOF
17 (test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
18 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
19 }
20
21 # looks for the native product and collects it's environment (used by make_env())
22 try_native(){
23 check_version
24 if [ $? -eq 0 ] ; then
25     pythonpath="`find_in_path Numeric.py ${PYTHONPATH}`"
26     tmp="${pythonpath} ${pythonpath} \${PYTHONPATH} ${PYTHONPATH}";  
27     pythonpath=`sort_path ${tmp}`
28     cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF 
29 #$DELIM ${PRODUCT_TYPE} $DELIM
30 export PYTHONPATH=${pythonpath}
31 ##
32 EOF
33     make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
34     return 0
35 fi
36 return 1
37 }
38
39 try_preinstalled(){
40 try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
41 return $?
42 }
43
44 install_source()
45 {
46 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
47 source ${INSTALL_WORK}/$SHRC
48
49 makedir ${PRODUCT_DIR}
50
51 check_jb tar xfz ${SOURCE_DIR}/Numeric-23.7.tar.gz -C ${INSTALL_WORK}
52 cd ${PRODUCT_WORK}
53
54 # check existence of lapack, f77blas, cblas, atlas libraries
55 found=1
56 check_lib_version liblapack.so
57 if [ "$?" -ne "0" ] ; then
58   found=0
59 fi
60 if [ "$found" -eq "1" ] ; then
61     check_lib_version libf77blas.so
62     if [ "$?" -ne "0" ] ; then
63         found=0
64     fi
65 fi
66 if [ "$found" -eq "1" ] ; then
67     check_lib_version libcblas.so
68     if [ "$?" -ne "0" ] ; then
69         found=0
70     fi
71 fi
72 if [ "$found" -eq "1" ] ; then
73     check_lib_version libatlas.so
74     if [ "$?" -ne "0" ] ; then
75         found=0
76     fi
77 fi
78 # if any library is not found modify build procedure
79 if [ "$found" -eq "0" ] ; then
80     cp setup.py setup.py.orig
81     sed -e "s%^use_dotblas = 1%use_dotblas = 0%g" -e "s%^libraries_list = \['lapack', 'cblas', 'f77blas', 'atlas', 'g2c'\]%libraries_list = \['g2c'\]%g" setup.py.orig > setup.py
82     chmod a+x setup.py
83 fi
84
85 check_job ${PRODUCT_DIR}/INSTALL.LOG python setup.py install --prefix=${PRODUCT_DIR}
86
87 #du -sk ${PRODUCT_WORK} > ${PRODUCT_DIR}/size.log
88 cd ${PRODUCT_DIR}; rm -fr ${PRODUCT_WORK}
89 print_env
90 }
91
92 install_binary()
93 {
94 check_jb tar xfz ${SOURCE_DIR}/Numeric-23.7.tar.gz -C ${INSTALL_ROOT}
95
96 print_env
97 }
98
99 export PROCEDURE=$1;
100 export INSTALL_WORK=$2;
101 export SOURCE_DIR=$3;
102 export INSTALL_ROOT=$4;
103 export PRODUCT_SEQUENCE=$5;
104 if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="numeric" ; fi
105 export PRODUCT="Numeric-23.7"
106 export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
107 export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
108 source ./common.sh
109 $PROCEDURE