forked from cms-sw/cmsdist
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cascade.spec
49 lines (41 loc) · 1.67 KB
/
cascade.spec
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
### RPM external cascade 2.2.04
Source: http://cern.ch/service-spi/external/MCGenerators/distribution/%{n}/%{n}-%{realversion}-src.tgz
Patch0: cascade-2.2.0-nomanual
Patch1: cascade-2.2.04-getenv
# Drop dcasrn symbol, which we need to redifine in CMSSW. Do not build cascade
# executable, since it would use the wrong symbol in anycase.
Patch2: cascade-2.2.04-drop-dcasrn
Requires: lhapdf pythia6
%define keep_archives true
%prep
rm -rf %{n}
%setup -q -n %{n}/%{realversion}
%patch0 -p2
%patch1 -p2
%patch2 -p1
# Notice that cascade expects a flat pythia installation,
# where libraries and headers are all in the same place.
# Since the source code is not actually needed, we point
# it to the library location so that it links correctly.
PYTHIA="$PYTHIA6_ROOT"
LHAPDF="$LHAPDF_ROOT"
F77="$(which gfortran) -fPIC"
PLATF_CONFIG_OPTS="--enable-static --disable-shared"
LIBS="-lstdc++ -lz"
# Update to detect aarch64 and ppc64le
rm -f ./config.{sub,guess}
curl -L -k -s -o ./config.sub 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD'
curl -L -k -s -o ./config.guess 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD'
chmod +x ./config.{sub,guess}
./configure $PLATF_CONFIG_OPTS --with-pythia6=$PYTHIA --with-lhapdf=$LHAPDF --prefix=%i F77="$F77" LIBS="$LIBS"
%build
make %makeprocesses
%install
make install
# In case we build archive libraries we need to merge all of them, because
# otherwise that results some missing symbol due to a circular dependency among
# them which cannot be solved by reshuffling the various -l statements.
cd %{i}/lib
find . -name '*.a' -exec ar -x {} \;
ar rcs libcascade_merged.a *.o
rm -rf *.o