mirror of
https://github.com/LCPQ/quantum_package
synced 2024-09-16 17:35:42 +02:00
50 lines
1.1 KiB
Bash
50 lines
1.1 KiB
Bash
|
#!/bin/bash
|
||
|
#
|
||
|
# usage:
|
||
|
# create_tests_Makefile.sh
|
||
|
# 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
|
||
|
|
||
|
MODULE=$(basename $PWD)
|
||
|
|
||
|
if [[ $MODULE == "tests" ]]
|
||
|
then
|
||
|
echo "Error: This script should not be run in the tests directory."
|
||
|
exit 1
|
||
|
fi
|
||
|
|
||
|
cat << EOF > Makefile
|
||
|
OPENMP =1
|
||
|
PROFILE =0
|
||
|
DEBUG = 0
|
||
|
|
||
|
IRPF90+= -I tests
|
||
|
|
||
|
REF_FILES=$(subst %.irp.f, %.ref, $(wildcard *.irp.f))
|
||
|
|
||
|
.PHONY: clean executables serial_tests parallel_tests
|
||
|
|
||
|
all: clean executables serial_tests parallel_tests
|
||
|
|
||
|
parallel_tests: $(REF_FILES)
|
||
|
@echo ; echo " ---- Running parallel tests ----" ; echo
|
||
|
@OMP_NUM_THREADS=10 ${QPACKAGE_ROOT}/scripts/run_tests.py
|
||
|
|
||
|
serial_tests: $(REF_FILES)
|
||
|
@echo ; echo " ---- Running serial tests ----" ; echo
|
||
|
@OMP_NUM_THREADS=1 ${QPACKAGE_ROOT}/scripts/run_tests.py
|
||
|
|
||
|
executables: $(wildcard *.irp.f)
|
||
|
$(MAKE) -C ..
|
||
|
|
||
|
%.ref: $(wildcard $(QPACKAGE_ROOT)/data/inputs/*.md5) executables
|
||
|
$(QPACKAGE_ROOT)/scripts/create_test_ref.sh $*
|
||
|
|
||
|
clean:
|
||
|
$(MAKE) -C .. clean
|
||
|
|
||
|
EOF
|
||
|
|
||
|
|