diff --git a/data/Makefile b/data/Makefile index 1d796c07..dd6e5ea6 100644 --- a/data/Makefile +++ b/data/Makefile @@ -1,27 +1,6 @@ -WWW_SERVER = http://qmcchem.ups-tlse.fr/files/scemama -IRPF90_TGZ = irpf90-latest-noarch-src.tar.gz -EZFIO_TGZ = EZFIO.latest.tar.gz +all: inputs -.PHONY: doc src +FORCE: -default: src - -EZFIO: - $(info ===== Fetching EZFIO from the web =====) - @wget "$(WWW_SERVER)/$(EZFIO_TGZ)" || \ - (echo Unable to download EZFIO : $(WWW_SERVER)/$(EZFIO_TGZ) ; exit 1) - @tar -zxf $(EZFIO_TGZ) && rm $(EZFIO_TGZ) - -irpf90: - $(info ===== Fetching IRPF90 from the web =====) - @wget "$(WWW_SERVER)/$(IRPF90_TGZ)" || \ - (echo Unable to download IRPF90 : $(WWW_SERVER)/$(IRPF90_TGZ) ; exit 1) - @tar -zxf $(IRPF90_TGZ) && rm $(IRPF90_TGZ) - $(MAKE) -C irpf90 - -doc: - $(MAKE) -C doc - -src: irpf90 EZFIO - export QPACKAGE_ROOT=$$PWD ; \ - $(MAKE) -C src +inputs: FORCE + $(MAKE) -C inputs diff --git a/data/inputs/Makefile b/data/inputs/Makefile new file mode 100644 index 00000000..fd5e4e5a --- /dev/null +++ b/data/inputs/Makefile @@ -0,0 +1,6 @@ +all: $(wildcard *.ezfio) + +FORCE: + +%.ezfio: FORCE + archive_ezfio.sh $* diff --git a/data/inputs/Ne_dz.ezfio.md5 b/data/inputs/Ne_dz.ezfio.md5 new file mode 100644 index 00000000..093ac15a --- /dev/null +++ b/data/inputs/Ne_dz.ezfio.md5 @@ -0,0 +1,19 @@ +765e1f05dd3fbab8c7ebefaf2f1813e4 Ne_dz.ezfio/nuclei/nucl_num +3a99bcfcbfc32219791e6980c927b900 Ne_dz.ezfio/ao_basis/ao_coef.gz +54485b685f849c6f24a9c08a926daaf9 Ne_dz.ezfio/ao_basis/ao_expo.gz +2cf8c46d0cf91710e14856c92bcd0aae Ne_dz.ezfio/ao_basis/ao_nucl.gz +8d835c17bb93dc4b67ed4ec1d7197ffa Ne_dz.ezfio/ao_basis/ao_num +98cbb5f685decb369b99845fd6eb5b77 Ne_dz.ezfio/ao_basis/ao_power.gz +8fc6c40dd4f2fbdc0304f47431e028ae Ne_dz.ezfio/ao_basis/ao_prim_num.gz +d765d41448fe246fcc034b66e2768837 Ne_dz.ezfio/electrons/elec_alpha_num +d765d41448fe246fcc034b66e2768837 Ne_dz.ezfio/electrons/elec_beta_num +1ee880177e361ed2bd645106ee48c8cb Ne_dz.ezfio/ezfio/creation +70157eb5a25c5322e4ca22d63bff32cb Ne_dz.ezfio/ezfio/library +6c31c4e78cfa4e40197145e3e3f15e2c Ne_dz.ezfio/mo_basis/mo_coef.gz +cb9c18d6e379c6e854cdaed882d48e3e Ne_dz.ezfio/mo_basis/mo_energy.gz +c08fa3ff955fbcef6125c84821e1ac74 Ne_dz.ezfio/mo_basis/mo_occ.gz +d92fe2f613eefb751a11426863c90e49 Ne_dz.ezfio/mo_basis/mo_symmetry.gz +757c9248d7ddb2778d3df1b1ba938d15 Ne_dz.ezfio/mo_basis/mo_tot_num +223f155011993e8895a4ca2700ae19e3 Ne_dz.ezfio/nuclei/nucl_charge.gz +26eadd8aca5305d36e279234568f0925 Ne_dz.ezfio/nuclei/nucl_coord.gz +765e1f05dd3fbab8c7ebefaf2f1813e4 Ne_dz.ezfio/nuclei/nucl_num diff --git a/scripts/archive_ezfio.sh b/scripts/archive_ezfio.sh new file mode 100755 index 00000000..dfcf1537 --- /dev/null +++ b/scripts/archive_ezfio.sh @@ -0,0 +1,76 @@ +#!/bin/bash +# +# Computes the MD5 digest of an EZFIO file, and creates a tar. +# Thu Apr 3 16:55:50 CEST 2014 + +if [[ -z ${QPACKAGE_ROOT} ]] +then + print "The QPACKAGE_ROOT environment variable is not set." + print "Please reload the quantum_package.rc file." +fi + +function archive() +{ + FILE=$1 + MD5=$2 + ARCHIVE=${QPACKAGE_ROOT}/data/cache/$MD5 + if [[ -f $ARCHIVE ]] + then + if ! diff $FILE ${QPACKAGE_ROOT}/data/cache/$MD5 &> /dev/null + then + echo "Something went wrong. The file" + echo ${QPACKAGE_ROOT}/data/cache/$MD5 + echo "is different from $FILE" + echo "Aborting" + return 1 + fi + else + cp $FILE ${QPACKAGE_ROOT}/data/cache/$MD5 + fi +} + + + + +EZFIO_FILE=$(basename ${1}) + +if [[ -z ${EZFIO_FILE} ]] +then + echo "Usage: $(basename $0) " + exit 1 +fi + + +cd ${QPACKAGE_ROOT}/EZFIO/src +FILES=($(python << EOF | sort +from read_config import * +for group in groups: + if group == "ezfio": + continue + for d in groups[group]: + if d[2] == (): + suffix = "" + else: + suffix = ".gz" + print group+'/'+d[0]+suffix +print "ezfio/creation" +print "ezfio/library" +EOF +)) +cd $OLDPWD + +for FILE in ${FILES[@]} +do + FILE=${EZFIO_FILE}/${FILE} + MD5=$(md5sum ${FILE} 2>/dev/null | cut -d ' ' -f 1) + if [[ ! -z $MD5 ]] + then + if ! archive $FILE $MD5 + then + rm ${EZFIO_FILE}.md5 + exit 1 + fi + echo $MD5 $FILE >> ${EZFIO_FILE}.md5 + fi +done +