Skip to content

Commit c3ca748

Browse files
Merge pull request #125 from PFLAREProject/mac_tests
Remove trailing colon in rpath for mac tests
2 parents 43c8f86 + bbbd1a7 commit c3ca748

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,13 @@ SYCLC_FLAGS += $(SYCLC_FLAGS_INPUT)
147147
ifeq ($(PETSC_USE_SHARED_LIBRARIES),0)
148148
OUT = $(LIBDIR)/libpflare.a
149149
else
150+
# mac osx name is different
151+
ifeq ($(shell uname -s 2>/dev/null),Darwin)
152+
OUT = $(LIBDIR)/libpflare.dylib
153+
else
150154
OUT = $(LIBDIR)/libpflare.so
151155
endif
156+
endif
152157

153158
# Dependency generation with makedepf90
154159
DEPFILE = Makefile.deps

tests/Makefile

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,17 @@ CPPFLAGS += $(CPPFLAGS_INPUT)
3333
FPPFLAGS += $(FPPFLAGS_INPUT)
3434

3535
# Link to pflare - order is important
36-
LDLIBS := -L$(LIBDIR) -lpflare -Wl,-rpath,$(LIBDIR):$(LDLIBS)
36+
LDFLAGS += -Wl,-rpath,$(LIBDIR)
37+
LDLIBS += -L$(LIBDIR) -lpflare
38+
39+
EXISTING_LD := $(LD_LIBRARY_PATH)
40+
EXISTING_DYLD := $(DYLD_FALLBACK_LIBRARY_PATH)
41+
42+
ifeq ($(shell uname -s 2>/dev/null),Darwin)
43+
export DYLD_FALLBACK_LIBRARY_PATH=$(LIBDIR)$(if $(EXISTING_DYLD),:$(EXISTING_DYLD))
44+
else
45+
export LD_LIBRARY_PATH=$(LIBDIR)$(if $(EXISTING_LD),:$(EXISTING_LD))
46+
endif
3747

3848
clean::
3949
$(RM) -f $(TEST_TARGETS)

0 commit comments

Comments
 (0)