source: HiSusy/trunk/Pythia8/pythia8170/examples/Makefile @ 1

Last change on this file since 1 was 1, checked in by zerwas, 11 years ago

first import of structure, PYTHIA8 and DELPHES

File size: 5.5 KB
Line 
1#
2# Examples Makefile.
3#
4#                  M. Kirsanov 07.04.2006
5#                     Modified 18.11.2006
6#                     26.03.2008 CLHEP dependency removed
7
8SHELL = /bin/sh
9
10-include config.mk
11ifeq (x$(PYTHIA8LOCATION),x)
12 PYTHIA8LOCATION=..
13endif
14-include $(PYTHIA8LOCATION)/config.mk
15
16# Location of directories.
17TOPDIR=$(shell \pwd)
18INCDIR=include
19SRCDIR=src
20LIBDIR=lib
21LIBDIRARCH=lib/archive
22BINDIR=bin
23
24# Libraries to include if GZIP support is enabled
25ifeq (x$(ENABLEGZIP),xyes)
26LIBGZIP=-L$(BOOSTLIBLOCATION) -lboost_iostreams -L$(ZLIBLOCATION) -lz
27endif
28
29# There is no default behaviour, so remind user.
30all:
31        @echo "Usage: for NN = example number: make mainNN"
32
33# Create an executable for one of the normal test programs
34main00  main01 main02 main03 main04 main05 main06 main07 main08 main09 main10 \
35        main11 main12 main13 main14 main15 main16 main17 main18 main19 main20 \
36        main21 main22 main23 main24 main25 main26 main27 main28 main29 main30 \
37        main31 main32 main33 main34 main35 main36 main37 main38 main39 main40: \
38        $(PYTHIA8LOCATION)/$(LIBDIRARCH)/libpythia8.a
39        @mkdir -p $(BINDIR)
40        $(CXX) $(CXXFLAGS) -I$(PYTHIA8LOCATION)/$(INCDIR) $@.cc -o $(BINDIR)/$@.exe \
41        -L$(PYTHIA8LOCATION)/$(LIBDIRARCH) -lpythia8 -llhapdfdummy $(LIBGZIP)
42        @ln -fs $(BINDIR)/$@.exe $@.exe
43
44# Create an executable linked to HepMC (if all goes well).
45# Owing to excessive warning output -Wshadow is not used for HepMC.
46ifneq (x$(HEPMCLOCATION),x)
47  main41 main42: \
48        $(PYTHIA8LOCATION)/$(LIBDIRARCH)/libpythia8.a $(PYTHIA8LOCATION)/$(LIBDIRARCH)/libhepmcinterface.a
49        @mkdir -p $(BINDIR)
50        $(CXX) $(CXXFLAGS) -Wno-shadow -I$(PYTHIA8LOCATION)/$(INCDIR) -I$(HEPMCLOCATION)/include \
51        $@.cc -o $(BINDIR)/$@.exe \
52        -L$(PYTHIA8LOCATION)/$(LIBDIRARCH) -lpythia8 -llhapdfdummy $(LIBGZIP) \
53        -lhepmcinterface \
54        -L$(HEPMCLOCATION)/lib -lHepMC
55        @ln -fs $(BINDIR)/$@.exe $@.exe
56else
57  main41 main42:
58        @echo ERROR, this target needs HepMC, variable HEPMCLOCATION
59endif
60
61# Create an executable that links to LHAPDF
62main51 main52 main53: $(PYTHIA8LOCATION)/$(LIBDIRARCH)/libpythia8.a
63        @mkdir -p $(BINDIR)
64        $(CXX) $(CXXFLAGS) -I$(PYTHIA8LOCATION)/$(INCDIR) $@.cc -o $(BINDIR)/$@.exe \
65        -L$(PYTHIA8LOCATION)/$(LIBDIRARCH) -lpythia8 $(LIBGZIP) \
66        -L$(LHAPDFLOCATION) $(LHAPDFLIBNAME) \
67        $(FLIBS)
68        @ln -fs $(BINDIR)/$@.exe $@.exe
69
70# Create an executable that links to LHAPDF and HepMC
71main61 main62: \
72        $(PYTHIA8LOCATION)/$(LIBDIRARCH)/libpythia8.a $(PYTHIA8LOCATION)/$(LIBDIRARCH)/libhepmcinterface.a
73        @mkdir -p $(BINDIR)
74        $(CXX) $(CXXFLAGS) -Wno-shadow -I$(PYTHIA8LOCATION)/$(INCDIR) -I$(HEPMCLOCATION)/include \
75        $@.cc -o $(BINDIR)/$@.exe \
76        -L$(PYTHIA8LOCATION)/$(LIBDIRARCH) -lpythia8 -lhepmcinterface $(LIBGZIP) \
77        -L$(LHAPDFLOCATION) $(LHAPDFLIBNAME) \
78        -L$(HEPMCLOCATION)/lib -lHepMC \
79        $(FLIBS)
80        @ln -fs $(BINDIR)/$@.exe $@.exe
81
82# Create an executable that links to Fastjet
83# Owing to excessive warning output -Wshadow is not used for Fastjet.
84# (Fixed as of Fastjet 3.0.1, so will be modified eventually.)
85ifneq (x$(FASTJETLOCATION),x)
86  main71 main72: $(PYTHIA8LOCATION)/$(LIBDIRARCH)/libpythia8.a
87        @mkdir -p $(BINDIR)
88    # Note: $(CXXFLAGS) is after Fastjet flags as Fastjet includes
89    #       optimisation/debug flags which may be unwanted (e.g. -g -O2)
90        $(CXX) -I$(PYTHIA8LOCATION)/$(INCDIR) $@.cc \
91        `$(FASTJETLOCATION)/bin/fastjet-config --cxxflags --plugins` \
92        $(CXXFLAGS) -Wno-shadow \
93        -o $(BINDIR)/$@.exe \
94        -L$(PYTHIA8LOCATION)/$(LIBDIRARCH) -lpythia8 -llhapdfdummy $(LIBGZIP) \
95        -L$(FASTJETLOCATION)/lib \
96        `$(FASTJETLOCATION)/bin/fastjet-config --libs --plugins`
97        @ln -fs $(BINDIR)/$@.exe $@.exe
98        @rm -f $@.o
99else
100  main71 main72:
101        @echo ERROR, this target needs Fastjet, variable FASTJETLOCATION
102endif
103
104# Create an executable that links to Fastjet, HepMC and LHApdf
105# Owing to excessive warning output -Wshadow is not used for Fastjet.
106# (Fixed as of Fastjet 3.0.1, so will be modified eventually.)
107ifneq (x$(FASTJETLOCATION),x)
108  main81 main82 main83 main84: \
109        $(PYTHIA8LOCATION)/$(LIBDIRARCH)/libpythia8.a  $(PYTHIA8LOCATION)/$(LIBDIRARCH)/libhepmcinterface.a
110        @mkdir -p $(BINDIR)
111    # Note: $(CXXFLAGS) is after Fastjet flags as Fastjet includes
112    #       optimisation/debug flags which may be unwanted (e.g. -g -O2)
113        $(CXX) -I$(PYTHIA8LOCATION)/$(INCDIR) $@.cc \
114        `$(FASTJETLOCATION)/bin/fastjet-config --cxxflags --plugins` \
115        $(CXXFLAGS) -Wno-shadow \
116        -I$(PYTHIA8LOCATION)/$(INCDIR) -I$(HEPMCLOCATION)/include \
117        -o $(BINDIR)/$@.exe \
118        -L$(PYTHIA8LOCATION)/$(LIBDIRARCH) -lpythia8 \
119        -L$(LHAPDFLOCATION) $(LHAPDFLIBNAME) \
120        -lhepmcinterface \
121        -L$(HEPMCLOCATION)/lib -lHepMC \
122        -L$(FASTJETLOCATION)/lib \
123        -L$(LHAPDFLOCATION)/lib \
124        `$(FASTJETLOCATION)/bin/fastjet-config --libs --plugins`
125        @ln -fs $(BINDIR)/$@.exe $@.exe
126        @rm -f $@.o
127else
128  main81 main82 main83 main84:
129        @echo ERROR, this target needs Fastjet, variable FASTJETLOCATION
130endif
131
132# Create an executable that links to Pythia6. This part is obsolete and
133# only retained, in a watered-down version, for debug purposes.
134# Library created with "gfortran -c pythia64xx.f" (xx = current subversion),
135# followed by "ar cru libpythia6.a pythia64xx.o" (on Linux).
136# You would need to uncomment below and correct pythia6 library path.
137#main91: $(PYTHIA8LOCATION)/$(LIBDIRARCH)/libpythia8.a
138#       @mkdir -p $(BINDIR)
139#       $(CXX) $(CXXFLAGS) -I$(PYTHIA8LOCATION)/$(INCDIR) $@.cc -o $(BINDIR)/$@.exe \
140#       -L$(PYTHIA8LOCATION)/$(LIBDIRARCH) -lpythia8 -llhapdfdummy $(LIBGZIP) \
141#       -L/directoryoflibpythia6.a -lpythia6 \
142#       $(FLIBS)
143#       @ln -fs $(BINDIR)/$@.exe $@.exe
144
145# Clean up: remove executables and outdated files.
146.PHONY: clean
147clean:
148        rm -rf $(BINDIR)
149        rm -rf *.exe
150        rm -f *~; rm -f \#*; rm -f core*
Note: See TracBrowser for help on using the repository browser.