recursively call unit test executable

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

recursively call unit test executable

Boost - Build mailing list
hi all,

i'm currently having some trouble with b2: to test lockfree with
interprocess, i'm calling the executable itself:

https://github.com/boostorg/lockfree/blob/master/test/queue_interprocess_test.cpp#L38

`std::system()` isn't able to resolve the dynamic libraries, so it fails
with:
> dyld: Library not loaded: libboost_chrono.dylib
>   Referenced from: /Users/tim/dev/boost/libs/lockfree/test/../../../bin.v2/libs/lockfree/test/queue_interprocess_test.test/darwin-4.2.1/debug/threadapi-pthread/threading-multi/visibility-hidden/queue_interprocess_test
>   Reason: image not found

this seems to be the case because the binaries lack the rpath:
> 13:36 $ otool -L ../../../bin.v2/libs/lockfree/test/queue_interprocess_test.test/darwin-4.2.1/debug/threadapi-pthread/threading-multi/visibility-hidden/queue_interprocess_test
> ../../../bin.v2/libs/lockfree/test/queue_interprocess_test.test/darwin-4.2.1/debug/threadapi-pthread/threading-multi/visibility-hidden/queue_interprocess_test:
> libboost_chrono.dylib (compatibility version 0.0.0, current version 0.0.0)
> libboost_unit_test_framework.dylib (compatibility version 0.0.0, current version 0.0.0)
> libboost_thread.dylib (compatibility version 0.0.0, current version 0.0.0)
> libboost_system.dylib (compatibility version 0.0.0, current version 0.0.0)
> libboost_atomic.dylib (compatibility version 0.0.0, current version 0.0.0)
> /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 400.9.4)
> /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.200.5)


any idea how to make this work?

tia,
tim
_______________________________________________
Unsubscribe & other changes: https://lists.boost.org/mailman/listinfo.cgi/boost-build
Reply | Threaded
Open this post in threaded view
|

Re: recursively call unit test executable

Boost - Build mailing list
AMDG

On 11/04/2018 01:59 AM, Tim Blechmann via Boost-build wrote:

> i'm currently having some trouble with b2: to test lockfree with
> interprocess, i'm calling the executable itself:
>
> https://github.com/boostorg/lockfree/blob/master/test/queue_interprocess_test.cpp#L38
>
> `std::system()` isn't able to resolve the dynamic libraries, so it fails
> with:
>> dyld: Library not loaded: libboost_chrono.dylib
>>   Referenced from: /Users/tim/dev/boost/libs/lockfree/test/../../../bin.v2/libs/lockfree/test/queue_interprocess_test.test/darwin-4.2.1/debug/threadapi-pthread/threading-multi/visibility-hidden/queue_interprocess_test
>>   Reason: image not found
>
> this seems to be the case because the binaries lack the rpath:
>> 13:36 $ otool -L ../../../bin.v2/libs/lockfree/test/queue_interprocess_test.test/darwin-4.2.1/debug/threadapi-pthread/threading-multi/visibility-hidden/queue_interprocess_test
>> ../../../bin.v2/libs/lockfree/test/queue_interprocess_test.test/darwin-4.2.1/debug/threadapi-pthread/threading-multi/visibility-hidden/queue_interprocess_test:
>> libboost_chrono.dylib (compatibility version 0.0.0, current version 0.0.0)
>> libboost_unit_test_framework.dylib (compatibility version 0.0.0, current version 0.0.0)
>> libboost_thread.dylib (compatibility version 0.0.0, current version 0.0.0)
>> libboost_system.dylib (compatibility version 0.0.0, current version 0.0.0)
>> libboost_atomic.dylib (compatibility version 0.0.0, current version 0.0.0)
>> /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 400.9.4)
>> /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.200.5)
>
>
> any idea how to make this work?
>

The executable runs because DYLD_LIBRARY_PATH is set.
Is this somehow not being inherited or is system() not
respecting it?

Possible workarounds:
- <hardcode-dll-paths>on or,
- <link>static

In Christ,
Steven Watanabe
_______________________________________________
Unsubscribe & other changes: https://lists.boost.org/mailman/listinfo.cgi/boost-build
Reply | Threaded
Open this post in threaded view
|

Re: recursively call unit test executable

Boost - Build mailing list
>> `std::system()` isn't able to resolve the dynamic libraries, so it fails
>> with:
>>> dyld: Library not loaded: libboost_chrono.dylib
>>>   Referenced from: /Users/tim/dev/boost/libs/lockfree/test/../../../bin.v2/libs/lockfree/test/queue_interprocess_test.test/darwin-4.2.1/debug/threadapi-pthread/threading-multi/visibility-hidden/queue_interprocess_test
>>>   Reason: image not found
[snip]
> The executable runs because DYLD_LIBRARY_PATH is set.
> Is this somehow not being inherited or is system() not
> respecting it?
>
> Possible workarounds:
> - <hardcode-dll-paths>on or,
> - <link>static

actually i was using `hardcode-dll-paths`, but didn't have an effect ...
`static` linking works, will go that route ... thanks a lot!
_______________________________________________
Unsubscribe & other changes: https://lists.boost.org/mailman/listinfo.cgi/boost-build