File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -53,6 +53,12 @@ libmesh_LIBS := $(shell METHOD=$(METHOD) $(libmesh_config) --libs)
5353libmesh_HOST := $(shell METHOD=$(METHOD ) $(libmesh_config ) --host)
5454libmesh_LDFLAGS := $(shell METHOD=$(METHOD ) $(libmesh_config ) --ldflags)
5555
56+ # Deduplicate rpath flags; libmesh-config --libs embeds rpaths from each bundled
57+ # dependency (libmesh, timpi, petsc) that share an installation prefix, producing
58+ # duplicate -rpath entries that macOS ld warns about.
59+ libmesh_LIBS := $(shell printf '% s\n' $(libmesh_LIBS ) | awk '!seen[$$0]++' | tr '\n' ' ')
60+ libmesh_LDFLAGS := $(shell printf '% s\n' $(libmesh_LDFLAGS ) | awk '!seen[$$0]++' | tr '\n' ' ')
61+
5662# In the event that we're using something like mpicxx, query it for
5763# the underlying compiler (like mpicxx -show); otherwise, fallback to
5864# whatever libmesh_CXX is
Original file line number Diff line number Diff line change @@ -211,6 +211,10 @@ else
211211 PYMOD_COMPILEFLAGS := -L$(shell $(pyconfig) --prefix)/lib -Wl,-rpath,$(shell $(pyconfig) --prefix)/lib $(shell $(pyconfig) --includes)
212212endif
213213
214+ # Deduplicate rpath flags accumulated from wasp, MFEM, NEML2, etc. to suppress
215+ # duplicate -rpath linker warnings on macOS when dependencies share an install prefix.
216+ libmesh_LDFLAGS := $(shell printf '% s\n' $(libmesh_LDFLAGS ) | awk '!seen[$$0]++' | tr '\n' ' ')
217+
214218$(pyhit_srcfiles ) $(hit_CLI_srcfiles ) : | prebuild
215219
216220pyhit_LIB := $(HIT_DIR ) /hit.$(PYMOD_EXTENSION )
You can’t perform that action at this time.
0 commit comments