10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-12-23 12:56:14 +01:00
quantum_package/scripts/create_tests_Makefile.sh

52 lines
1.1 KiB
Bash
Raw Normal View History

2014-04-07 16:56:29 +02:00
#!/bin/bash
2014-04-07 17:36:19 +02:00
#
2014-04-07 16:56:29 +02:00
# usage:
2014-04-07 17:36:19 +02:00
# create_tests_Makefile.sh
2014-04-07 16:56:29 +02:00
# Creates the Makefile of the tests directory. This command is supposed to be
# run in a tests directory.
# Mon Apr 7 11:50:30 CEST 2014
2014-04-07 17:36:19 +02:00
if [[ $(basename $PWD) != "tests" ]]
2014-04-07 16:56:29 +02:00
then
2014-04-07 17:36:19 +02:00
echo "Error: This script should be run in the tests directory."
2014-04-07 16:56:29 +02:00
exit 1
fi
cat << EOF > Makefile
OPENMP =1
PROFILE =0
DEBUG = 0
IRPF90+= -I tests
2014-04-07 17:36:19 +02:00
REF_FILES=\$(subst %.irp.f, %.ref, \$(wildcard *.irp.f))
2014-04-07 16:56:29 +02:00
.PHONY: clean executables serial_tests parallel_tests
all: clean executables serial_tests parallel_tests
2014-04-07 17:36:19 +02:00
parallel_tests: \$(REF_FILES)
2014-04-07 16:56:29 +02:00
@echo ; echo " ---- Running parallel tests ----" ; echo
2014-04-07 17:36:19 +02:00
@OMP_NUM_THREADS=10 \${QPACKAGE_ROOT}/scripts/run_tests.py
2014-04-07 16:56:29 +02:00
2014-04-07 17:36:19 +02:00
serial_tests: \$(REF_FILES)
2014-04-07 16:56:29 +02:00
@echo ; echo " ---- Running serial tests ----" ; echo
2014-04-07 17:36:19 +02:00
@OMP_NUM_THREADS=1 \${QPACKAGE_ROOT}/scripts/run_tests.py
2014-04-07 16:56:29 +02:00
2014-04-07 17:36:19 +02:00
executables: \$(wildcard *.irp.f) veryclean
\$(MAKE) -C ..
2014-04-07 16:56:29 +02:00
2014-04-07 17:36:19 +02:00
%.ref: \$(wildcard \$(QPACKAGE_ROOT)/data/inputs/*.md5) executables
\$(QPACKAGE_ROOT)/scripts/create_test_ref.sh \$*
2014-04-07 16:56:29 +02:00
clean:
2014-04-07 17:36:19 +02:00
\$(MAKE) -C .. clean
veryclean:
\$(MAKE) -C .. veryclean
2014-04-07 16:56:29 +02:00
EOF