2014-04-01 17:49:29 +02:00
|
|
|
|
#!/bin/bash
|
2014-04-07 15:45:19 +02:00
|
|
|
|
#
|
2014-10-23 22:40:21 +02:00
|
|
|
|
# Setup script. Downloads dependencies if they are not already present
|
|
|
|
|
# in the current installation.
|
|
|
|
|
# Thu Oct 23 22:02:08 CEST 2014
|
|
|
|
|
|
|
|
|
|
BLUE="[34m"
|
|
|
|
|
RED="[31m"
|
|
|
|
|
BLACK="(B[m"
|
2014-04-01 17:49:29 +02:00
|
|
|
|
|
2014-04-03 01:50:22 +02:00
|
|
|
|
QPACKAGE_ROOT=${PWD}
|
2014-04-01 17:49:29 +02:00
|
|
|
|
|
|
|
|
|
if [[ -z ${IRPF90} ]] ;
|
|
|
|
|
then
|
|
|
|
|
make irpf90
|
2014-10-23 22:40:21 +02:00
|
|
|
|
IRPF90=${QPACKAGE_ROOT}/bin/irpf90
|
|
|
|
|
if [[ ! -x ${IRPF90} ]]
|
2014-04-07 15:45:19 +02:00
|
|
|
|
then
|
2014-10-23 22:40:21 +02:00
|
|
|
|
echo $RED "Error in IRPF90 installation" $BLACK
|
2014-04-07 15:45:19 +02:00
|
|
|
|
exit 1
|
|
|
|
|
fi
|
2014-04-01 17:49:29 +02:00
|
|
|
|
fi
|
|
|
|
|
|
2014-10-23 22:40:21 +02:00
|
|
|
|
|
2015-01-12 16:58:22 +01:00
|
|
|
|
if [[ -z ${OCAMLBREW_BASE} ]]
|
|
|
|
|
then
|
|
|
|
|
export OCAMLBREW_BASE="$HOME/ocamlbrew"
|
|
|
|
|
fi
|
|
|
|
|
|
2014-04-03 01:50:22 +02:00
|
|
|
|
cat << EOF > quantum_package.rc
|
2014-04-01 17:49:29 +02:00
|
|
|
|
export IRPF90=${IRPF90}
|
2015-01-12 16:58:22 +01:00
|
|
|
|
export OCAMLBREW_BASE=${OCAMLBREW_BASE}
|
2014-04-03 01:50:22 +02:00
|
|
|
|
export QPACKAGE_ROOT=${QPACKAGE_ROOT}
|
2015-01-12 19:14:00 +01:00
|
|
|
|
export LD_LIBRARY_PATH="\${QPACKAGE_ROOT}/lib":\${LD_LIBRARY_PATH}
|
|
|
|
|
export LIBRARY_PATH="\${QPACKAGE_ROOT}/lib":\${LIBRARY_PATH}
|
|
|
|
|
export C_INCLUDE_PATH=\${QPACKAGE_ROOT}/include:\${C_INCLUDE_PATH}
|
2014-07-28 14:09:55 +02:00
|
|
|
|
export PYTHONPATH=\${PYTHONPATH}:\${QPACKAGE_ROOT}/scripts
|
|
|
|
|
export PATH=\${PATH}:\${QPACKAGE_ROOT}/scripts
|
|
|
|
|
export PATH=\${PATH}:\${QPACKAGE_ROOT}/bin
|
2014-10-23 23:29:17 +02:00
|
|
|
|
export PATH=\${PATH}:\${QPACKAGE_ROOT}/ocaml
|
2014-06-25 14:58:58 +02:00
|
|
|
|
export QPACKAGE_CACHE_URL="http://qmcchem.ups-tlse.fr/files/scemama/quantum_package/cache"
|
2015-01-12 19:14:00 +01:00
|
|
|
|
source "\${QPACKAGE_ROOT}/bin/irpman" &> /dev/null
|
|
|
|
|
source "\${OCAMLBREW_BASE}"/ocaml-4*/etc/ocamlbrew.bashrc &> /dev/null
|
2014-04-01 17:49:29 +02:00
|
|
|
|
EOF
|
2014-04-04 00:41:43 +02:00
|
|
|
|
|
|
|
|
|
source quantum_package.rc
|
|
|
|
|
make EZFIO
|
2014-04-07 15:45:19 +02:00
|
|
|
|
if [[ ! -d ${QPACKAGE_ROOT}/EZFIO ]]
|
|
|
|
|
then
|
2014-10-23 22:40:21 +02:00
|
|
|
|
echo $RED "Error in IRPF90 installation" $BLACK
|
2014-04-07 15:45:19 +02:00
|
|
|
|
exit 1
|
|
|
|
|
fi
|
2014-10-07 14:45:44 +02:00
|
|
|
|
|
2014-10-23 22:40:21 +02:00
|
|
|
|
make ocaml
|
|
|
|
|
if [[ ! -f ${QPACKAGE_ROOT}/ocaml/Qptypes.ml ]]
|
2014-10-07 15:25:21 +02:00
|
|
|
|
then
|
2014-10-23 22:40:21 +02:00
|
|
|
|
echo $RED "Error in ocaml installation" $BLACK
|
|
|
|
|
exit 1
|
2014-10-07 14:45:44 +02:00
|
|
|
|
fi
|
|
|
|
|
|
2014-10-23 22:40:21 +02:00
|
|
|
|
echo $RED "
|
|
|
|
|
=======================================================
|
|
|
|
|
To complete the installation, add the following line to
|
|
|
|
|
your ~/.bashrc:
|
|
|
|
|
|
2014-10-27 12:40:30 +01:00
|
|
|
|
source ${QPACKAGE_ROOT}/quantum_package.rc
|
2014-10-23 22:40:21 +02:00
|
|
|
|
|
|
|
|
|
=======================================================
|
|
|
|
|
" $BLACK
|
2014-10-07 14:45:44 +02:00
|
|
|
|
|
2014-10-23 23:29:17 +02:00
|
|
|
|
source quantum_package.rc
|
|
|
|
|
exec bash
|
|
|
|
|
|