|
| 1 | +#-- Makefile to be used for VBF pp->W+W-jj |
| 2 | +## Choose compiler: gfortran,g77,ifort |
| 3 | +COMPILER=gfortran |
| 4 | +## Choose PDF: native,lhapdf |
| 5 | +## LHAPDF package has to be installed separately |
| 6 | +PDF=lhapdf |
| 7 | +#PDF=native |
| 8 | + |
| 9 | +# Choose Analysis: none, default |
| 10 | +# default analysis requires FASTJET package, that has to be installed |
| 11 | +# separately (see below) |
| 12 | +#ANALYSIS=none |
| 13 | +ANALYSIS=default |
| 14 | +## For static linking uncomment the following |
| 15 | +#STATIC= -static |
| 16 | + |
| 17 | +ifeq ("$(COMPILER)","gfortran") |
| 18 | +F77= gfortran -fno-automatic -ffixed-line-length-none |
| 19 | +USEDLIBFILES=-Wl,--print-map | grep '^obj-gfortran/libfiles.a' | sed 's/obj-gfortran\/libfiles\.a(// ; s/)//' > libfileslist.txt |
| 20 | +## -fbounds-check sometimes causes a weird error due to non-lazy evaluation |
| 21 | +## of boolean in gfortran. |
| 22 | +#FFLAGS= -Wall -Wimplicit-interface -fbounds-check |
| 23 | +## For floating point exception trapping uncomment the following |
| 24 | +#FPE=-ffpe-trap=invalid,zero,overflow,underflow |
| 25 | +## gfortran 4.4.1 optimized with -O3 yields erroneous results |
| 26 | +## Use -O2 to be on the safe side |
| 27 | +OPT=-O2 |
| 28 | +## For debugging uncomment the following |
| 29 | +#DEBUG= -ggdb |
| 30 | +ifdef DEBUG |
| 31 | +OPT= |
| 32 | +FPE=-ffpe-trap=invalid,zero,overflow |
| 33 | +endif |
| 34 | +endif |
| 35 | + |
| 36 | +ifeq ("$(COMPILER)","ifort") |
| 37 | +F77 = ifort -save -extend_source |
| 38 | +CXX = icpc |
| 39 | +LIBS = -limf |
| 40 | +FFLAGS = -check |
| 41 | +## For floating point exception trapping uncomment the following |
| 42 | +#FPE = -fpe0 |
| 43 | +OPT = -O3 #-fast |
| 44 | +## For debugging uncomment the following |
| 45 | +#DEBUG= -debug -g |
| 46 | +endif |
| 47 | + |
| 48 | +OBJ=obj-$(COMPILER) |
| 49 | + |
| 50 | +PWD=$(shell pwd) |
| 51 | +WDNAME=$(shell basename $(PWD)) |
| 52 | + |
| 53 | +VPATH= boxfiles-pre2-1:./:../:$(OBJ) |
| 54 | + |
| 55 | +INCLUDE0=$(PWD) |
| 56 | +INCLUDE1=$(PWD)/include |
| 57 | +INCLUDE2=$(shell dirname $(PWD))/include |
| 58 | +INCLUDE3=$(PWD)/.. |
| 59 | +INCLUDEA=$(PWD)/boxfiles-pre2-1 |
| 60 | +INCLUDEZ=vbfnlo-files |
| 61 | +FF=$(F77) $(FFLAGS) $(FPE) $(OPT) $(DEBUG) -I$(INCLUDEA) -I$(INCLUDE0) -I$(INCLUDE1) -I$(INCLUDE2) -I$(INCLUDE3) -I $(INCLUDEZ) |
| 62 | + |
| 63 | + |
| 64 | +INCLUDE =$(wildcard ../include/*.h *.h include/*.h boxfiles-pre2-1/*h) |
| 65 | + |
| 66 | +ifeq ("$(PDF)","lhapdf") |
| 67 | +LHAPDF_CONFIG=lhapdf-config |
| 68 | +PDFPACK=lhapdfif.o |
| 69 | +LIBSLHAPDF= -Wl,-rpath,$(shell $(LHAPDF_CONFIG) --libdir) -L$(shell $(LHAPDF_CONFIG) --libdir) -lLHAPDF |
| 70 | +ifeq ("$(STATIC)","-static") |
| 71 | +## If LHAPDF has been compiled with gfortran and you want to link it statically, you have to include |
| 72 | +## libgfortran as well. The same holds for libstdc++. |
| 73 | +## One possible solution is to use fastjet, since $(shell $(FASTJET_CONFIG) --libs --plugins ) -lstdc++ |
| 74 | +## does perform this inclusion. The path has to be set by the user. |
| 75 | +# LIBGFORTRANPATH=/usr/lib/gcc/x86_64-redhat-linux/4.1.2 |
| 76 | +# LIBSTDCPP=/lib64 |
| 77 | + LIBSLHAPDF+= -L$(LIBGFORTRANPATH) -lgfortranbegin -lgfortran -L$(LIBSTDCPP) #-lstdc++ |
| 78 | +endif |
| 79 | +LIBS+=$(LIBSLHAPDF) |
| 80 | +else |
| 81 | +PDFPACK=mlmpdfif.o hvqpdfpho.o |
| 82 | +endif |
| 83 | + |
| 84 | +ifeq ("$(ANALYSIS)","default") |
| 85 | +FASTJET_CONFIG=$(shell which fastjet-config) |
| 86 | +LIBSFASTJET += $(shell $(FASTJET_CONFIG) --libs --plugins ) -lstdc++ |
| 87 | +FJCXXFLAGS+= $(shell $(FASTJET_CONFIG) --cxxflags) |
| 88 | +PWHGANAL=pwhg_analysis_all.o pwhg_analysis_lep.o pwhg_analysis_slp_fat.o \ |
| 89 | + pwhg_analysis_slp_hh.o pwhg_analysis_slm_hh.o \ |
| 90 | + fastjetfortran.o fastjetfatjet.o |
| 91 | +# Also add required Fastjet drivers to PWHGANAL (examples are reported) |
| 92 | +PWHGANAL+= fastjetsisconewrap.o fastjetktwrap.o #fastjetCDFMidPointwrap.o fastjetD0RunIIConewrap.o fastjetfortran.o |
| 93 | +else |
| 94 | +PWHGANAL=pwhg_analysis-dummy.o |
| 95 | +endif |
| 96 | + |
| 97 | +LIBS+=$(LHAPDFLIB) -Lvbfnlo-files -lvbfnlo |
| 98 | + |
| 99 | +%.o: %.f $(INCLUDE) |
| 100 | + $(FF) -c -o $(OBJ)/$@ $< |
| 101 | + |
| 102 | +%.o: %.c |
| 103 | + $(CC) $(DEBUG) -c -o $(OBJ)/$@ $^ |
| 104 | + |
| 105 | +%.o: %.cc |
| 106 | + $(CC) $(DEBUG) -c -o $(OBJ)/$@ $^ $(FJCXXFLAGS) |
| 107 | + |
| 108 | + |
| 109 | +USER=init_couplings.o init_processes.o Born_phsp.o Born.o virtual.o \ |
| 110 | + calc_invariants.o compute_tensors_wpm.o compute_tensors_wpm_real.o \ |
| 111 | + convert_coup.o real.o \ |
| 112 | + boost.o phi1_2.o phi3m0.o breit.o $(PWHGANAL) |
| 113 | + |
| 114 | +PWHG=pwhg_main.o pwhg_init.o bbinit.o btilde.o lhefwrite.o write_counters.o \ |
| 115 | + LesHouches.o LesHouchesreg.o gen_Born_phsp.o find_regions.o \ |
| 116 | + test_Sudakov.o pt2maxreg.o sigborn.o gen_real_phsp_fix.o maxrat.o \ |
| 117 | + gen_index.o gen_radiation.o Bornzerodamp.o sigremnants.o \ |
| 118 | + random.o boostrot.o bra_ket_subroutines.o cernroutines.o \ |
| 119 | + init_phys.o powheginput.o pdfcalls.o sigreal.o sigcollremn.o \ |
| 120 | + pwhg_bookhist.o pwhg_analysis_driver.o checkmomzero.o \ |
| 121 | + reshufflemoms.o setstrongcoupl.o integrator.o newunit.o \ |
| 122 | + mwarn.o sigsoftvirt.o sigcollsoft.o sigvirtual.o \ |
| 123 | + phi1_2m_nobw.o phi1_2m_bw.o mint_upb.o \ |
| 124 | + opencount.o pwhgreweight.o setlocalscales.o validflav.o \ |
| 125 | + $(PDFPACK) $(USER) $(SYSOBJ) |
| 126 | + |
| 127 | +# target to generate LHEF output |
| 128 | +pwhg_main:$(PWHG) vbfnlo-files/libvbfnlo.a |
| 129 | + (cd vbfnlo-files; make;) |
| 130 | + $(FF) $(patsubst %,$(OBJ)/%, $(PWHG)) $(LIBS) $(LIBSFASTJET) -o $@ |
| 131 | + |
| 132 | + |
| 133 | +vbfnlo-files/libvbfnlo.a: vbfnlo-files/*f |
| 134 | + cd vbfnlo-files ; make |
| 135 | + |
| 136 | +LHEFANAL=lhef_analysis.o boostrot.o random.o cernroutines.o write_counters.o \ |
| 137 | + opencount.o powheginput.o pwhg_bookhist.o \ |
| 138 | + lhefread.o newunit.o pwhg_analysis_driver.o \ |
| 139 | + $(PWHGANAL) $(SYSOBJ) |
| 140 | + |
| 141 | + |
| 142 | +# target to analyze LHEF output |
| 143 | +lhef_analysis:$(LHEFANAL) |
| 144 | + $(FF) $(patsubst %,$(OBJ)/%,$(LHEFANAL)) -o $@ $(LIBS) $(LIBSFASTJET) |
| 145 | + |
| 146 | + |
| 147 | + |
| 148 | +# target to read event file, shower events with PYTHIA + analysis |
| 149 | +PYTHIA=main-PYTHIA.o setup-PYTHIA-lhef.o pythia.o \ |
| 150 | + boostrot.o powheginput.o write_counters.o \ |
| 151 | + pwhg_bookhist.o lhefread.o newunit.o \ |
| 152 | + pwhg_analysis_driver.o pdfdummies.o \ |
| 153 | + random.o cernroutines.o opencount.o $(PWHGANAL) $(SYSOBJ) |
| 154 | + |
| 155 | + |
| 156 | +main-PYTHIA-lhef: $(PYTHIA) |
| 157 | + $(FF) $(patsubst %,$(OBJ)/%,$(PYTHIA)) -o $@ $(LIBS) $(LIBSFASTJET) $(LIBS) |
| 158 | + |
| 159 | +clean: |
| 160 | + rm -f *.o *~ $(OBJ)/*.o \ |
| 161 | + vbfnlo-files/*.o vbfnlo-files/libvbfnlo.a \ |
| 162 | + vbfnlo-files/*/*.o \ |
| 163 | + pwhg_main lhef_analysis \ |
| 164 | + main-PYTHIA-lhef |
0 commit comments