10
1
mirror of https://gitlab.com/scemama/qmcchem.git synced 2024-11-15 02:23:38 +01:00
qmcchem/scripts/compile_irpf90.sh

50 lines
1.1 KiB
Bash
Raw Normal View History

2015-12-20 01:09:14 +01:00
#!/bin/bash
if [[ -z ${QMCCHEM_PATH} ]]
then
echo "Error: qmcchemrc not loaded"
exit -1
fi
cd ${QMCCHEM_PATH}/src
LSMD5_FILE=${QMCCHEM_PATH}/src/.ls_md5
FILES="*.f *.f90 *.F *.py */*.f */*.f90 */*.F */*.py"
MD5=$(ls -ltr --full-time ${FILES} 2>/dev/null | md5sum | cut -d ' ' -f 1)
REF=0
if [[ -f ${LSMD5_FILE} ]]
then
REF=$(cat ${LSMD5_FILE})
fi
if [[ ${MD5} != ${REF} ]]
then
echo ${MD5} > ${LSMD5_FILE}
echo Running IRPF90
source ${QMCCHEM_PATH}/make.config
2019-07-01 13:11:46 +02:00
LIB="${LIB} ${QMCCHEM_PATH}/lib/libezfio_irp.a ${QMCCHEM_PATH}/lib/libf77zmq.a ${QMCCHEM_PATH}/lib/libzmq.a -lstdc++ -lrt -lz"
2015-12-20 01:09:14 +01:00
SRC="${SRC} ZMQ/f77_zmq_module.f90"
OBJ="${OBJ} IRPF90_temp/ZMQ/f77_zmq_module.o"
2015-12-20 01:21:51 +01:00
INCLUDES="${INCLUDES} -I AO -I SAMPLING -I TOOLS -I JASTROW -I MAIN -I PROPERTIES -I ZMQ"
2015-12-20 01:09:14 +01:00
IRPF90_FLAGS="${IRPF90_FLAGS} --ninja"
# Check IRPF90 version
2018-07-09 14:40:45 +02:00
if [[ $( ${IRPF90} -v | python2 -c "import sys ; print float(sys.stdin.read().rsplit('.',1)[0]) >= 1.6") == False ]]
2015-12-20 01:09:14 +01:00
then
echo "IRPF90 version >= 1.6 required"
exit -1
fi
export IRPF90 IRPF90_FLAGS INCLUDES LIB SRC OBJ
exec ${IRPF90} ${IRPF90_FLAGS} ${INCLUDES} || exit -1
fi