[python] exec test question

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

[python] exec test question

Vladimir Prus

Dave,
in Boost.Python testsuite, there's test 'exec' defined like this:

 run ../test/exec.cpp <lib>../build/boost_python
      : # program args
      : exec.py
      : # requirements
      $(PYTHON_PROPERTIES)
        <define>BOOST_PYTHON_STATIC_LIB
        <define>BOOST_PYTHON_STATIC_MODULE


Is static linking to Boost.Python intended here specifically, say, because the test
will never work with dynamic linking, or just to test static linking?

I'm asking because in V2, that uses dynamic linking in this test, the following link
error is produced:

   exec.obj : error LNK2019: unresolved external symbol "class
   boost::python::api::object __cdecl boost::python::exec(

See:

  http://tinyurl.com/hxo2t


I'm about to change V2 Jamfile to use static linking, but wanted to check
with you that static linking is indeed required and that the above error is
not V2 fault.

Thanks,
Volodya
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|

Re: [python] exec test question

David Abrahams
Vladimir Prus <[hidden email]> writes:

> Dave,
> in Boost.Python testsuite, there's test 'exec' defined like this:
>
>  run ../test/exec.cpp <lib>../build/boost_python
>       : # program args
>       : exec.py
>       : # requirements
>       $(PYTHON_PROPERTIES)
>         <define>BOOST_PYTHON_STATIC_LIB
>         <define>BOOST_PYTHON_STATIC_MODULE
>
>
> Is static linking to Boost.Python intended here specifically, say, because the test
> will never work with dynamic linking, or just to test static linking?

The latter.

> I'm asking because in V2, that uses dynamic linking in this test, the following link
> error is produced:
>
>    exec.obj : error LNK2019: unresolved external symbol "class
>    boost::python::api::object __cdecl boost::python::exec(
>
> See:
>
>   http://tinyurl.com/hxo2t
>
>
> I'm about to change V2 Jamfile to use static linking, but wanted to check
> with you that static linking is indeed required and that the above error is
> not V2 fault.

It seems unlikely that it's v2's fault, but static linking is not
supposed to be required.  The easy way to test it is to build the same
test in v1 using dynamic linking:

  run ../test/exec.cpp <dll>../build/boost_python
      : : exec.py : $(PYTHON_PROPERTIES)
      <define>BOOST_PYTHON_STATIC_MODULE ;

(I think)

--
Dave Abrahams
Boost Consulting
www.boost-consulting.com

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost