OSX and rpath problem with tests

66 views
Skip to first unread message

Garth N. Wells

unread,
Nov 13, 2015, 5:00:41 PM11/13/15
to fenic...@googlegroups.com
Since very recently, on OSX when it do 

    make run_unittests_py

I get  the error

library not loaded: @rpath/libdolfin.1.7.dylib
E     Referenced from: /Users/garth/code/fenics/dev/dolfin.d/dolfin-master/local.master/lib/python2.7/site-packages/dolfin/cpp/_common.so
E     Reason: image not found

I don't get the error if I run the tests from test/unit/python.

Any ideas what the problem is? (yes, I know the OSX dev toolchain is rubbish).

Garth

Johannes Ring

unread,
Nov 16, 2015, 3:20:20 AM11/16/15
to fenic...@googlegroups.com
Try to run this:

otool -L /Users/garth/code/fenics/dev/dolfin.d/dolfin-master/local.master/lib/python2.7/site-packages/dolfin/cpp/_common.so

I assume it is has not set rpath to BOOST and/or VTK libraries. This is currently the fix we have for this:

https://bitbucket.org/fenics-project/fenics-developer-tools/src/e08898740acc9bf0698637f55d4cadd5db256c3b/install/patches/hashstack-dolfin-osx-rpath-fix.patch

Johannes

--
You received this message because you are subscribed to the Google Groups "fenics-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fenics-dev+...@googlegroups.com.
To post to this group, send email to fenic...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Chris Richardson

unread,
Nov 16, 2015, 4:08:00 AM11/16/15
to fenic...@googlegroups.com

Q&A forum also seems to be rejecting gmail addresses.

http://fenicsproject.org/qa/8561/fenics-forum-sending-notification-email-comments-answers

I guess the server's mail configuration may need checking.

Chris

Garth N. Wells

unread,
Nov 23, 2015, 4:26:54 PM11/23/15
to fenic...@googlegroups.com
On 16 November 2015 at 08:20, Johannes Ring <joh...@simula.no> wrote:
Try to run this:

otool -L /Users/garth/code/fenics/dev/dolfin.d/dolfin-master/local.master/lib/python2.7/site-packages/dolfin/cpp/_common.so

I assume it is has not set rpath to BOOST and/or VTK libraries. This is currently the fix we have for this:

https://bitbucket.org/fenics-project/fenics-developer-tools/src/e08898740acc9bf0698637f55d4cadd5db256c3b/install/patches/hashstack-dolfin-osx-rpath-fix.patch


I disabled VTK to limit the number of libraries:

otool -L /Users/garth/code/fenics/dev/dolfin.d/dolfin-master/local.master/lib/python2.7/site-packages/dolfin/cpp/_common.so
/Users/garth/code/fenics/dev/dolfin.d/dolfin-master/local.master/lib/python2.7/site-packages/dolfin/cpp/_common.so:
@rpath/libdolfin.1.7.dylib (compatibility version 1.7.0, current version 1.7.0)
/usr/local/Frameworks/Python.framework/Versions/2.7/Python (compatibility version 2.7.0, current version 2.7.0)
/usr/local/opt/boost/lib/libboost_filesystem-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
/usr/local/opt/boost/lib/libboost_program_options-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
/usr/local/opt/boost/lib/libboost_system-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
/usr/local/opt/boost/lib/libboost_thread-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
/usr/local/opt/boost/lib/libboost_iostreams-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
/usr/local/opt/boost/lib/libboost_timer-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
/usr/local/lib/libhdf5.10.dylib (compatibility version 11.0.0, current version 11.1.0)
/usr/local/lib/libsz.2.dylib (compatibility version 3.0.0, current version 3.0.0)
/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.5)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1225.1.1)
/Users/garth/local/src/slepc/installed-arch-darwin-c-opt/lib/libslepc.3.06.dylib (compatibility version 3.6.0, current version 3.6.2)
/Users/garth/local/src/petsc/arch-darwin-c-opt/lib/libpetsc.3.06.dylib (compatibility version 3.6.0, current version 3.6.2)
/System/Library/Frameworks/Accelerate.framework/Versions/A/Accelerate (compatibility version 1.0.0, current version 4.0.0)
/Users/garth/local/packages/petsc/lib/libparmetis.dylib (compatibility version 0.0.0, current version 0.0.0)
/Users/garth/local/packages/petsc/lib/libmetis.dylib (compatibility version 0.0.0, current version 0.0.0)
/usr/local/lib/libcppunit-1.13.0.dylib (compatibility version 1.0.0, current version 1.2.0)
/usr/local/lib/libmpicxx.12.dylib (compatibility version 13.0.0, current version 13.5.0)
/usr/local/lib/libmpi.12.dylib (compatibility version 13.0.0, current version 13.5.0)
/usr/local/lib/libpmpi.12.dylib (compatibility version 13.0.0, current version 13.5.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.1.0)

The change could have come with the update to CMake 3.4.0.

Garth

Johannes Ring

unread,
Nov 24, 2015, 5:31:50 AM11/24/15
to fenic...@googlegroups.com
I think the change came with the latest OS X and/or latest Xcode, where you have to specify the full path to all runtime libraries (or reference them using @rpath, @loader_path or @executable_path). Setting DYLD_* variables does no longer work. Your output from "otool -L" looks fine, but you should also run "otool -L" on the libraries in this list, to make sure they are fine too...

To make it work in HashStack, we had to use install_name_tool to fix the BOOST and VTK libraries:

https://github.com/hashdist/hashstack/commit/43b42d

We also had to set -DCMAKE_MACOSX_RPATH:BOOL=ON for DOLFIN and some other CMake based packages.

Johannes

Anders Logg

unread,
Nov 24, 2015, 5:34:49 AM11/24/15
to fenic...@googlegroups.com
@Garth, you should use the hashdist scripts (fenics-install-foo.sh). Then this is taken care of... ;-)

--
Anders


tis 24 nov. 2015 kl 11:31 skrev Johannes Ring <joh...@simula.no>:
I think the change came with the latest OS X and/or latest Xcode, where you have to specify the full path to all runtime libraries (or reference them using @rpath, @loader_path or @executable_path). Setting DYLD_* variables does no longer work. Your output from "otool -L" looks fine, but you should also run "otool -L" on the libraries in this list, to make sure they are fine too...

To make it work in HashStack, we had to use install_name_tool to fix the BOOST and VTK libraries:

https://github.com/hashdist/hashstack/commit/43b42d

We also had to set -DCMAKE_MACOSX_RPATH:BOOL=ON for DOLFIN and some other CMake based packages.

Johannes

Garth N. Wells

unread,
Nov 24, 2015, 5:51:30 AM11/24/15
to fenic...@googlegroups.com
On 24 November 2015 at 10:34, Anders Logg <ander...@gmail.com> wrote:
@Garth, you should use the hashdist scripts (fenics-install-foo.sh). Then this is taken care of... ;-)


Yes, but then it might fail building OpenSSL when I just want to solve PDEs . . . . 

Garth

Garth N. Wells

unread,
Nov 24, 2015, 6:13:32 PM11/24/15
to fenic...@googlegroups.com
On 24 November 2015 at 10:31, Johannes Ring <joh...@simula.no> wrote:
I think the change came with the latest OS X and/or latest Xcode, where you have to specify the full path to all runtime libraries (or reference them using @rpath, @loader_path or @executable_path). Setting DYLD_* variables does no longer work. Your output from "otool -L" looks fine, but you should also run "otool -L" on the libraries in this list, to make sure they are fine too...


I checked, and the libs look fine.

I can run Python code, just no longer via the CMake target 'make run_unittests_py', which makes me think something may have changed in CMake.

Garth

Garth N. Wells

unread,
Dec 3, 2015, 5:53:44 PM12/3/15
to fenic...@googlegroups.com
Looks like the problem could be due to  a change in OSX  that clears DYLD_foo when running a scripts, e.g. make:


Garth

On 24 November 2015 at 10:31, Johannes Ring <joh...@simula.no> wrote:
Reply all
Reply to author
Forward
0 new messages