Yes, I’ve just discovered the same problem applies to ffcx outputs because rpaths are duplicated from Python’s LDSHARED and the default $LDFLAGS. That makes removing them more complex. I believe you can fix it by setting the $LDSHARED
environment variable:
export LDSHARED="$CC -bundle -undefined dynamic_lookup"
which has some duplicate -Wl,-rpath
entries by default (see sysconfig.get_config_var("LDSHARED"
).
This won’t affect cached builds, so you’ll need to either clear your cache or patch cached files in-place with a script like this one.