]> SALOME platform Git repositories - tools/install.git/commitdiff
Salome HOME
Adding numpy prerequisit
authorinv <inv@opencascade.com>
Wed, 31 Mar 2010 13:46:20 +0000 (13:46 +0000)
committerinv <inv@opencascade.com>
Wed, 31 Mar 2010 13:46:20 +0000 (13:46 +0000)
config_files/numpy-1.3.0.sh [new file with mode: 0755]

diff --git a/config_files/numpy-1.3.0.sh b/config_files/numpy-1.3.0.sh
new file mode 100755 (executable)
index 0000000..624a3e7
--- /dev/null
@@ -0,0 +1,143 @@
+#!/bin/bash -noprofile
+
+####################################################################################
+#  File      : numpy-1.3.0.sh
+#  Created   : Thu Dec 18 12:01:00 2002
+#  Author    : Vadim SANDLER, Open CASCADE SAS (vadim.sandler@opencascade.com)
+#  Project   : SALOME
+#  Module    : Installation Wizard
+#  Copyright : 2002-2008 CEA
+#
+#  This script is the part of the SALOME installation procedure.
+#
+####################################################################################
+
+check_version(){
+# It is not necessary to check version!
+return 0
+}
+
+print_env_bin(){
+cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF 
+#$DELIM ${PRODUCT_TYPE} $DELIM
+export PYTHONPATH=\${INST_ROOT}/${SINGLE_DIR:-${PRODUCT}}/lib/python\${PYTHON_VERSION}/site-packages:\${PYTHONPATH}
+export PATH=\${INST_ROOT}/${SINGLE_DIR:-${PRODUCT}}/bin:\${PATH}
+export LD_LIBRARY_PATH=\${INST_ROOT}/${SINGLE_DIR:-${PRODUCT}}/lib:\${LD_LIBRARY_PATH}
+##
+EOF
+(test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
+make_env ${INST_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
+}
+
+print_env_src()
+{
+cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh <<EOF
+#$DELIM ${PRODUCT_TYPE}_src $DELIM
+# nothing to do
+##
+EOF
+(test -w ${PRODUCT_SRC_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh ${PRODUCT_SRC_DIR})
+make_env ${INST_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
+}
+
+try_preinstalled(){
+try_existing ${PRODUCT_DIR} ${INST_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
+try_existing ${PRODUCT_SRC_DIR} ${INST_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
+return $?
+}
+
+install_source()
+{
+make_env ${INST_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
+source ${INSTALL_WORK}/$SHRC
+
+makedir ${PRODUCT_SRC_DIR}
+# unpack
+
+is_debian31=0
+
+if [ -e /etc/issue ] ; then
+  grep -e "Debian GNU/Linux 3.1" /etc/issue > /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}
+
+# to generate environment scripts
+try_preinstalled
+}
+
+install_source_and_build()
+{
+# install sources
+install_source
+
+# build sources
+test -z ${SINGLE_DIR} && makedir ${PRODUCT_DIR} || mkdir -p ${PRODUCT_DIR}
+
+# install
+GCC=`which gcc`
+cat >> ${PRODUCT_DIR}/MAKE.LOG <<EOF
+used gcc=$GCC
+EOF
+cd ${PRODUCT_SRC_DIR}/lapack-${LAPACKSUFF}_SRC ; check_job ${PRODUCT_DIR}/MAKE.LOG make
+cd ${PRODUCT_SRC_DIR}/numpy-1.3.0_SRC ; check_job ${PRODUCT_DIR}/MAKE.LOG python setup.py install --prefix=${PRODUCT_DIR}
+
+cd ${PRODUCT_SRC_DIR}/lapack-${LAPACKSUFF}_SRC
+list=`ls *.so`
+for aLib in $list; do
+cp -rf ${aLib} ${PRODUCT_DIR}/lib
+done
+
+cd ${PRODUCT_DIR}
+
+# remove sources and temporary files after building
+if [ ${REMOVE_SRC_TMP} == "TRUE" ] ; then
+    test -d ${PRODUCT_SRC_DIR} && rm -fr ${PRODUCT_SRC_DIR}
+fi
+
+# to generate environment scripts
+try_preinstalled
+}
+
+install_binary()
+{
+make_env ${INST_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
+source ${INSTALL_WORK}/$SHRC
+
+# create a product directory
+test -z ${SINGLE_DIR} && makedir ${PRODUCT_DIR} || mkdir -p ${PRODUCT_DIR}
+
+check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${PRODUCT_DIR}
+
+# to generate environment script for sources
+try_preinstalled
+}
+
+export PROCEDURE=$1;
+export INSTALL_WORK=$2;
+export SOURCE_DIR=$3;
+export INST_ROOT=$4;
+export PRODUCT_SEQUENCE=$5;
+export PRODUCT_TYPE=$6;
+export INSTALL_PRODUCTS=$7;
+shift
+REMOVE_SRC_TMP=$8;
+test $# == 10 && shift && SINGLE_DIR=$9
+export PRODUCT="numpy-1.3.0"
+export PRODUCT_DIR=${INST_ROOT}/${SINGLE_DIR:-${PRODUCT}}
+export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
+export PRODUCT_SRC_DIR=${INST_ROOT}/${PRODUCT}_SRC
+source ./common.sh
+$PROCEDURE