Skip to content

Commit

Permalink
Merge pull request #55 from gaskelld/master
Browse files Browse the repository at this point in the history
Make RHEL9 specific Makefiles for root and ntuple utilities
  • Loading branch information
gaskelld authored May 14, 2024
2 parents 78ed988 + 31f724d commit a0f322d
Show file tree
Hide file tree
Showing 4 changed files with 212 additions and 0 deletions.
55 changes: 55 additions & 0 deletions util/ntuple/Makefile.rhel7
Original file line number Diff line number Diff line change
@@ -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

56 changes: 56 additions & 0 deletions util/ntuple/Makefile.rhel9
Original file line number Diff line number Diff line change
@@ -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

50 changes: 50 additions & 0 deletions util/root_tree/Makefile.rhel7
Original file line number Diff line number Diff line change
@@ -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

51 changes: 51 additions & 0 deletions util/root_tree/Makefile.rhel9
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit a0f322d

Please sign in to comment.