Skip to content

Commit

Permalink
Add FLUKA support
Browse files Browse the repository at this point in the history
  • Loading branch information
ktf committed Sep 14, 2020
1 parent 691f6f9 commit 94455d6
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 24 deletions.
8 changes: 6 additions & 2 deletions defaults-o2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,16 @@ env:
ENABLE_VMC: "ON"
overrides:
AliRoot:
version: "%(commit_hash)s_O2"
version: "%(tag_basename)s_FLUKA"
tag: v5-09-55
requires:
- ROOT
- DPMJET
- fastjet:(?!.*ppc64)
- GEANT3
- GEANT4_VMC
- FLUKA
- FLUKA_VMC
- Vc
- ZeroMQ
- JAliEn-ROOT
Expand All @@ -25,7 +28,8 @@ overrides:
- lhapdf
- boost
AliPhysics:
version: "%(commit_hash)s_O2"
version: "%(tag_basename)s_FLUKA"
tag: v5-09-55-01
cgal:
version: "4.12.2"
fastjet:
Expand Down
41 changes: 19 additions & 22 deletions fluka.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,40 +4,37 @@ tag: "2011-3.0-vmc2"
source: https://gitlab.cern.ch/ALICEPrivateExternals/FLUKA.git
requires:
- "GCC-Toolchain:(?!osx)"
build_requires:
- alibuild-recipe-tools
env:
FLUPRO: "$FLUKA_ROOT/lib"
FC: "gfortran"
prepend_path:
PATH: "$FLUKA_ROOT/bin"
---
#!/bin/bash -e

export FLUPRO=$PWD
export FC=gfortran

rsync -a --exclude='**/.git' --delete --delete-excluded $SOURCEDIR/ "$INSTALLROOT"
cd "$INSTALLROOT"
make ${JOBS:+-j$JOBS}
rsync -a --exclude='**/.git' --delete --delete-excluded $SOURCEDIR/ "$BUILDDIR"

FVERSION=`gfortran --version | grep -i fortran | sed -e 's/.* //' | cut -d. -f1`
if [ $FVERSION -ge 10 ]; then
echo "Fortran version $FVERSION"
# Redefine FC to contain the compiler, -fallow-argument-mismatch and the additional FFLAGS from FLUKA/src/config.mk
make FC="gfortran -fallow-argument-mismatch -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-form -fbackslash -funderscoring -fd-lines-as-code -frecord-marker=4 -fbacktrace -frange-check -fbounds-check -fdump-core -ftrapping-math -ffpe-trap=invalid,zero,overflow" ${JOBS:+-j$JOBS}
else
make ${JOBS:+-j$JOBS}
fi

mkdir -p $INSTALLROOT
cp -rf $BUILDDIR/bin $BUILDDIR/lib $BUILDDIR/include $BUILDDIR/data $INSTALLROOT/

# Modulefile
MODULEDIR="$INSTALLROOT/etc/modulefiles"
MODULEFILE="$MODULEDIR/$PKGNAME"
mkdir -p "$MODULEDIR"
cat > "$MODULEFILE" <<EoF
#%Module1.0
proc ModulesHelp { } {
global version
puts stderr "ALICE Modulefile for $PKGNAME $PKGVERSION-@@PKGREVISION@$PKGHASH@@"
}
set version $PKGVERSION-@@PKGREVISION@$PKGHASH@@
module-whatis "ALICE Modulefile for $PKGNAME $PKGVERSION-@@PKGREVISION@$PKGHASH@@"
# Dependencies
module load BASE/1.0 ${GCC_TOOLCHAIN_ROOT:+GCC-Toolchain/$GCC_TOOLCHAIN_VERSION-$GCC_TOOLCHAIN_REVISION}
#ModuleFile
mkdir -p $INSTALLROOT/etc/modulefiles
alibuild-generate-module > $INSTALLROOT/etc/modulefiles/$PKGNAME
cat >> $INSTALLROOT/etc/modulefiles/$PKGNAME <<EoF
# Our environment
set FLUKA_ROOT \$::env(BASEDIR)/$PKGNAME/\$version
setenv FLUKA_ROOT \$FLUKA_ROOT
setenv FLUPRO \$::env(BASEDIR)/$PKGNAME/\$version/lib
setenv FC gfortran
prepend-path PATH \$FLUKA_ROOT
prepend-path PATH \$FLUKA_ROOT/bin
EoF

0 comments on commit 94455d6

Please sign in to comment.