From 91ea80360a19ee6f736c3100d97b1bb1311bf6ce Mon Sep 17 00:00:00 2001 From: Jing Liu Date: Tue, 12 Dec 2023 07:38:03 -0600 Subject: [PATCH] embeded G4 lib path in rpath in Makefile --- Makefile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Makefile b/Makefile index b40b45f..b0684b0 100644 --- a/Makefile +++ b/Makefile @@ -13,6 +13,12 @@ LDLIBS=$(shell geant4-config --libs) ifeq (11.1.0, $(shell geant4-config --version)) LDLIBS+=-lG4ToolsSG endif +# imbed Geant4 lib path to rpath on MacOS +# https://stackoverflow.com/a/12099167/1801749 +# https://stackoverflow.com/a/6638539/1801749 +ifeq (Darwin, $(shell uname -s)) + LDLIBS+="-Wl,-rpath,$(shell geant4-config --prefix)/lib" +endif # In case that Xerces-c and HDF5 libs are in LD_LIBRARY_PATH # add them in the LDLIBS flag. (Fixme: macOS doesn't use LD_LIBRARY_PATH)