Skip to content
Snippets Groups Projects
Commit 123dab57 authored by RIETTE Sébastien's avatar RIETTE Sébastien
Browse files

S. Riette 22/06/2022 fcm configuration built from gmkfile

Possibility added to build a fcm configuration file from a gmkpack file

Inclusion of configuration file for belenos/taranis and CTI computers
parent 6236b079
No related branches found
No related tags found
No related merge requests found
module load perl/5.30.3
# Compilation
$FCOMPILER = /home/gmap/mrpm/khatib/public/bin/mimpifc-18.0.5.274
$BASE_FFLAGS = -c -convert big_endian -assume byterecl -align array64byte,all -traceback -fpic -qopenmp -qopenmp-threadprivate compat -fp-model source -qopt-report=5 -qopt-report-phase=vec -ftz -diag-disable=remark,cpu-dispatch -r8
$PROD_FFLAGS = -g -O2 -march=core-avx2 -finline-functions -finline-limit=500 -Winline -qopt-prefetch=4 -fast-transcendentals -fimf-use-svml -no-fma
$DEV_FFLAGS = -g -O0
$DEBUG_FFLAGS = -g -O0 -check bounds -init=arrays,snan -fp-stack-check -ftrapuv -fpe0 -fp-speculation=strict -check uninit -check pointers
$CCOMPILER = /home/gmap/mrpm/khatib/public/bin/mimpicc-18.0.5.274
$BASE_CFLAGS = -c -qopenmp -qopt-report=2 -qopt-report-phase=vec -fpic -malign-double -ftz -fp-model precise -diag-disable=remark,cpu-dispatch
$PROD_CFLAGS = -g -O2 -march=core-avx2
$DEV_CFLAGS =
$DEBUG_CFLAGS =
$OMP_FFLAGS =
# Preprocessor
$FPP_FLAGS = LINUX LITTLE_ENDIAN LITTLE ADDRESS64 GRIB_API_1 REPRO48
$CPP_FLAGS = LINUX LITTLE_ENDIAN LITTLE GRIB_API_1
# Linker
$LINK = /home/gmap/mrpm/khatib/public/bin/mimpifc-18.0.5.274
$BASE_LD = -v -fp-stack-check -qopenmp -qopenmp-threadprivate compat -shared-intel -lrt -lstdc++
$OMP_LD =
$LD_EXE_TO_SHARED = -shared
# Other
$AR = /usr/bin/ar
# Compilation
$FCOMPILER = mpigfortran.9.2.0
$BASE_FFLAGS = -c -fconvert=swap -fno-second-underscore -fbacktrace -m64 -fopenmp -ffree-line-length-none -fno-sign-zero -fpic -fno-range-check -g -pipe -fdefault-real-8
$PROD_FFLAGS = -g -O2
$DEV_FFLAGS = -g -O0
$DEBUG_FFLAGS = -g -O0 -fbounds-check -finit-real=snan -ffpe-trap=invalid,zero,overflow
$CCOMPILER = mpigcc.9.2.0
$BASE_CFLAGS = -c -m64 -fopenmp -fpic -g -pipe
$PROD_CFLAGS = -g -O2
$DEV_CFLAGS =
$DEBUG_CFLAGS =
$OMP_FFLAGS =
# Preprocessor
$FPP_FLAGS = LINUX LITTLE_ENDIAN LITTLE REPRO48
$CPP_FLAGS = LINUX LITTLE_ENDIAN LITTLE
# Linker
$LINK = mpigfortran.9.2.0
$BASE_LD = -fopenmp -ffast-math -ldl -lrt
$OMP_LD =
$LD_EXE_TO_SHARED = -shared
# Other
$AR = ar
......@@ -12,7 +12,7 @@ $DEBUG_CFLAGS = -check bounds
$OMP_FFLAGS =
# Preprocessor
$FPP_FLAGS = LINUX
$FPP_FLAGS = LINUX REPRO48
$CPP_FLAGS = LINUX
# Linker
......
......@@ -47,7 +47,7 @@ build.prop{fc.flags-ld} = $LD_FLAGS $LD_EXE_TO_SHARED
# 3.2.b dependencies (internal and external)
$util = util1 util2 util3 util4 util5 util6 util7 util8 util9 util10 util11 util12 util13 util14 util15 util16
$mpi = mpi2 mpi3 mpi4 mpi5 mpi6 mpi7 mpi8 mpi9 mpi10 mpi11 mpi12 mpi13 mpi14 mpi15 mpi16 mpi17 mpi18 mpi19
$system = system1 system2 system3 system4 system5 system6 system7 system8 system10 system11 system12 system13
$system = system1 system2 system3 system4 system5 system6 system7 system8 system10 system11 system12 system13 system14
build.prop{ns-dep.o} = common parkind drhook $util $mpi oml mpl gstats1 $system
build.prop{fc.libs} = $LIBS
......@@ -147,5 +147,6 @@ build.source[system11] = $FIAT/fiat/system/internal/linuxtrbk.c
build.source[util17] = $FIAT/fiat/util/internal/raise.h
build.source[system12] = $FIAT/fiat/system/getstatm.c
build.source[system13] = $FIAT/fiat/system/internal/linux_bind.c
build.source[system14] = $FIAT/fiat/system/internal/gentrbk.F90
#ifcore module is external to fiat (intel)
build.prop{no-dep.f.module}[system14] = ifcore
......@@ -3,24 +3,24 @@
fcm_version=tags/2021.05.0
fiat_version=1295120464c3905e5edcbb887e4921686653eab8
function parse_args()
{
# default values
ARCH_PATH=$PWD/arch
ARCH=gnu
# pass unrecognized arguments to fcm
FCM_ARGS=""
while (($# > 0))
do
OPTION="$1" ; shift
case "$OPTION" in
"-h") cat <<EOF
function parse_args() {
# default values
ARCH_PATH=$PWD/arch
ARCH=
GMKFILE=
# pass unrecognized arguments to fcm
FCM_ARGS=""
while (($# > 0)); do
OPTION="$1" ; shift
case "$OPTION" in
"-h") cat <<EOF
Usage :
$0 [options]
--help -h help
--arch-path ARCH_PATH directory for architecture specific files (see below) [./arch]
--arch ARCH build using arch files $ARCH_PATH/arch-ARCH.* [gnu]
--gmkfile FILE build using a gmkpack configuration file (--arch must be used to give a name to the build dir)
Unrecognized options are passed to the fcm build command. Useful options include :
--new clean build tree before building
......@@ -31,20 +31,25 @@ For details on FCM, see
http://metomi.github.io/fcm/doc/user_guide/build.html
http://metomi.github.io/fcm/doc/user_guide/command_ref.html#fcm-build
EOF
exit;;
"--arch")
ARCH=$1 ; shift ;;
"--arch-path")
ARCH_PATH=$1 ; shift ;;
*)
FCM_ARGS="$FCM_ARGS $OPTION"
;;
esac
done
exit;;
"--arch")
ARCH=$1 ; shift ;;
"--arch-path")
ARCH_PATH=$1 ; shift ;;
"--gmkfile")
GMKFILE=$1 ; shift ;;
*)
FCM_ARGS="$FCM_ARGS $OPTION" ;;
esac
done
[ "$GMKFILE" == "" -a "$ARCH" == "" ] && ARCH=gnu
if [ "$GMKFILE" != "" -a "$ARCH" == "" ]; then
echo "--arch option is mandatory if --gmkfile option is used"
exit 2
fi
}
function check_install_fcm()
{
function check_install_fcm() {
if [ ! -f fcm/bin/fcm ]; then
echo "Performing FCM installation..."
cd fcm
......@@ -57,8 +62,7 @@ function check_install_fcm()
fi
}
function check_install_fiat()
{
function check_install_fiat() {
if [ ! -d fiat/src ]; then
echo "Performing fiat cloning..."
cd fiat
......@@ -72,8 +76,39 @@ function check_install_fiat()
echo
}
function build_compilation_script()
{
function gmkfile2arch() {
GMKFILE=$1
ARCHFILE=$2
cat <<EOF > $ARCHFILE
# Compilation
\$FCOMPILER = $(grep "^FRTNAME =" $GMKFILE | cut -d = -f 2)
\$BASE_FFLAGS = $(grep "^FRTFLAGS =" $GMKFILE | cut -d = -f 2-) $(grep "^GMK_FCFLAGS_PHYEX =" $GMKFILE | cut -d = -f 2-)
\$PROD_FFLAGS = $(grep "^OPT_FRTFLAGS =" $GMKFILE | cut -d = -f 2-)
\$DEV_FFLAGS = $(grep "^DBG_FRTFLAGS =" $GMKFILE | cut -d = -f 2-)
\$DEBUG_FFLAGS = $(grep "^DBG_FRTFLAGS =" $GMKFILE | cut -d = -f 2-) $(grep "^BCD_FRTFLAGS =" $GMKFILE | cut -d = -f 2-) $(grep "^NAN_FRTFLAGS =" $GMKFILE | cut -d = -f 2-)
\$CCOMPILER = $(grep "^VCCNAME =" $GMKFILE | cut -d = -f 2)
\$BASE_CFLAGS = $(grep "^VCCFLAGS =" $GMKFILE | cut -d = -f 2-)
\$PROD_CFLAGS = $(grep "^OPT_VCCFLAGS =" $GMKFILE | cut -d = -f 2-)
\$DEV_CFLAGS =
\$DEBUG_CFLAGS =
\$OMP_FFLAGS =
# Preprocessor
\$FPP_FLAGS = $(grep "^MACROS_FRT =" $GMKFILE | cut -d = -f 2- | sed 's/-D//g')
\$CPP_FLAGS = $(grep "^MACROS_CC =" $GMKFILE | cut -d = -f 2- | sed 's/-D//g')
# Linker
\$LINK = $(grep "^LNK_MPI =" $GMKFILE | cut -d = -f 2-)
\$BASE_LD = $(grep "^LNK_FLAGS =" $GMKFILE | cut -d = -f 2-)
\$OMP_LD =
\$LD_EXE_TO_SHARED = $(grep "^LNK_SOLIB =" $GMKFILE | cut -d = -f 2- | sed 's/-o a.out//')
# Other
\$AR = $(grep "^AR =" $GMKFILE | cut -d = -f 2-)
EOF
}
function build_compilation_script() {
cat <<EOF > compilation.sh
#!/bin/bash
......@@ -135,8 +170,13 @@ if [ -d $builddir ]; then
exit 1
fi
mkdir $builddir
cp ${ARCH_PATH}/arch-${ARCH}.env $builddir/arch.env
cp ${ARCH_PATH}/arch-${ARCH}.fcm $builddir/arch.fcm
if [ "$GMKFILE" != "" ]; then
touch $builddir/arch.env
gmkfile2arch $GMKFILE $builddir/arch.fcm
else
cp ${ARCH_PATH}/arch-${ARCH}.env $builddir/arch.env
cp ${ARCH_PATH}/arch-${ARCH}.fcm $builddir/arch.fcm
fi
cp fcm-make.cfg $builddir
cd $builddir
mkdir src
......@@ -157,3 +197,5 @@ ln -s build/bin/libphyex.so .
# Check if python can open the resulting shared lib
python3 -c "from ctypes import cdll; cdll.LoadLibrary('./libphyex.so')"
# ldd -r ./libphyex.so should also give interesting results
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment