#-*- Makefile -*- # User specific paths FASTJET_CONFIG=$(shell which fastjet-config) LHAPDF_CONFIG=$(shell which lhapdf-config) PYTHIA8_CONFIG=$(shell which pythia8-config) RIVET_CONFIG=$(shell which rivet-config) YODA_CONFIG=$(shell which yoda-config) STD=-lstdc++ #Mac OS fortran/c++ linker UNAME_S := $(shell uname -s) ifeq ($(UNAME_S),Darwin) STD=-lc++ endif ## COMPILER: gfortran, ifort COMPILER=gfortran FC=$(COMPILER) ## PDF: native, lhapdf ## For "lhapdf", the LAHPDF package has to be installed separately PDF=lhapdf ## ANALYSIS: none, default ## "default" analysis may require FASTJET package, that has to be ## installed separately (see below) ANALYSIS=WG ## For static linking uncomment the following #STATIC=-static # ifeq ("$(COMPILER)","gfortran") F77=gfortran -fno-automatic -std=legacy -ffixed-line-length-none -J$(OBJ) -I$(OBJ) ## -fbounds-check sometimes causes a weird error due to non-lazy evaluation ## of boolean in gfortran. #FFLAGS= -Wall -Wimplicit-interface -fbounds-check ## For floating point exception trapping uncomment the following #FPE=-ffpe-trap=invalid,zero,overflow,underflow ## gfortran 4.4.1 optimized with -O3 yields erroneous results ## Use -O2 to be on the safe side OPT=-O2 ## For debugging uncomment the following DEBUG= -ggdb ifdef DEBUG OPT=-O0 FPE=-ffpe-trap=invalid,zero,overflow endif endif ifeq ("$(COMPILER)","ifort") F77 = ifort -save -extend_source -I$(OBJ) #CXX = g++ #LIBS = -limf #FFLAGS = -checkm ## For floating point exception trapping uncomment the following #FPE = -fpe0 OPT = -O1 #-fast ## For debugging uncomment the following #DEBUG= -debug -g ifdef DEBUG OPT=-O0 endif endif OBJ=obj-$(COMPILER) OBJDIR:=$(OBJ) POWHEG=/home/sferrario/POWHEG/V2 PWD=$(shell pwd) WDNAME=$(shell basename $(PWD)) VPATH= ./:$(POWHEG)/VBF_H:$(POWHEG)/:$(OBJDIR) INCLUDE0=$(PWD) INCLUDE1=$(POWHEG)/VBF_H INCLUDE2=$(POWHEG)/include #FF=$(F77) $(FFLAGS) $(FPE) $(OPT) $(DEBUG) -I$(INCLUDE0) -I$(INCLUDE1) -I$(INCLUDE2) FF=$(F77) $(FFLAGS) $(FPE) $(OPT) $(DEBUG) -I$(INCLUDE0) -I$(INCLUDE1) -I$(INCLUDE2) INCLUDE =$(wildcard $(POWHEG)/include/*.h $(POWHEG)/VBF_H/*.h *.h ) ifeq ("$(PDF)","lhapdf") PDFPACK=lhapdf6if.o lhapdf6ifcc.o FJCXXFLAGS+=$(shell $(LHAPDF_CONFIG) --cxxflags) LIBSLHAPDF= -Wl,-rpath,$(shell $(LHAPDF_CONFIG) --libdir) -L$(shell $(LHAPDF_CONFIG) --libdir) -lLHAPDF $(STD) -std=c++11 ifeq ("$(STATIC)","-static") ## If LHAPDF has been compiled with gfortran and you want to link it statically, you have to include ## libgfortran as well. The same holds for libstdc++. ## One possible solution is to use fastjet, since $(shell $(FASTJET_CONFIG) --libs --plugins ) $(STD) ## does perform this inclusion. The path has to be set by the user. LIBGFORTRANPATH=/usr/lib/gcc/x86_64-redhat-linux/4.4.4 LIBSTDCPP=/usr/lib/gcc/x86_64-redhat-linux/4.4.4 #/lib64 LIBSLHAPDF+= -L$(LIBGFORTRANPATH) -lgfortranbegin -lgfortran -L$(LIBSTDCPP) $(STD) endif LIBS+=$(LIBSLHAPDF) else PDFPACK=mlmpdfif.o hvqpdfpho.o endif PWHGANAL=pwhg_analysis-dummy.o ifeq ("$(ANALYSIS)","WG") ##To include Fastjet configuration uncomment the following lines. LIBSFASTJET += $(shell $(FASTJET_CONFIG) --libs --plugins ) $(STD) FJCXXFLAGS+= $(shell $(FASTJET_CONFIG) --cxxflags) #PWHGANAL=pwhg_bookhist-multi.o pwhg_analysis-Wc.o PWHGANAL=pwhg_bookhist-multi.o pwhg_analysis_wg.o multi_plot.o ## Also add required Fastjet drivers to PWHGANAL (examples are reported) #PWHGANAL+= fastjetsisconewrap.o fastjetktwrap.o fastjetCDFMidPointwrap.o fastjetD0RunIIConewrap.o fastjetfortran.o #PWHGANAL+= fastjetsisconewrap.o fastjetktwrap.o fastjetfortran.o PWHGANAL+= fastjetfortran.o else PWHGANAL=pwhg_bookhist-multi.o pwhg_analysis-dummy.o endif %.o: %.f $(INCLUDE) | $(OBJDIR) $(FF) -c -o $(OBJ)/$@ $< %.o: %.f90 $(INCLUDE) | $(OBJDIR) $(FF) -c -o $(OBJ)/$@ $< %.o: %.c | $(OBJDIR) $(CC) $(DEBUG) -c -o $(OBJ)/$@ $^ %.o: %.cc | $(OBJDIR) $(CXX) $(DEBUG) -c -o $(OBJ)/$@ $^ $(FJCXXFLAGS) LIBS+=-lz USER=init_couplings.o init_processes.o Born_phsp.o Born.o virtual.o \ real.o pwhg_cpHTO_reweight.o $(PWHGANAL) PWHG=pwhg_main.o pwhg_init.o bbinit.o btilde.o lhefwrite.o \ LesHouches.o LesHouchesreg.o gen_Born_phsp.o find_regions.o \ test_Sudakov.o pt2maxreg.o sigborn.o gen_real_phsp.o maxrat.o \ gen_index.o gen_radiation.o Bornzerodamp.o sigremnants.o \ random.o boostrot.o bra_ket_subroutines.o cernroutines.o \ init_phys.o powheginput.o pdfcalls.o sigreal.o sigcollremn.o \ pwhg_analysis_driver.o checkmomzero.o \ setstrongcoupl.o integrator.o newunit.o mwarn.o sigsoftvirt.o \ reshufflemoms.o \ pwhgreweight.o setlocalscales.o mint_upb.o opencount.o \ validflav.o ubprojections.o \ sigcollsoft.o sigvirtual.o $(PDFPACK) $(USER) $(FPEOBJ) lhefread.o pwhg_io_interface.o rwl_weightlists.o rwl_setup_param_weights.o # target to generate LHEF output pwhg_main: $(PWHG) $(FF) $(patsubst %,$(OBJ)/%,$(PWHG)) $(LINKMGLIBS) $(LIBS) $(LIBSFASTJET) $(STATIC) -o $@ $(STD) LHEF=lhef_analysis.o boostrot.o random.o cernroutines.o \ opencount.o powheginput.o $(PWHGANAL) \ lhefread.o pwhg_io_interface.o rwl_weightlists.o newunit.o pwhg_analysis_driver.o $(FPEOBJ) # target to analyze LHEF output lhef_analysis:$(LHEF) $(FF) $(patsubst %,$(OBJ)/%,$(LHEF)) $(LIBS) $(LIBSFASTJET) $(STATIC) -o $@ # target to read event file, shower events with HERWIG + analysis HERWIG=main-HERWIG.o setup-HERWIG-lhef.o herwig.o boostrot.o \ powheginput.o $(PWHGANAL) lhefread.o pwhg_io_interface.o rwl_weightlists.o \ pdfdummies.o opencount.o $(FPEOBJ) main-HERWIG-lhef: $(HERWIG) $(FF) $(patsubst %,$(OBJ)/%,$(HERWIG)) $(LIBSFASTJET) $(STATIC) -o $@ # target to read event file, shower events with PYTHIA + analysis PYTHIA=main-PYTHIA.o setup-PYTHIA-lhef.o pythia.o boostrot.o powheginput.o \ $(PWHGANAL) lhefread.o pwhg_io_interface.o rwl_weightlists.o newunit.o \ pwhg_analysis_driver.o random.o cernroutines.o opencount.o \ $(FPEOBJ) main-PYTHIA-lhef: $(PYTHIA) $(FF) $(patsubst %,$(OBJ)/%,$(PYTHIA)) $(LIBS) $(LIBSFASTJET) $(STATIC) -o $@ # target to cleanup .PHONY: clean clean: rm -f $(OBJ)/*.o $(OBJ)/*.mod $(OBJ)/*.a pwhg_main \ lhef_analysis main-HERWIG-lhefmain-PYTHIA-lhef # target to generate object directory if it does not exist $(OBJDIR): mkdir -p $(OBJDIR)