forked from alisw/alidist
-
Notifications
You must be signed in to change notification settings - Fork 0
/
crmc.sh
46 lines (44 loc) · 1.38 KB
/
crmc.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package: CRMC
version: "%(tag_basename)s-correctHepMC"
tag: v1.7.0
source: https://github.com/alisw/crmc.git
requires:
- boost
- HepMC
build_requires:
- CMake
---
#!/bin/bash -ex
case $ARCHITECTURE in
osx*)
# If we preferred system tools, we need to make sure we can pick them up.
[[ ! $BOOST_ROOT ]] && BOOST_ROOT=`brew --prefix boost`
LINKER_FLAGS="-Wl,-undefined dynamic_lookup"
;;
esac
cmake $SOURCEDIR \
${BOOST_ROOT:+-DBOOST_ROOT=$BOOST_ROOT} \
-DCMAKE_INSTALL_PREFIX=$INSTALLROOT -DCMAKE_Fortran_FLAGS="-std=legacy" \
${LINKER_FLAGS:+-DCMAKE_SHARED_LINKER_FLAGS="$LINKER_FLAGS"}
make ${JOBS+-j $JOBS} all
make install
# 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 ${BOOST_REVISION:+boost/$BOOST_VERSION-$BOOST_REVISION} HepMC/$HEPMC_VERSION-$HEPMC_REVISION
# Our environment
set CRMC_ROOT \$::env(BASEDIR)/$PKGNAME/\$version
setenv CRMC_ROOT \$CRMC_ROOT
prepend-path PATH \$CRMC_ROOT/bin
prepend-path LD_LIBRARY_PATH \$CRMC_ROOT/lib
EoF