Skip to content

Failure with RPATH linking

I used Linux and gcc. I had my own scotch library. In ~/.OpenFOAM/config.sh/scotch I had

SCOTCH_VERSION=scotch-system
export SCOTCH_ARCH_PATH=/path/to/myscotch

I could successfully build libscotchDecomp.so. A snippet from the output of Allwmake was

g++ -std=c++14 -m64  ...  -L/path/to/myscotch/lib -lscotch -lscotcherrexit -lrt  -o /ccs/home/jczhang/openfoam/platforms/linux64GccDPInt32Opt/lib/libscotchDecomp.so

Notably there was no -rpath in the link options. Later in building other .so, Allwmake reported errors complaining it could not find libscotch.so needed by libscotchDecomp.so and suggested using -rapth or-rpath-link. I added export WM_COMPILE_CONTROL="+rpath" in ~/.OpenFOAM/prefs.sh but it did not help.

It seems to me openfoam does not support RPATH for user supplied third-party libraries. Is it right?