Skip to content

Commit

Permalink
adding installer script (experimental)
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardofrantz committed Dec 14, 2023
1 parent 8ad7b77 commit 5dcb1d9
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/bin/bash

FC="mpif90"
FFLAGS=""

if command -v mpiifort >/dev/null 2>&1; then
echo "Compiler found: $(mpiifort -v)"
FC="mpiifort"
FFLAGS+=" -O3 -no-prec-div -fp-model fast=2 -xHost -g -traceback"
if command -v mpiifx >/dev/null 2>&1; then
echo "Using LLVM version of Intel compiler..."
FC="mpiifx"
FFLAGS+=" -qmkl"
else
echo "LLVM not found, using classic."
FFLAGS+=" -ipo -qmkl"
fi
else
echo "Compiler found: $(mpif90 --version | head -n1)"
FFLAGS+=" -O3 -march=native -funroll-loops -ffast-math -g -fbacktrace"
fi
#FFLAGS+=" -fanalyser" # Enable the Clang Static Analyzer for code analysis
# export FFLAGS
# export FC

echo "Compiler: $FC"
echo "Flags: $FFLAGS"

if ! command -v fpm &> /dev/null
then
echo "fpm could not be found"
exit
fi

fpm clean
#fpm test --verbose --compiler "$FC" --flag "$FFLAGS" || { echo 'fpm test failed' ; exit 1; }
fpm install --verbose --compiler="$FC" --flag="$FFLAGS" || { echo 'fpm install failed' ; exit 1; }


# fpm test --compiler 'mpif90' --flag "-O3 -march=native -funroll-loops -ffast-math -g -fbacktrace"
# fpm test --compiler 'mpiifort' --flag "-O3 -no-prec-div -fp-model fast=2 -xHost -g -traceback -ipo -mkl"
# fpm test --compiler 'mpiifx' --flag " -O3 -no-prec-div -fp-model fast=2 -xHost -g -traceback -qmkl"

0 comments on commit 5dcb1d9

Please sign in to comment.