This repository has been archived by the owner on Sep 26, 2019. It is now read-only.
forked from alisw/alidist
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpythia6.sh
59 lines (54 loc) · 1.58 KB
/
pythia6.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
47
48
49
50
51
52
53
54
55
56
57
58
package: pythia6
version: "426"
---
#!/bin/sh
curl -O -fSsL --insecure http://cern.ch/service-spi/external/MCGenerators/distribution/pythia6/pythia6-426-src.tgz
tar xzvf pythia6-426-src.tgz
cd pythia6/426
case $ARCHITECTURE in
slc5*)
PLATF_CONF_OPTS="--enable-shared"
PLATF_LDFLAGS=""
PLATF_LD=""
F77="`which gfortran`"
;;
osx*)
PLATF_CONF_OPTS="--disable-shared --enable-static"
PLATF_LDFLAGS=""
PLATF_LD="LD='`which gcc`'"
F77="`which gfortran` -fPIC"
;;
*)
PLATF_CONF_OPTS="--disable-shared --enable-static"
PLATF_LDFLAGS=""
PLATF_LD=""
F77="`which gfortran` -fPIC"
;;
esac
autoreconf -ivf
# Unfortunately we need the two cases because LDFLAGS= does not work on linux
# and I couldn't get the space between use_dylibs and -Wl, preseved if
# I tried to have the whole "LDFLAGS=foo" in a variable.
case $ARCHITECTURE in
osx*)
./configure $PLATF_CONF_OPTS --with-hepevt=4000 F77="$F77" \
LD='`which gcc`' LDFLAGS='-Wl,-commons,use_dylibs -Wl,-flat_namespace'
;;
*)
./configure $PLATF_CONF_OPTS --with-hepevt=4000 F77="$F77"
;;
esac
# NOTE: force usage of gcc to link shared libraries in place of gfortran since
# the latter causes a:
#
# ld: codegen problem, can't use rel32 to external symbol __gfortrani_compile_options in __gfortrani_init_compile_options
#
# error when building.
# I couldn't find any better way to replace "CC" in the F77 section of libtool.
case $ARCHITECTURE in
slc5*) ;;
*) perl -p -i -e 's|^CC=.*$|CC="gcc -fPIC"|' libtool ;;
esac
make
make install
tar -c lib include | tar -x -C $INSTALLROOT