2015-12-18 22:25:32 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
set -u
|
2015-12-18 22:53:27 +01:00
|
|
|
QMCCHEM_PATH=$PWD
|
|
|
|
mkdir -p "${QMCCHEM_PATH}"/bin
|
|
|
|
cd "${QMCCHEM_PATH}"/install
|
2015-12-18 22:25:32 +01:00
|
|
|
mkdir -p Downloads _build
|
2015-12-18 22:53:27 +01:00
|
|
|
# TODO : Check if network is up (ping)
|
|
|
|
if [[ ! -x "${QMCCHEM_PATH}"/bin/ninja ]]
|
2015-12-18 22:25:32 +01:00
|
|
|
then
|
|
|
|
echo "Installing Ninja"
|
|
|
|
./scripts/install_ninja.sh &> _build/ninja.log
|
2015-12-18 22:53:27 +01:00
|
|
|
if [[ ! -x "${QMCCHEM_PATH}"/bin/ninja ]]
|
|
|
|
then
|
|
|
|
echo "Installation of Ninja failed"
|
|
|
|
exit 1
|
|
|
|
fi
|
2015-12-18 22:25:32 +01:00
|
|
|
touch _build/ninja.ok
|
|
|
|
fi
|
2015-12-29 00:48:17 +01:00
|
|
|
touch "${QMCCHEM_PATH}"/{src,ocaml}/.ls_md5
|
2015-12-29 01:25:01 +01:00
|
|
|
"${QMCCHEM_PATH}"/bin/ninja "$@"
|
|
|
|
|
|
|
|
cd "${QMCCHEM_PATH}"
|
2015-12-18 22:25:32 +01:00
|
|
|
|
2015-12-29 00:48:17 +01:00
|
|
|
if [[ ! -f make.config ]]
|
|
|
|
then
|
|
|
|
which ifort > /dev/null
|
|
|
|
if [[ $? ]]
|
|
|
|
then
|
|
|
|
cp make.config.ifort make.config
|
|
|
|
else
|
|
|
|
cp make.config.gfortran make.config
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "====================================================================="
|
|
|
|
echo "Configuration OK."
|
2015-12-29 01:25:01 +01:00
|
|
|
echo "Now, source the qmcchemrc file and build the program:"
|
2015-12-29 00:48:17 +01:00
|
|
|
echo ""
|
|
|
|
echo "source qmcchemrc"
|
2015-12-29 01:25:01 +01:00
|
|
|
echo "ninja"
|
2015-12-29 00:48:17 +01:00
|
|
|
echo ""
|
|
|
|
echo "====================================================================="
|
2015-12-18 22:25:32 +01:00
|
|
|
|