Skip to content

Commit

Permalink
Merge pull request #20 from usarica/master
Browse files Browse the repository at this point in the history
Resolve latest CMSSW issues
  • Loading branch information
jdavis36 authored Sep 8, 2022
2 parents 33d499f + 85a4cb2 commit b35c85e
Show file tree
Hide file tree
Showing 9 changed files with 88 additions and 425 deletions.
21 changes: 0 additions & 21 deletions MELA/BuildFile.xml

This file was deleted.

12 changes: 9 additions & 3 deletions MELA/COLLIER/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ AUXDIR = $(MAINDIR)/Aux
COLIDIR = $(MAINDIR)/COLI
TENSORSDIR = $(MAINDIR)/tensors
DDLIBDIR = $(MAINDIR)/DDlib
MELALIBDIR = ${MELA_LIB_PATH}
MODULES=$(MAINDIR)
OBJECTS=$(MAINDIR)

Expand Down Expand Up @@ -34,6 +35,7 @@ endif


LIB = libcollier.so
LIBRULE = $(MELALIBDIR)/$(LIB)

Deps = $(MAINDIR)/collier_global.F90 \
$(AUXDIR)/Combinatorics.F90 \
Expand Down Expand Up @@ -102,17 +104,21 @@ Objs = collier_global.o \
DDlib_DD_to_COLLIER.o


${Objs}: $(Deps)
.PHONY: all help clean

all: $(LIBRULE)

$(LIBRULE): $(Deps)
@echo " "
@echo " Compiling COLLIER dependencies"
$(fcomp) -c $(Deps)
@echo " "
@echo " Compiling COLLIER library"
g++ -Wl,-soname,$(LIB) -shared -o $(LIB) *.o
g++ -Wl,-rpath=$(MELALIBDIR),-soname,$(LIB) -L$(MELALIBDIR) -shared *.o -o $@

clean:
@echo " Deleting COLLIER object files and library"
rm -f *.so $(OBJECTS)/*.o $(MODULES)/*.mod
rm -f *.so $(LIBRULE) $(OBJECTS)/*.o $(MODULES)/*.mod


# supresses command calls
Expand Down
5 changes: 2 additions & 3 deletions MELA/COLLIER/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ if [[ $# > 0 ]] && [[ "$1" == *"clean"* ]]; then
fi
done

rm -f ../data/*/$libname
rm -f ${MELA_LIB_PATH}/../*/$libname

else

if [[ ! -f "../data/$SCRAM_ARCH/$libname" ]]; then
if [[ ! -f "${MELA_LIB_PATH}/$libname" ]]; then
rm -rf $tmpdir
rm -f $tarname
wget --no-check-certificate $tarweb
Expand All @@ -45,7 +45,6 @@ else
rm -rf $tmpdir

make $@
mv $libname "../data/$SCRAM_ARCH/$libname"
fi

fi
Expand Down
1 change: 0 additions & 1 deletion MELA/data/slc7_amd64_gcc10/download.url

This file was deleted.

30 changes: 12 additions & 18 deletions MELA/fortran/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ else
RM = /bin/rm

MAINDIR = $(shell pwd)/
MELALIBDIR = ${MELA_LIB_PATH}
OBJECTSDIR=
LIB = libjhugenmela.so
LIBRULE = $(MELALIBDIR)/$(LIB)

INCLUDE = -I$(MAINDIR)
Comp = gfort
Expand All @@ -17,26 +19,26 @@ Comp = gfort
# link pdfs via LHA library ('Yes' or 'No')
UseLHAPDF=No
# directory which contains libLHAPDF.a, libLHAPDF.la, libLHAPDF.so
MyLHADir=/./
LHAPDFLIBDIR=/./
# remember to export
# LD_LIBRARY_PATH=/.../LHAPDF-x.y.z/lib/:${LD_LIBRARY_PATH}
# LHAPDF_DATA_PATH=/.../LHAPDF-x.y.z/share/LHAPDF/:${LHAPDF_DATA_PATH}
ifeq ($(UseLHAPDF),Yes)
LHAPDFflags = -L$(MyLHADir) -lLHAPDF -DuseLHAPDF=1
LHAPDFflags = -L$(LHAPDFLIBDIR) -lLHAPDF -DuseLHAPDF=1
else
LHAPDFflags = -DuseLHAPDF=0
endif

# Linking the Collier library
UseCOLLIER=Yes
# directory which contains libLHAPDF.a, libLHAPDF.la, libLHAPDF.so
MyCOLLIERDir=$(MAINDIR)../data/${SCRAM_ARCH}/
MyCOLLIERInc=$(MAINDIR)../COLLIER/
COLLIERLIBDIR=$(MAINDIR)../data/${MELA_ARCH}/
COLLIERINCDIR=$(MAINDIR)../COLLIER/
# remember to export
# LD_LIBRARY_PATH=/.../LHAPDF-x.y.z/lib/:${LD_LIBRARY_PATH}
# LHAPDF_DATA_PATH=/.../LHAPDF-x.y.z/share/LHAPDF/:${LHAPDF_DATA_PATH}
ifeq ($(UseCOLLIER),Yes)
COLLIERflags = -L$(MyCOLLIERDir) -lcollier -DuseCollier=1 -I$(MyCOLLIERInc)
COLLIERflags = -L$(COLLIERLIBDIR) -lcollier -DuseCollier=1 -I$(COLLIERINCDIR)
else
COLLIERflags = -DuseCollier=0
endif
Expand Down Expand Up @@ -64,16 +66,7 @@ ifeq ($(Comp),ifort)
endif


all: libs
@echo " Compiling $(LIB)"
g++ -Wl,-soname,$(LIB) -shared -o $(LIB) *.o
@echo " "
@echo " WARNING: if you updated the fortran code,"
@echo " you need to move libjhugenmela.so"
@echo ' to the appropriate folder in data/'
@echo " and then gmake/scram. Otherwise your changes"
@echo " will not apply to any code you run."
@echo " If you are running setup.sh this is done automatically."
all: $(LIBRULE)

.SILENT:

Expand Down Expand Up @@ -130,11 +123,12 @@ $(OBJECTSDIR)mod_JHUGen.o: mod_JHUGen.F90 $(OBJECTSDIR)mod_HashCollection.o $(OB
@echo " Compiling $< with $(Comp)"; \
$(fcomp) -c $<

libs: $(OBJECTS)
$(LIBRULE): $(OBJECTS)
@echo "Linking $(LIB)"; \
g++ -Wl,-rpath=$(MELALIBDIR),-soname,$(LIB) -L$(MELALIBDIR) -shared *.o -o $@

clean:
@echo " Deleting MELA fortran object files and library"
rm -f *.so $(OBJECTSDIR)*.o $(OBJECTSDIR)*.mod
rm -f *.so $(LIBRULE) $(OBJECTSDIR)*.o $(OBJECTSDIR)*.mod


endif
17 changes: 9 additions & 8 deletions MELA/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@ RM = /bin/rm

MELADIR = $(shell pwd)
MELASRCDIR = $(MELADIR)/src
MELADATADIR = $(MELADIR)/data
MELAOBJDIR = $(MELADIR)/obj
# Modify MELALIBDIR for the gcc version as needed
MELALIBDIR = $(MELADATADIR)/${SCRAM_ARCH}
MELALIBDIR = ${MELA_LIB_PATH}
# _melapkgpath_ should refer to the root compilation path just like MELADIR with an extra '/'.
# If environment variables need to be inserted without expansion for portability,
# you can use '.oODOLLAROo..oOOPEN_BRACKETOo.[YOUR_ENV_VARIABLE].oOCLOSE_BRACKETOo.',
Expand Down Expand Up @@ -54,19 +53,20 @@ SOURCESCC = $(wildcard $(MELASRCDIR)/*.cc)
SOURCESCXX = $(wildcard $(MELASRCDIR)/*.cxx)
OBJECTSPRIM = $(SOURCESCC:.cc=.o) $(SOURCESCXX:.cxx=.o)
OBJECTS = $(subst $(MELASRCDIR),$(MELAOBJDIR),$(OBJECTSPRIM))
DEPS = $(OBJECTS:.o=.d)

.PHONY: all help compile clean

.SILENT: alldirs $(OBJECTS) $(MELAOBJDIR)/LinkDef_out.o $(LIBRULE) python/__init__.py clean
.SILENT: alldirs $(OBJECTS) $(DEPS) $(MELAOBJDIR)/LinkDef_out.o $(LIBRULE) python/__init__.py clean

all: $(LIBRULE) python/__init__.py

$(MELAOBJDIR)/%.d: $(MELASRCDIR)/%.c* | alldirs
echo "Checking dependencies for $<"; \
$(CC) -MM -MT $@ -MT ${@:.d=.o} $(CPPFLAGS) $< > $@; \
$(CC) -MM -MT $@ $(CPPFLAGS) $< > $@; \
[ -s $@ ] || rm -f $@

$(MELAOBJDIR)/%.o: $(MELASRCDIR)/%.c* | alldirs
$(MELAOBJDIR)/%.o: $(MELASRCDIR)/%.c* $(MELAOBJDIR)/%.d | alldirs
echo "Compiling $<"; \
$(CC) $(CPPFLAGS) $< -c -o $@

Expand All @@ -89,9 +89,10 @@ python/__init__.py:
touch python/__init__.py

clean:
rm -v -r -f \
$(MELAOBJDIR) $(MELASRCDIR)/LinkDef_out* $(MELALIBDIR)/$(LIB) $(MELALIBDIR)/LinkDef_out_rdict.pcm; \
echo "Done cleaning MELA"
rm -rf $(MELAOBJDIR) $(MELASRCDIR)/LinkDef_out* $(MELALIBDIR)/$(LIB) $(MELALIBDIR)/LinkDef_out_rdict.pcm


include $(DEPS)


endif
Expand Down
Loading

0 comments on commit b35c85e

Please sign in to comment.