mirror of
https://gitlab.com/scemama/qmcchem.git
synced 2024-12-10 06:23:30 +01:00
Improved install scripts
This commit is contained in:
parent
eecf75171e
commit
81b9c05e77
17
configure.sh
17
configure.sh
@ -2,16 +2,23 @@
|
||||
|
||||
set -e
|
||||
set -u
|
||||
cd install
|
||||
QMCCHEM_PATH=$PWD
|
||||
mkdir -p "${QMCCHEM_PATH}"/bin
|
||||
cd "${QMCCHEM_PATH}"/install
|
||||
mkdir -p Downloads _build
|
||||
mkdir -p bin
|
||||
if [[ ! -x ../bin/ninja ]]
|
||||
# TODO : Check if network is up (ping)
|
||||
if [[ ! -x "${QMCCHEM_PATH}"/bin/ninja ]]
|
||||
then
|
||||
echo "Installing Ninja"
|
||||
./scripts/install_ninja.sh &> _build/ninja.log
|
||||
if [[ ! -x "${QMCCHEM_PATH}"/bin/ninja ]]
|
||||
then
|
||||
echo "Installation of Ninja failed"
|
||||
exit 1
|
||||
fi
|
||||
touch _build/ninja.ok
|
||||
fi
|
||||
touch ../{src,ocaml}/ls_md5
|
||||
exec ../bin/ninja "$@"
|
||||
touch "${QMCCHEM_PATH}"/{src,ocaml}/ls_md5
|
||||
exec "${QMCCHEM_PATH}"/bin/ninja "$@"
|
||||
|
||||
|
||||
|
@ -4,11 +4,9 @@ TARGET=ezfio
|
||||
|
||||
function _install()
|
||||
{
|
||||
cd .. ; QMCCHEM_PATH="$PWD" ; cd -
|
||||
set -e
|
||||
set -u
|
||||
cd ..
|
||||
QMCCHEM_PATH="$PWD"
|
||||
cd -
|
||||
rm -rf "${QMCCHEM_PATH}"/EZFIO
|
||||
cd "${BUILD}"/config
|
||||
rm -f -- qmc.config properties.config
|
||||
|
@ -3,16 +3,17 @@
|
||||
TARGET=f77_zmq
|
||||
function _install()
|
||||
{
|
||||
cd .. ; QMCCHEM_PATH="$PWD" ; cd -
|
||||
set +u
|
||||
export C_INCLUDE_PATH=$C_INCLUDE_PATH:../../../lib
|
||||
export C_INCLUDE_PATH="${C_INCLUDE_PATH}":../../../lib
|
||||
set -e
|
||||
set -u
|
||||
cd "${BUILD}"
|
||||
export ZMQ_H=../../../lib/zmq.h
|
||||
export ZMQ_H="${QMCCHEM_PATH}"/lib/zmq.h
|
||||
cp "${ZMQ_H}" .
|
||||
make -j
|
||||
make -j 8
|
||||
cd -
|
||||
rm -f -- "../src/ZMQ/f77_zmq.h" "../lib/libf77zmq.a" "../lib/libf77zmq.so"
|
||||
rm -f -- "${QMCCHEM_PATH}"/src/ZMQ/f77_zmq.h "${QMCCHEM_PATH}"/lib/libf77zmq.a "${QMCCHEM_PATH}"/lib/libf77zmq.so
|
||||
cp "${BUILD}"/libf77zmq.{a,so} ../lib/
|
||||
cp "${BUILD}"/f77_zmq.h ../src/ZMQ/
|
||||
return 0
|
||||
|
@ -3,22 +3,23 @@
|
||||
TARGET=irpf90
|
||||
function _install()
|
||||
{
|
||||
cd .. ; QMCCHEM_PATH="$PWD" ; cd -
|
||||
set -e
|
||||
set -u
|
||||
make -C "${BUILD}" -j
|
||||
rm -rf -- ../irpf90
|
||||
mv "${BUILD}" ../
|
||||
make -C "${BUILD}" -j 8
|
||||
rm -rf -- "${QMCCHEM_PATH}"/irpf90
|
||||
mv "${BUILD}" "${QMCCHEM_PATH}"
|
||||
# Check the build is OK
|
||||
[[ -x ../irpf90/bin/irpf90 ]]
|
||||
[[ -x ../irpf90/bin/irpman ]]
|
||||
[[ -x "${QMCCHEM_PATH}"/irpf90/bin/irpf90 ]]
|
||||
[[ -x "${QMCCHEM_PATH}"/irpf90/bin/irpman ]]
|
||||
for i in irpf90 irpman
|
||||
do
|
||||
rm -rf -- ../bin/$i
|
||||
rm -rf -- "${QMCCHEM_PATH}"/bin/$i
|
||||
cat << EOF > ../bin/$i
|
||||
#!/bin/bash -u
|
||||
exec "\${QMCCHEM_PATH}"/irpf90/bin/$i "\$@"
|
||||
EOF
|
||||
chmod +x ../bin/$i
|
||||
chmod +x "${QMCCHEM_PATH}"/bin/$i
|
||||
done
|
||||
return 0
|
||||
}
|
||||
|
@ -8,12 +8,13 @@ URL="http://github.com/martine/ninja/archive/v1.5.3.tar.gz"
|
||||
|
||||
function _install()
|
||||
{
|
||||
cd .. ; QMCCHEM_PATH="$PWD" ; cd -
|
||||
set -e
|
||||
set -u
|
||||
cd "${BUILD}"
|
||||
./configure.py --bootstrap
|
||||
cd -
|
||||
mv "${BUILD}/ninja" ../bin/
|
||||
mv "${BUILD}/ninja" "${QMCCHEM_PATH}"/bin/
|
||||
return 0
|
||||
}
|
||||
|
||||
|
@ -3,6 +3,7 @@
|
||||
set -u
|
||||
set -e
|
||||
|
||||
cd .. ; QMCCHEM_PATH="$PWD" ; cd -
|
||||
PACKAGES="core cryptokit ocamlfind sexplib"
|
||||
|
||||
declare -i i
|
||||
@ -13,7 +14,7 @@ then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
source ../qmcchemrc
|
||||
source "${QMCCHEM_PATH}"/qmcchemrc
|
||||
cd Downloads
|
||||
chmod +x opam_installer.sh
|
||||
|
||||
@ -41,7 +42,7 @@ export LIBRARY_PATH="${QMCCHEM_PATH}/lib:${LIBRARY_PATH}"
|
||||
export C_INCLUDE_PATH="${QMCCHEM_PATH}/lib:${C_INCLUDE_PATH}"
|
||||
set -u
|
||||
opam install ${PACKAGES}
|
||||
rm ../_build/ocaml.log
|
||||
rm "${QMCCHEM_PATH}"/install/_build/ocaml.log
|
||||
exit 0
|
||||
|
||||
|
||||
|
@ -1,18 +1,33 @@
|
||||
#!/bin/bash -x
|
||||
|
||||
cd .. ; QMCCHEM_PATH="$PWD" ; cd -
|
||||
set -e
|
||||
set -u
|
||||
|
||||
|
||||
# Check GCC version
|
||||
declare -i i
|
||||
i=$(gcc -dumpversion | cut -d '.' -f 2)
|
||||
if [[ i -lt 6 ]]
|
||||
i=$(gcc -dumpversion | cut -d '.' -f 1)
|
||||
if [[ i -lt 4 ]]
|
||||
then
|
||||
echo "GCC version $(gcc -dumpversion) too old. GCC >= 4.6 required."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ i -eq 4 ]]
|
||||
then
|
||||
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
|
||||
fi
|
||||
# End check GCC version
|
||||
|
||||
|
||||
set +u
|
||||
source ../qmcchemrc
|
||||
source "${QMCCHEM_PATH}"/qmcchemrc
|
||||
set -u
|
||||
opam install zmq
|
||||
rm -f _build/ocaml_zmq.log
|
||||
|
@ -11,7 +11,7 @@ export QMCCHEM_MPIRUN="mpirun"
|
||||
export QMCCHEM_MPIRUN_FLAGS="--bind-to-core"
|
||||
#export QMCCHEM_NIC=ib0
|
||||
source \${QMCCHEM_PATH}/irpf90/bin/irpman
|
||||
source \${QMCCHEM_PATH}/EZFIO/Bash/ezfio.sh
|
||||
#source \${QMCCHEM_PATH}/EZFIO/Bash/ezfio.sh
|
||||
EOF
|
||||
|
||||
cd -
|
||||
|
@ -4,6 +4,7 @@ TARGET=zmq
|
||||
function _install()
|
||||
{
|
||||
LIBVERSION=4
|
||||
cd .. ; QMCCHEM_PATH="$PWD" ; cd -
|
||||
set +u
|
||||
export C_INCLUDE_PATH="${C_INCLUDE_PATH}":./
|
||||
set -e
|
||||
@ -12,13 +13,13 @@ function _install()
|
||||
./configure --without-libsodium
|
||||
make -j 8
|
||||
cd -
|
||||
rm -f -- ../lib/libzmq.a ../lib/libzmq.so ../lib/libzmq.so.$LIBVERSION
|
||||
# cp "${BUILD}"/.libs/libzmq.a ../lib/
|
||||
# cp "${BUILD}"/.libs/libzmq.so ../lib/libzmq.so.$LIBVERSION
|
||||
cp "${BUILD}"/src/.libs/libzmq.a ../lib/
|
||||
cp "${BUILD}"/src/.libs/libzmq.so ../lib/libzmq.so.$LIBVERSION
|
||||
cp "${BUILD}"/include/{zmq,zmq_utils}.h ../lib/
|
||||
cd ../lib
|
||||
rm -f -- "${QMCCHEM_PATH}"/lib/libzmq.{a,so,so.$LIBVERSION}
|
||||
# cp "${BUILD}"/.libs/libzmq.a "${QMCCHEM_PATH}"/lib/
|
||||
# cp "${BUILD}"/.libs/libzmq.so "${QMCCHEM_PATH}"/lib/libzmq.so.$LIBVERSION
|
||||
cp "${BUILD}"/src/.libs/libzmq.a "${QMCCHEM_PATH}"/lib/
|
||||
cp "${BUILD}"/src/.libs/libzmq.so "${QMCCHEM_PATH}"/lib/libzmq.so.$LIBVERSION
|
||||
cp "${BUILD}"/include/{zmq,zmq_utils}.h "${QMCCHEM_PATH}"/lib/
|
||||
cd "${QMCCHEM_PATH}"/lib
|
||||
ln libzmq.so.$LIBVERSION libzmq.so || cp libzmq.so.$LIBVERSION libzmq.so
|
||||
cd -
|
||||
return 0
|
||||
|
Loading…
Reference in New Issue
Block a user