9
1
mirror of https://github.com/QuantumPackage/qp2.git synced 2024-06-17 10:05:18 +02:00

script to automatically add the omp irpf90 flags

This commit is contained in:
Yann Damour 2021-11-23 14:55:37 +01:00
parent 082b32b24f
commit adc94fcb29

View File

@ -0,0 +1,39 @@
#!/bin/bash
# Compiler
COMP=$1
# Path to file.cfg
config_PATH="../../config/"
END="*.cfg"
CONFIG="/config/"
#LIST=${config_PATH}${COMP}${END} # without ${QP_ROOT}
LIST=${QP_ROOT}${CONFIG}${COMP}${END}
if [ -z "$1" ]
then
echo "Give the compiler in argument"
else
# List of the config files for the compiler
#list_files=$(ls ../../config/$comp*.cfg) #does not give the right list
list_files=${LIST}
echo "Files that will be modified:"
echo $list_files
# Add the flags
for file in $list_files
do
echo $file
ACTUAL=$(grep "IRPF90_FLAGS : --openmp" $file)
FLAGS=$(./check_required_setup.sh $COMP)
SPACE=" "
BASE="IRPF90_FLAGS : --openmp"
NEW=${BASE}${SPACE}${FLAGS}
sed "s/${ACTUAL}/${NEW}/" $file
# -i # to change the files
done
fi