List Info

Thread: Re:




Re:
user name
2007-05-29 09:57:08



Since you haven't asked for any specific advice, all I can do is suggest
that you read Boost.Build docs (http://boost.org/boost-build2), and
ask specific questions when you have any.

 All right: first question.

I have two shared libraries. The first one links to the second one, i.e.:

lib Vehicle : VEHICLE_SOURCE : <link&gt;shared ;
lib Car : CAR_SOURCE Vehicle : <link&gt;shared ;

install ../bin :
  Vehicle Car :
  <install-dependencies>on
&nbsp; ;

The Car library will not load on OS X or Linux, because it cannot find the Vehicle library - even though they are in the same directory. On Linux, this was fixed by setting the LD_LIBRARY_PATH (this would probably work on OS X as well). I can also fix it on OS X by copying Vehicle.dylib to ../bin/bin/darwin/debug/ (or release, depending on the variant). I need to get them to see each other when they are in the same directory - it is a bit of a waste to have two copies of Vehicle.

You can see the example that requires this in the sandbox/libs/extension/examples/ folder. I did find some setting that sounded as if it would take care of it - but it didn't work on OS X (haven';t tried it on Linux yet).

Any ideas?

Jeremy

Re:
user name
2007-05-30 02:41:45
On 5/29/07, Jeremy Pack <rostovpackgmail.com> wrote:
> I have two shared libraries. The first one links to the
second one, i.e.:
>
> lib Vehicle : VEHICLE_SOURCE : <link>shared ;
> lib Car : CAR_SOURCE Vehicle : <link>shared ;
>
> install ../bin :
>   Vehicle Car :
>   <install-dependencies>on
>   ;
>
> The Car library will not load on OS X or Linux, because
it cannot find the
> Vehicle library - even though they are in the same
directory. On Linux, this
> was fixed by setting the LD_LIBRARY_PATH (this would
probably work on OS X
> as well). I can also fix it on OS X by copying
Vehicle.dylib to
> ../bin/bin/darwin/debug/ (or release, depending on the
variant). I need to
> get them to see each other when they are in the same
directory - it is a bit
> of a waste to have two copies of Vehicle.

One thing I did was to install all binaries and shared
libraries to
the same staging directory and added

<linkflags>"-Wl,-rpath,'$ORIGIN'"

globally to my Jamroot in the top-level project. That sets
up the ELF
headers for all targets to that they will consider the
executable's
directory when looking for shared libraries. This can be
very
convenient for development, but I don't know if boost.build
supports
this natively. Note that this works if you move the binary
and
libraries away too as it's determined at runtime by ld.so.

Hope this helps,
Andreas
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )