Salome HOME
01049ee4c57874280b36ae18f9652a9de9f8be20
[tools/pvdeliv.git] / oldies / scripts / build_medcoupling.sh
1 #!/bin/bash
2
3 software_and_version=$1
4 archive_file=$2
5
6 # get the absolute path of the directory containing this script
7 execPath=$(readlink -f $(dirname $0))
8
9 archive=${execPath}/../archives/${archive_file}
10 src_dir=${execPath}/../src/${software_and_version}
11 build_dir=${execPath}/../build/${software_and_version}
12 install_dir=${execPath}/../install/${software_and_version}
13
14 mkdir -p ${build_dir}
15 mkdir -p ${install_dir}
16
17 # source extraction
18 (
19     if [ ! -d "${src_dir}" ]
20     then
21         ${execPath}/extract.sh ${archive} ${src_dir}
22     fi
23 )
24 status=$?; if [ ${status} -ne 0 ]; then exit ${status}; fi
25
26 # configure
27 (
28     cd ${build_dir}
29     . ${execPath}/environment.sh
30     cmake -DCMAKE_INSTALL_PREFIX=${install_dir} -DMEDFILE_ROOT_DIR=${MED3HOME} -DSALOME_MED_STANDALONE=ON -DSALOME_MED_ENABLE_PYTHON=ON -DSALOME_MED_ENABLE_PARTITIONER=OFF -DSALOME_MED_ENABLE_RENUMBER=OFF -DSALOME_MED_WITH_FILE_EXAMPLES=OFF -DSALOME_BUILD_TESTS=OFF -DSALOME_BUILD_DOC=OFF -DSALOME_MED_MEDLOADER_USE_XDR=OFF ${src_dir}
31 ) | tee ${build_dir}/configure.log 2>&1
32 status=$?; if [ ${status} -ne 0 ]; then exit ${status}; fi
33
34 # build
35 (
36     cd ${build_dir}
37     . ${execPath}/environment.sh
38     make -j${NB_PROC}
39 ) | tee ${build_dir}/build.log 2>&1
40 status=$?; if [ ${status} -ne 0 ]; then exit ${status}; fi
41 status=$?; if [ ${status} -ne 0 ]; then exit ${status}; fi
42
43 # install
44 (
45     cd ${build_dir}
46     . ${execPath}/environment.sh
47     make install
48 ) | tee ${build_dir}/install.log 2>&1
49 status=$?; if [ ${status} -ne 0 ]; then exit ${status}; fi
50
51 # update environment
52 echo "" >> ${execPath}/environment.sh
53 echo "#------- MEDCoupling ------" >> ${execPath}/environment.sh
54 echo "export MED_ROOT_DIR=${install_dir}" >> ${execPath}/environment.sh
55 echo "export LD_LIBRARY_PATH=\${MED_ROOT_DIR}/lib/salome:\${LD_LIBRARY_PATH}" >> ${execPath}/environment.sh
56 echo "export PYTHONPATH=\${MED_ROOT_DIR}/lib/python\${PYTHON_VERSION}/site-packages/salome:\${PYTHONPATH}"