Skip to content

Commit

Permalink
Ok actually patch makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
nsmith- committed Feb 25, 2025
1 parent f32a51d commit 05cc96e
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 3 deletions.
4 changes: 1 addition & 3 deletions recipes/cms-combine/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@
set -ex

pushd HiggsAnalysis/CombinedLimit
sed -i 's|\${CONDA_PREFIX}|\${PREFIX}|g' Makefile
make CONDA=1 -j${CPU_COUNT}
cp -rv build/bin ${PREFIX}
# the Makefile always uses .so as a target, so we don't use SHLIB_EXT
cp -v build/lib/*.so ${PREFIX}/lib
cp -v build/lib/*${SHLIB_EXT} ${PREFIX}/lib
cp -v build/lib/*.pcm ${PREFIX}/lib
cp -v build/lib/*.rootmap ${PREFIX}/lib
mkdir -p ${PREFIX}/include/HiggsAnalysis/CombinedLimit
Expand Down
35 changes: 35 additions & 0 deletions recipes/cms-combine/makefile.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
diff --git a/Makefile b/Makefile
index 0af8dece..6d9c5e3f 100644
--- a/Makefile
+++ b/Makefile
@@ -34,8 +34,8 @@ CCFLAGS = -D STANDALONE $(ROOTCFLAGS) -g -fPIC -O2 -pthread -pipe -Werror=main -
LIBS = $(ROOTLIBS) -lgsl -lRooFit -lRooFitCore -lRooStats -lMinuit -lMathMore -lFoam -lHistFactory -lboost_filesystem -lboost_program_options -lboost_system -lvdt

ifeq ($(CONDA), 1)
-CCFLAGS += -I${CONDA_PREFIX}/include/boost -I ${CONDA_PREFIX}/include/vdt -I ${CONDA_PREFIX}/include/gsl -I ${CONDA_PREFIX}/include/eigen3
-LIBS += -L${CONDA_PREFIX}/lib
+CCFLAGS += -I${PREFIX}/include/boost -I ${PREFIX}/include/vdt -I ${PREFIX}/include/gsl -I ${PREFIX}/include/eigen3
+LIBS += -L${PREFIX}/lib
else ifeq ($(LCG), 1)
# for some reason, Eigen headers are nested in LCG
CCFLAGS += -I ${CPLUS_INCLUDE_PATH}/eigen3
@@ -47,7 +47,6 @@ endif

# Library name -----------------------------------------------------------------
LIBNAME=HiggsAnalysisCombinedLimit
-SONAME=lib$(LIBNAME).so
DICTNAME=$(LIBNAME)_xr

# Linker and flags -------------------------------------------------------------
@@ -57,9 +56,11 @@ ROOTLIBDIR = $(shell root-config --libdir)
# OS x specific linkage
DARWIN := $(shell uname|grep Darwin)
ifdef DARWIN
+SONAME=lib$(LIBNAME).dylib
LDFLAGS = $(ROOTLDFLAGS) -g -shared -install_name @rpath/$(SONAME) -fPIC
EXELDFLAGS = -Wl,-rpath,'@executable_path/../lib' -Wl,-rpath,$(ROOTLIBDIR)
else
+SONAME=lib$(LIBNAME).so
LDFLAGS = $(ROOTLDFLAGS) -shared -Wl,-soname,$(SONAME) -Wl,-E -Wl,-z,defs -fPIC
EXELDFLAGS =
endif
1 change: 1 addition & 0 deletions recipes/cms-combine/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ source:
folder: HiggsAnalysis/CombinedLimit
patches:
- clang_warnings.patch
- makefile.patch

build:
number: 0
Expand Down

0 comments on commit 05cc96e

Please sign in to comment.