From e469cbb4eec01b6a59c84e73cdcc8e8e212d354a Mon Sep 17 00:00:00 2001 From: Dave Gaskell Date: Tue, 14 May 2024 08:25:27 -0400 Subject: [PATCH 1/2] Add RHEL7/RHEL9 specific make files --- util/ntuple/Makefile.rhel7 | 55 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 util/ntuple/Makefile.rhel7 diff --git a/util/ntuple/Makefile.rhel7 b/util/ntuple/Makefile.rhel7 new file mode 100644 index 00000000..e26f4b74 --- /dev/null +++ b/util/ntuple/Makefile.rhel7 @@ -0,0 +1,55 @@ +## This makefile must be executed with gmake (gnu make). + +## This tells make not to delete these target files on error/interrupt (see man page) +.PRECIOUS: *.o +RM = rm -f +SHELL = /bin/sh + +OBJ = make_ntuple.o + +my_objs = $(OBJ) + +my_deps = $(my_objs:.o=.d) + +MYOS := $(subst -,,$(shell uname)) +#CERNLIBS = -lgeant$(GEANTVER) -lpawlib -lgraflib -lgrafX11 -lpacklib -lmathlib +CERNLIBS = -Wl,-static -lgeant$(GEANTVER) -lpawlib -lgraflib -lgrafX11 -lpacklib -lkernlib -lmathlib -Wl,-dy + + +#For use with gfortran compiler +# -fno-automatic - all program storage treated as static +ifeq ($(MYOS),Linux) + FFLAGSA=-O -w -ffixed-line-length-132 -ff2c -fno-automatic -fdefault-real-8 + INCLUDES=-I. + FFLAGS= $(INCLUDES) $(FFLAGSA) + FFLAG1=$(FFLAGS) -c + OTHERLIBS = -L$(CERN_ROOT)/lib $(CERNLIBS) -L/usr/lib64 +# 64 vs 32 bit +# -L$(CERN_ROOT)/lib $(CERNLIBS) -L/usr/lib + FC := gfortran + F77 := gfortran +endif + +%.o: %.f + $(F77) $(FFLAGS) -c $< -o $@ + +DEPEND_RULE = ( cat $< | sed -n -e \ + "s|^[ ]*[Ii][Nn][Cc][Ll][Uu][Dd][Ee][ ]*['\"]|$@: $(@D)/|p" | \ + sed -e "s|['\"].*$$||" | \ + sed -e 's|.d:|.o:|') > $@ + +%.d: %.f + $(DEPEND_RULE) + +none: make_ntuple $(my_deps) + +all: make_ntuple $(my_deps) + +include $(my_deps) + +make_ntuple: $(my_objs) Makefile + $(F77) $(OSF_SHARED) -o $@ $(FFLAGS) $(my_objs) $(OTHERLIBS) + +clean: + $(RM) *.[od] make_ntuple + From 31f724de1e58bd7a769743defae1d65b2a06603b Mon Sep 17 00:00:00 2001 From: Dave Gaskell Date: Tue, 14 May 2024 08:26:30 -0400 Subject: [PATCH 2/2] Add RHEL7/RHEL9 specific make files --- util/ntuple/Makefile.rhel9 | 56 +++++++++++++++++++++++++++++++++++ util/root_tree/Makefile.rhel7 | 50 +++++++++++++++++++++++++++++++ util/root_tree/Makefile.rhel9 | 51 +++++++++++++++++++++++++++++++ 3 files changed, 157 insertions(+) create mode 100644 util/ntuple/Makefile.rhel9 create mode 100644 util/root_tree/Makefile.rhel7 create mode 100644 util/root_tree/Makefile.rhel9 diff --git a/util/ntuple/Makefile.rhel9 b/util/ntuple/Makefile.rhel9 new file mode 100644 index 00000000..285dd796 --- /dev/null +++ b/util/ntuple/Makefile.rhel9 @@ -0,0 +1,56 @@ +## This makefile must be executed with gmake (gnu make). + +## This tells make not to delete these target files on error/interrupt (see man page) +.PRECIOUS: *.o +RM = rm -f +SHELL = /bin/sh + +OBJ = make_ntuple.o + +my_objs = $(OBJ) + +my_deps = $(my_objs:.o=.d) + +MYOS := $(subst -,,$(shell uname)) +#CERNLIBS = -lgeant$(GEANTVER) -lpawlib -lgraflib -lgrafX11 -lpacklib -lmathlib +CERNLIBS = -Wl,-static -lgeant$(GEANTVER) -lpawlib -lgraflib -lgrafX11 -lpacklib -lkernlib -lmathlib -Wl,-dy + +# +CERN_ROOT=/cvmfs/oasis.opensciencegrid.org/jlab/scicomp/sw/el9/cernlib/2023 +#For use with gfortran compiler +# -fno-automatic - all program storage treated as static +ifeq ($(MYOS),Linux) + FFLAGSA=-O -w -ffixed-line-length-132 -ff2c -fno-automatic -fdefault-real-8 + INCLUDES=-I. + FFLAGS= $(INCLUDES) $(FFLAGSA) + FFLAG1=$(FFLAGS) -c + OTHERLIBS = -L$(CERN_ROOT)/lib $(CERNLIBS) -L/usr/lib64 +# 64 vs 32 bit +# -L$(CERN_ROOT)/lib $(CERNLIBS) -L/usr/lib + FC := gfortran + F77 := gfortran +endif + +%.o: %.f + $(F77) $(FFLAGS) -c $< -o $@ + +DEPEND_RULE = ( cat $< | sed -n -e \ + "s|^[ ]*[Ii][Nn][Cc][Ll][Uu][Dd][Ee][ ]*['\"]|$@: $(@D)/|p" | \ + sed -e "s|['\"].*$$||" | \ + sed -e 's|.d:|.o:|') > $@ + +%.d: %.f + $(DEPEND_RULE) + +none: make_ntuple $(my_deps) + +all: make_ntuple $(my_deps) + +include $(my_deps) + +make_ntuple: $(my_objs) Makefile + $(F77) $(OSF_SHARED) -o $@ $(FFLAGS) $(my_objs) $(OTHERLIBS) + +clean: + $(RM) *.[od] make_ntuple + diff --git a/util/root_tree/Makefile.rhel7 b/util/root_tree/Makefile.rhel7 new file mode 100644 index 00000000..c9d5c85c --- /dev/null +++ b/util/root_tree/Makefile.rhel7 @@ -0,0 +1,50 @@ +## This makefile must be executed with gmake (gnu make). + +## This tells make not to delete these target files on error/interrupt (see man page) +.PRECIOUS: *.o +RM = rm -f +SHELL = /bin/sh + +OBJ = make_root_tree.o + +my_objs = $(OBJ) + +my_deps = $(my_objs:.o=.d) + +MYOS := $(subst -,,$(shell uname)) + +#For use with gfortran compiler +# -fno-automatic - all program storage treated as static +ifeq ($(MYOS),Linux) + FFLAGSA=- + INCLUDES= + FFLAGS = -O3 -fno-automatic + OTHERLIBS = + FC := gfortran + F77 := gfortran +endif + +CXX=g++ +CXXFLAGS0 = -O3 -std=c++11 +CXXFLAGS=$(CXXFLAGS0) $(DROOT) +ROOTDIR=$(ROOTSYS) +DMYROOT= -DMYROOT +ROOTLIBS := $(shell $(ROOTDIR)/bin/root-config --prefix=$(ROOTDIR) --libs) +ROOTINCLUDE := -I $(shell $(ROOTDIR)/bin/root-config --prefix=$(ROOTDIR) --incdir) + +none: make_root_tree + +all: make_root_tree + +make_root_tree: $(my_objs) froot.co + $(F77) $(LDFLAGS) -o make_root_tree $(my_objs) $(OTHERLIBS) froot.co $(ROOTLIBS) -lImt -lvdt -ltbb $(OTHERLIBS) $(CERNLIBS) -L/usr/lib64 -lstdc++ + +%.o: %.f + $(FC) -c $(FFLAGS) $< + +%.co: %.c + $(CXX) -c $(CXXFLAGS) $(DMYROOT) $(ROOTINCLUDE) -o $@ $< + +clean: + $(RM) *.o *.co make_root_tree + diff --git a/util/root_tree/Makefile.rhel9 b/util/root_tree/Makefile.rhel9 new file mode 100644 index 00000000..087c113c --- /dev/null +++ b/util/root_tree/Makefile.rhel9 @@ -0,0 +1,51 @@ +## This makefile must be executed with gmake (gnu make). + +## This tells make not to delete these target files on error/interrupt (see man page) +.PRECIOUS: *.o +RM = rm -f +SHELL = /bin/sh + +OBJ = make_root_tree.o + +my_objs = $(OBJ) + +my_deps = $(my_objs:.o=.d) + +MYOS := $(subst -,,$(shell uname)) + +#For use with gfortran compiler +# -fno-automatic - all program storage treated as static +ifeq ($(MYOS),Linux) + FFLAGSA=- + INCLUDES= + FFLAGS = -O3 -fno-automatic + OTHERLIBS = + FC := gfortran + F77 := gfortran +endif + +ROOTSYS=/cvmfs/oasis.opensciencegrid.org/jlab/scicomp/sw/el9/root/6.30.04-gcc11.4.0 +CXX=g++ +CXXFLAGS0 = -O3 -std=c++17 +CXXFLAGS=$(CXXFLAGS0) $(DROOT) +ROOTDIR=$(ROOTSYS) +DMYROOT= -DMYROOT +ROOTLIBS := $(shell $(ROOTDIR)/bin/root-config --prefix=$(ROOTDIR) --libs) +ROOTINCLUDE := -I $(shell $(ROOTDIR)/bin/root-config --prefix=$(ROOTDIR) --incdir) + +none: make_root_tree + +all: make_root_tree + +make_root_tree: $(my_objs) froot.co + $(F77) $(LDFLAGS) -o make_root_tree $(my_objs) $(OTHERLIBS) froot.co $(ROOTLIBS) -lImt -lvdt -ltbb $(OTHERLIBS) $(CERNLIBS) -L/usr/lib64 -lstdc++ + +%.o: %.f + $(FC) -c $(FFLAGS) $< + +%.co: %.c + $(CXX) -c $(CXXFLAGS) $(DMYROOT) $(ROOTINCLUDE) -o $@ $< + +clean: + $(RM) *.o *.co make_root_tree +