link switches

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

link switches

Boost - Build mailing list
Putting the finishing touches on my fix to the serialization library
tests, I have two pesky tests left.  One is to test a shared library
plugin on unix/linix.  Boiled down to it's essentials, the jamfile looks
like:

...
lib polymorphic_derived2
     :
         polymorphic_derived2.cpp
     :
     ;
...
run test_dll_plugin : polymorphic_derived2 : <link>static:<build>no
<linkflags>-ldl ]

But I'm getting an error when I invoke the jamfile:

don't know how to make <e>polymorphc_derived2

So what am I doing wrong here?

fyi - I also got the same result with:

lib dll_polymorphic_derived2_lib
     :
         polymorphic_derived2.cpp
     :
     ;

Robert Ramey


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

Re: link switches

Boost - Build mailing list
AMDG

On 11/12/2017 03:03 PM, Robert Ramey via Boost-build wrote:

> Putting the finishing touches on my fix to the serialization library
> tests, I have two pesky tests left.  One is to test a shared library
> plugin on unix/linix.  Boiled down to it's essentials, the jamfile looks
> like:
>
> ...
> lib polymorphic_derived2
>     :
>         polymorphic_derived2.cpp
>     :
>     ;
> ...
> run test_dll_plugin : polymorphic_derived2 : <link>static:<build>no
> <linkflags>-ldl ]
>
> But I'm getting an error when I invoke the jamfile:
>
> don't know how to make <e>polymorphc_derived2
>
> So what am I doing wrong here?
>

You have the arguments for `run` in the wrong order.

http://www.boost.org/build/doc/html/bbv2/builtins/testing.html

rule run ( sources + : args * : input-files * : requirements *
  : target-name ? : default-build * )

> fyi - I also got the same result with:
>
> lib dll_polymorphic_derived2_lib
>     :
>         polymorphic_derived2.cpp
>     :
>     ;
>

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: link switches

Boost - Build mailing list
On 11/12/17 2:14 PM, Steven Watanabe via Boost-build wrote:

> AMDG
>
> On 11/12/2017 03:03 PM, Robert Ramey via Boost-build wrote:
>> Putting the finishing touches on my fix to the serialization library
>> tests, I have two pesky tests left.  One is to test a shared library
>> plugin on unix/linix.  Boiled down to it's essentials, the jamfile looks
>> like:
>>
>> ...
>> lib polymorphic_derived2
>>      :
>>          polymorphic_derived2.cpp
>>      :
>>      ;
>> ...
>> run test_dll_plugin : polymorphic_derived2 : <link>static:<build>no
>> <linkflags>-ldl ]
>>
>> But I'm getting an error when I invoke the jamfile:
>>
>> don't know how to make <e>polymorphc_derived2
>>
>> So what am I doing wrong here?
>>
>
> You have the arguments for `run` in the wrong order.
>

My mistake. I transposed this by hand from the function I actually use
which is:

rule test-bsl-run ( test-name : sources * : libs * : requirements * )

in serialization/util/test.jam.

So my actual command is

test-bsl-run test_dll_plugin : : dll_polymorphic_derived2_lib :
<link>static:<build>no <target-os>linux:<linkflags>-ldl

which should resolve to:

run test_dll_plugin : :dll_polymorphic_derived2_lib :
<link>static:<build>no <target-os>linux:<linkflags>-ldl :  test_dll_plugin

I'm confused about "sources" which I take to mean *.cpp and *.hpp files
and "input-files" which I take to mean ?  other targets.  Or should
other targets - in this case dll_polymorphic_derived2_lib be in
requirements?  In which case I don't know what "input-files" would be for.

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

Re: link switches

Boost - Build mailing list
On 11/12/17 2:35 PM, Robert Ramey via Boost-build wrote:
> On 11/12/17 2:14 PM, Steven Watanabe via Boost-build wrote:
>> AMDG

> which should resolve to:
>
> run test_dll_plugin : :dll_polymorphic_derived2_lib :
> <link>static:<build>no <target-os>linux:<linkflags>-ldl :  test_dll_plugin
>
> I'm confused about "sources" which I take to mean *.cpp and *.hpp files
> and "input-files" which I take to mean ?  other targets.  Or should
> other targets - in this case dll_polymorphic_derived2_lib be in
> requirements?  In which case I don't know what "input-files" would be for.
>

I think I'm getting this sorted out so everyone can relax.  Thanks.


> Robert Ramey
> _______________________________________________
> Unsubscribe & other changes:
> https://lists.boost.org/mailman/listinfo.cgi/boost-build
>

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

Re: link switches

Boost - Build mailing list
In reply to this post by Boost - Build mailing list
On 11/12/2017 5:35 PM, Robert Ramey via Boost-build wrote:

> On 11/12/17 2:14 PM, Steven Watanabe via Boost-build wrote:
>> AMDG
>>
>> On 11/12/2017 03:03 PM, Robert Ramey via Boost-build wrote:
>>> Putting the finishing touches on my fix to the serialization library
>>> tests, I have two pesky tests left.  One is to test a shared library
>>> plugin on unix/linix.  Boiled down to it's essentials, the jamfile looks
>>> like:
>>>
>>> ...
>>> lib polymorphic_derived2
>>>      :
>>>          polymorphic_derived2.cpp
>>>      :
>>>      ;
>>> ...
>>> run test_dll_plugin : polymorphic_derived2 : <link>static:<build>no
>>> <linkflags>-ldl ]
>>>
>>> But I'm getting an error when I invoke the jamfile:
>>>
>>> don't know how to make <e>polymorphc_derived2
>>>
>>> So what am I doing wrong here?
>>>
>>
>> You have the arguments for `run` in the wrong order.
>>
>
> My mistake. I transposed this by hand from the function I actually use
> which is:
>
> rule test-bsl-run ( test-name : sources * : libs * : requirements * )
>
> in serialization/util/test.jam.
>
> So my actual command is
>
> test-bsl-run test_dll_plugin : : dll_polymorphic_derived2_lib :
> <link>static:<build>no <target-os>linux:<linkflags>-ldl
>
> which should resolve to:
>
> run test_dll_plugin : :dll_polymorphic_derived2_lib :
> <link>static:<build>no <target-os>linux:<linkflags>-ldl :  test_dll_plugin
>
> I'm confused about "sources" which I take to mean *.cpp and *.hpp files
> and "input-files" which I take to mean ?  other targets.  Or should
> other targets - in this case dll_polymorphic_derived2_lib be in
> requirements?  In which case I don't know what "input-files" would be for.

For the "run' rule the designation "sources" means whatever files are
needed to build the final executable. The designation "input-files"
means command line parameters as the names of files passed to the final
executable on the command line when the program is run, or executed.

Since it was you who wrote the "test-bsl-run' rule, which eventually
causes the Boost Build 'run' rule to be invoked, shouldn't you yourself
know what the parameters to your own rule means ?

>
> Robert Ramey

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

Re: link switches

Boost - Build mailing list
On 11/12/17 3:15 PM, Edward Diener via Boost-build wrote:
> On 11/12/2017 5:35 PM, Robert Ramey via Boost-build wrote:
>> On 11/12/17 2:14 PM, Steven Watanabe via Boost-build wrote:

> For the "run' rule the designation "sources" means whatever files are
> needed to build the final executable. The designation "input-files"
> means command line parameters as the names of files passed to the final
> executable on the command line when the program is run, or executed.
>
> Since it was you who wrote the "test-bsl-run' rule, which eventually
> causes the Boost Build 'run' rule to be invoked, shouldn't you yourself
> know what the parameters to your own rule means ?

these are parameters to the run rule which I use.  But I didn't write
it. I'm just a user of it.

But now that you've been sucked into the discussion, what about this:

in my test code I have the following statement:

     void * hDLL;               // Handle to DLL
     hDLL = dlopen("polymorphic_derived2.so", RTLD_NOW | RTLD_GLOBAL);
     BOOST_CHECK_MESSAGE((0 != hDLL), "Failed to find/load
plugin_polymorphic_derived2" );
     BOOST_CHECK_MESSAGE((0 != hDLL), dlerror() );

Which displays the messages

test_dll_plugin.cpp(196): Failed to find/load
plugin_polymorphic_derived2 in function 'int test_main(int, char**)'

test_dll_plugin.cpp(197): polymorphic_derived2.so: cannot open shared
object file: No such file or directory in function 'int test_main(int,
char**)'

This code is meant to dynamically load the shared object named
"polymorphic_derived2.so"

It can't seem to find the shared object file named
"polymorphic_derived2.so".  OK so I went looking for it.  I found the
following:

parallels@ubuntu:/media/psf/Home/WorkingProjects/modular-boost/bin.v2/libs/serialization/test$
ls */*/*.so*

gcc-gnu-4.8/debug/libpolymorphic_derived2.so.1.66.0
gcc-gnu-4.8/release/libpolymorphic_derived2.so.1.66.0

which look to be the correct files several directory levels above the
tests. They also have unexpected names.  How is my test program supposed
to find these?  What should I do differently?

Robert Ramey

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

Re: link switches

Boost - Build mailing list
AMDG

On 11/12/2017 05:20 PM, Robert Ramey via Boost-build wrote:

>
> But now that you've been sucked into the discussion, what about this:
>
> in my test code I have the following statement:
>
>     void * hDLL;               // Handle to DLL
>     hDLL = dlopen("polymorphic_derived2.so", RTLD_NOW | RTLD_GLOBAL);
>     BOOST_CHECK_MESSAGE((0 != hDLL), "Failed to find/load
> plugin_polymorphic_derived2" );
>     BOOST_CHECK_MESSAGE((0 != hDLL), dlerror() );
>
> Which displays the messages
>
> test_dll_plugin.cpp(196): Failed to find/load
> plugin_polymorphic_derived2 in function 'int test_main(int, char**)'
>
> test_dll_plugin.cpp(197): polymorphic_derived2.so: cannot open shared
> object file: No such file or directory in function 'int test_main(int,
> char**)'
> <snip>
>   How is my test program supposed
> to find these?  What should I do differently?
>

  Pass the shared library as an 'input-file' and get the
name from the command line inside the test program.

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: link switches

Boost - Build mailing list
On 11/12/17 4:31 PM, Steven Watanabe via Boost-build wrote:

> AMDG
>
> On 11/12/2017 05:20 PM, Robert Ramey via Boost-build wrote:
>>
>> But now that you've been sucked into the discussion, what about this:
>>
>> in my test code I have the following statement:
>>
>>      void * hDLL;               // Handle to DLL
>>      hDLL = dlopen("polymorphic_derived2.so", RTLD_NOW | RTLD_GLOBAL);
>>      BOOST_CHECK_MESSAGE((0 != hDLL), "Failed to find/load
>> plugin_polymorphic_derived2" );
>>      BOOST_CHECK_MESSAGE((0 != hDLL), dlerror() );
>>
>> Which displays the messages
>>
>> test_dll_plugin.cpp(196): Failed to find/load
>> plugin_polymorphic_derived2 in function 'int test_main(int, char**)'
>>
>> test_dll_plugin.cpp(197): polymorphic_derived2.so: cannot open shared
>> object file: No such file or directory in function 'int test_main(int,
>> char**)'
>> <snip>
>>    How is my test program supposed
>> to find these?  What should I do differently?
>>
>
>    Pass the shared library as an 'input-file' and get the
> name from the command line inside the test program.

OK - but how does one get the name of the shared library file from
within b2?  In this case it would be : libpolymorphic_derived2.so.1.66.0


>
> In Christ,
> Steven Watanabe
>
> _______________________________________________
> Unsubscribe & other changes: https://lists.boost.org/mailman/listinfo.cgi/boost-build
>


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

Re: link switches

Boost - Build mailing list
AMDG

On 11/12/2017 10:16 PM, Robert Ramey via Boost-build wrote:
> On 11/12/17 4:31 PM, Steven Watanabe via Boost-build wrote:
>>
>>    Pass the shared library as an 'input-file' and get the
>> name from the command line inside the test program.
>
> OK - but how does one get the name of the shared library file from
> within b2?  In this case it would be : libpolymorphic_derived2.so.1.66.0
>

  You don't need to.  The input-files argument expects
a target.  b2 will automatically resolve it to the
actual file name.

In Christ,
Steven Watanabe

_______________________________________________
Unsubscribe & other changes: https://lists.boost.org/mailman/listinfo.cgi/boost-build