[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


From: Daniel Müllner
Subject: Bug in AX_BOOST_PYTHON
Date: Fri, 12 Sep 2014 22:32:32 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:32.0) Gecko/20100101 Firefox/32.0

Dear Peter,

we corresponded a while ago about several fixes in AX_BOOST_PYTHON, which I
wrote to make this macro behave correctly on Arch Linux. Now there is another
issue. I haven't found a way to submit a bug report without offering a patch,
so I am writing to you directly.

If Python3 is used and LDFLAGS contains the linker flag "-Wl,--as-needed" (as
is does by default in the Arch Linux build system), AX_BOOST_PYTHON does not
find the right boost_python library. 

Currently, AX_BOOST_PYTHON calls AC_CHECK_LIB for a couple of possible library
names, in my case boost_python and boost_python3.

If -Wl,--as-needed is not set, the linker notices that the small test program
doesn't get linked with the flags "-lboost_python -lpython3.4m" and continues
with -lboost_python3, which finally succeeds. However, if -Wl,--as-needed is
set, the linker processes the test program successfully with the flags
"-lboost_python -lpython3.4m", so that the Boost Python library is wrongly set
to the Python2 variant.

The problem is that AC_CHECK_LIB tries to compile and link a generic C++
program with no Boost Python function whatsoever. Hence, since there is no
Boost::Python function used in the compiled code, the linker doesn't need
anything from the boost_python(3) library.

Instead of linking the current C++ code

#ifdef __cplusplus
extern "C"
char exit ();
main ()
return exit ();
  return 0;

the following code (or similar) should be used to test the linker flags:

#include <boost/python/module.hpp>
main ()
  return 0;

I don't know how to do this since AC_CHECK_LIB is not made for this purpose.
Can you help me (respectively, many Arch Linux users)?

Best regards,


  Nachricht gesendet von/durch Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]