10
1
mirror of https://gitlab.com/scemama/qmcchem.git synced 2024-12-22 12:23:30 +01:00
qmcchem/install/scripts/install_ocaml.sh

51 lines
1.0 KiB
Bash
Raw Normal View History

2015-12-18 22:25:32 +01:00
#!/bin/bash -x
set -u
set -e
2015-12-18 22:53:27 +01:00
cd .. ; QMCCHEM_PATH="$PWD" ; cd -
2015-12-18 22:25:32 +01:00
PACKAGES="core cryptokit ocamlfind sexplib"
declare -i i
i=$(gcc -dumpversion | cut -d '.' -f 2)
if [[ i -lt 6 ]]
then
echo "GCC version $(gcc -dumpversion) too old. GCC >= 4.6 required."
exit 1
fi
2015-12-19 02:35:13 +01:00
set +u
2015-12-18 22:53:27 +01:00
source "${QMCCHEM_PATH}"/qmcchemrc
2015-12-19 02:35:13 +01:00
set -u
2015-12-18 22:25:32 +01:00
cd Downloads
chmod +x opam_installer.sh
if [[ -d "${HOME}"/.opam ]]
then
set +e
set +u
source "${HOME}"/.opam/opam-init/init.sh
set -e
set -u
fi
echo N | ./opam_installer.sh "${QMCCHEM_PATH}"/bin/
if [[ ! -f "${QMCCHEM_PATH}"/bin/opam ]]
then
echo "Installation of OPAM failed"
exit 2
fi
"${QMCCHEM_PATH}"/bin/opam config setup -a --dot-profile "${QMCCHEM_PATH}"/qmcchemrc
touch "${QMCCHEM_PATH}"/bin/opam
set +u
export LD_LIBRARY_PATH="${QMCCHEM_PATH}/lib:${LD_LIBRARY_PATH}"
export LIBRARY_PATH="${QMCCHEM_PATH}/lib:${LIBRARY_PATH}"
export C_INCLUDE_PATH="${QMCCHEM_PATH}/lib:${C_INCLUDE_PATH}"
set -u
opam install ${PACKAGES}
2015-12-18 22:53:27 +01:00
rm "${QMCCHEM_PATH}"/install/_build/ocaml.log
2015-12-18 22:25:32 +01:00
exit 0