#!/bin/sh # mac doesn't have readlink with -f option to canonicalize the path canonicalDirname() { cd $(dirname "$1") echo $(pwd -P) } DIR=$(dirname "${0}") if [ "${DIR}" = . ]; then DIR=$(pwd -P) fi DIR=$(canonicalDirname "${DIR}") #DIR=$(readlink -f "${DIR}/..") # Variables to be modified from the makefile during compilation COMPILER="gfortran" COMPVER="9" FFLAGS="-g -cpp -O3 -fd-lines-as-comments -Wall -Waggregate-return -Wcast-align -Wline-truncation -Wno-conversion -Wno-integer-division -Wno-tabs -Wno-unused-dummy-argument -Wno-unused-function -Wno-unused-parameter -Wno-unused-variable -Wsystem-headers -Wuninitialized -Wunused-label -mtune=generic -msse2 -mfpmath=sse -fPIC -fexpensive-optimizations -funroll-loops -fstrength-reduce -fno-automatic -finit-local-zero -ffixed-line-length-132 -fbackslash -funderscoring -frecord-marker=4 -falign-commons -fbacktrace -frange-check -fbounds-check -fdump-core -ftrapping-math -ffpe-trap=invalid,zero,overflow " CFLAGS="-g -O3 -DNDEBUG -Wpacked -malign-double -mpreferred-stack-boundary=8" LFLAGS="-fuse-ld=bfd" LIB="-lfluka -lstdc++ -lz" DPMLIB="-lDPMJET" RQMDLIB="-lrqmd" INTOBJS="idf2d.o zrdpcm.o idd2f.o glaubr.o evdini.o asciir.o eveout.o dpmjex.o eventd.o rqm2pr.o evqmdi.o rqmdex.o zrrqcm.o eveqmd.o" if [ "$1" = "" ]; then echo echo "syntax: fluka-config --path|--bin|--compiler|--compver|--include|--libpath|--intobjs|--lib|--dpmlib|--rqmdlib|--flags|--fflags|--cflags|--lflags|--data" echo echo "desc: echo on standard output the relative option to be used in a make file" echo echo "author: Vasilis.Vlachoudis@cern.ch" echo "date: 2019.06.01" exit 0 fi for ARG in $* do case $ARG in --path) echo "${DIR}" ;; --bin) echo "${DIR}/bin" ;; --compiler) echo ${COMPILER} ;; --compver) echo ${COMPVER} ;; --include) echo "-I${DIR}/include" ;; --libpath) echo "-L${DIR}/lib" ;; --intobjs) echo $INTOBJS | tr ' ' '\n' | sed -e "s|^|${DIR}/lib/interface/|" | tr '\n' ' ' ;; --lib) echo ${LIB} ;; --dpmlib) echo ${DPMLIB} ;; --rqmdlib) echo ${RQMDLIB} ;; --flags|--fflags) echo ${FFLAGS} ;; --cflags) echo ${CFLAGS} ;; --lflags) echo ${LFLAGS} ;; --data) echo "${DIR}/data" ;; esac done