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
|
|
|
|
|
2015-01-16 00:48:09 +01:00
|
|
|
|
QPACKAGE_ROOT="$( cd "$(dirname "$BASH_SOURCE")" ; pwd -P )"
|
2014-04-01 17:49:29 +02:00
|
|
|
|
|
2015-01-16 00:48:09 +01:00
|
|
|
|
|
2014-04-03 01:50:22 +02:00
|
|
|
|
cat << EOF > quantum_package.rc
|
2015-01-16 00:48:09 +01:00
|
|
|
|
export QPACKAGE_ROOT=\$( cd \$(dirname "\${BASH_SOURCE}") ; pwd -P )
|
2015-05-04 19:44:09 +02:00
|
|
|
|
export IRPF90="\${QPACKAGE_ROOT}/bin/irpf90"
|
2015-01-16 00:48:09 +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}
|
2015-04-30 14:36:40 +02:00
|
|
|
|
|
2015-05-04 19:44:09 +02:00
|
|
|
|
export PYTHONPATH=\${PYTHONPATH}\$(find "\${QPACKAGE_ROOT}"/scripts -type d -printf ":%p")
|
2015-04-30 14:36:40 +02:00
|
|
|
|
|
2015-05-04 19:44:09 +02:00
|
|
|
|
export PATH=\${PATH}\$(find "\${QPACKAGE_ROOT}"/scripts -type d -printf ":%p")
|
2015-01-16 00:48:09 +01:00
|
|
|
|
export PATH=\${PATH}:"\${QPACKAGE_ROOT}"/bin
|
|
|
|
|
export PATH=\${PATH}:"\${QPACKAGE_ROOT}"/ocaml
|
2015-06-02 18:17:59 +02:00
|
|
|
|
export PATH=\${PATH}:"\${QPACKAGE_ROOT}"/ninja
|
2015-01-19 11:23:23 +01:00
|
|
|
|
source "\${QPACKAGE_ROOT}"/bin/irpman &> /dev/null
|
2014-04-01 17:49:29 +02:00
|
|
|
|
EOF
|
2014-04-04 00:41:43 +02:00
|
|
|
|
|
2015-03-26 01:17:37 +01:00
|
|
|
|
|
2014-04-04 00:41:43 +02:00
|
|
|
|
source quantum_package.rc
|
2015-03-26 01:17:37 +01:00
|
|
|
|
|
|
|
|
|
echo "${BLUE}===== Installing IRPF90 ===== ${BLACK}"
|
2015-04-30 14:44:14 +02:00
|
|
|
|
${QPACKAGE_ROOT}/scripts/install/install_irpf90.sh | tee ${QPACKAGE_ROOT}/install_logs/install_irpf90.log
|
|
|
|
|
if [[ ! -d ${QPACKAGE_ROOT}/irpf90 ]] || [[ ! -x ${QPACKAGE_ROOT}/bin/irpf90 ]] || [[ ! -x ${QPACKAGE_ROOT}/bin/irpman ]]
|
2015-03-26 01:17:37 +01:00
|
|
|
|
then
|
|
|
|
|
echo $RED "Error in IRPF90 installation" $BLACK
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
2015-04-30 14:44:14 +02:00
|
|
|
|
mkdir -p ${QPACKAGE_ROOT}/install_logs
|
2015-03-26 01:17:37 +01:00
|
|
|
|
|
2015-05-26 10:42:21 +02:00
|
|
|
|
echo "${BLUE}===== Installing Ninja ===== ${BLACK}"
|
|
|
|
|
${QPACKAGE_ROOT}/scripts/install/install_ninja.sh | tee ${QPACKAGE_ROOT}/install_logs/install_ninja.log
|
|
|
|
|
|
2015-03-26 01:17:37 +01:00
|
|
|
|
echo "${BLUE}===== Installing Zlib ===== ${BLACK}"
|
2015-04-30 14:44:14 +02:00
|
|
|
|
${QPACKAGE_ROOT}/scripts/install/install_zlib.sh | tee ${QPACKAGE_ROOT}/install_logs/install_zlib.log
|
2015-03-26 01:17:37 +01:00
|
|
|
|
|
|
|
|
|
echo "${BLUE}===== Installing Curl ===== ${BLACK}"
|
2015-04-30 14:44:14 +02:00
|
|
|
|
${QPACKAGE_ROOT}/scripts/install/install_curl.sh | tee ${QPACKAGE_ROOT}/install_logs/install_curl.log
|
2015-03-26 01:17:37 +01:00
|
|
|
|
|
|
|
|
|
echo "${BLUE}===== Installing M4 ===== ${BLACK}"
|
2015-04-30 14:44:14 +02:00
|
|
|
|
${QPACKAGE_ROOT}/scripts/install/install_m4.sh | tee ${QPACKAGE_ROOT}/install_logs/install_m4.log
|
2015-03-26 01:17:37 +01:00
|
|
|
|
|
2015-04-27 16:55:19 +02:00
|
|
|
|
echo "${BLUE}===== Installing Docopt ===== ${BLACK}"
|
2015-04-30 14:44:14 +02:00
|
|
|
|
${QPACKAGE_ROOT}/scripts/install/install_docopt.sh | tee ${QPACKAGE_ROOT}/install_logs/install_docopt.log
|
2015-04-27 16:55:19 +02:00
|
|
|
|
|
2015-03-26 01:17:37 +01:00
|
|
|
|
echo "${BLUE}===== Installing EMSL Basis set library ===== ${BLACK}"
|
2015-04-30 14:44:14 +02:00
|
|
|
|
${QPACKAGE_ROOT}/scripts/install/install_emsl.sh | tee ${QPACKAGE_ROOT}/install_logs/install_emsl.log
|
2015-03-26 01:17:37 +01:00
|
|
|
|
|
|
|
|
|
if [[ ! -d ${QPACKAGE_ROOT}/EMSL_Basis ]]
|
|
|
|
|
then
|
|
|
|
|
echo $RED "Error in EMSL Basis set library installation" $BLACK
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
echo "${BLUE}===== Installing EZFIO ===== ${BLACK}"
|
|
|
|
|
|
2015-04-30 14:44:14 +02:00
|
|
|
|
${QPACKAGE_ROOT}/scripts/install/install_ezfio.sh | tee ${QPACKAGE_ROOT}/install_logs/install_ezfio.log
|
2015-03-26 01:17:37 +01:00
|
|
|
|
if [[ ! -d ${QPACKAGE_ROOT}/EZFIO ]]
|
|
|
|
|
then
|
|
|
|
|
echo $RED "Error in EZFIO installation" $BLACK
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo "${BLUE}===== Installing Ocaml compiler and libraries ===== ${BLACK}"
|
|
|
|
|
rm -f -- ocaml/Qptypes.ml
|
2015-04-30 14:44:14 +02:00
|
|
|
|
${QPACKAGE_ROOT}/scripts/install/install_ocaml.sh | tee ${QPACKAGE_ROOT}/install_logs/install_ocaml.log
|
2015-03-26 01:17:37 +01:00
|
|
|
|
|
2014-10-23 22:40:21 +02:00
|
|
|
|
if [[ ! -f ${QPACKAGE_ROOT}/ocaml/Qptypes.ml ]]
|
2014-10-07 15:25:21 +02:00
|
|
|
|
then
|
2015-03-26 01:17:37 +01:00
|
|
|
|
echo $RED "Error in Ocaml installation" $BLACK
|
2014-10-23 22:40:21 +02:00
|
|
|
|
exit 1
|
2014-10-07 14:45:44 +02:00
|
|
|
|
fi
|
|
|
|
|
|
2015-03-26 01:17:37 +01:00
|
|
|
|
echo "${BLUE}===== Installing resultsFile Python library ===== ${BLACK}"
|
2015-04-27 17:10:25 +02:00
|
|
|
|
${QPACKAGE_ROOT}/scripts/install/install_resultsFile.sh
|
2015-01-19 15:45:05 +01:00
|
|
|
|
if [[ ! -d ${QPACKAGE_ROOT}/resultsFile ]]
|
|
|
|
|
then
|
|
|
|
|
echo $RED "Error in resultsFile installation" $BLACK
|
|
|
|
|
exit 1
|
|
|
|
|
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
|
|
|
|
|
2015-03-24 17:47:22 +01:00
|
|
|
|
|
2015-04-30 14:44:14 +02:00
|
|
|
|
|
2015-03-25 23:03:51 +01:00
|
|
|
|
|
2015-03-24 17:47:22 +01:00
|
|
|
|
if [[ $1 == "--robot" ]] ;
|
|
|
|
|
then
|
|
|
|
|
exit 0
|
|
|
|
|
else
|
|
|
|
|
source quantum_package.rc
|
|
|
|
|
exec bash
|
|
|
|
|
fi
|
2014-10-23 23:29:17 +02:00
|
|
|
|
|