Unable to build boost python library in 1.46.1

I am trying to build the Boost 1.46.1 libraries on a Fedora 7 Linux system with the default g++ 4.1.2 and Python 2.5. The compilations do not find the python headers, producing a zillion error messages starting with one like this: In file included from ./boost/python/detail/prefix.hpp:13, from ./boost/python/converter/registrations.hpp:8, from libs/python/src/object/function_doc_signature.cpp:9: ./boost/python/detail/wrap_python.hpp:50:23: error: pyconfig.h: No such file or directory The reported compilation command looks like this: "/usr/bin/g++" -ftemplate-depth-128 -O3 -finline-functions -Wno-inline -Wall -fPIC -fno-strict-aliasing -fno-tree-ccp -march=opteron -pthread -fPIC -m64 -DBOOST_ALL_NO_LIB=1 -DBOOST_PYTHON_SOURCE -DNDEBUG -I"." -c -o "bin.v2/libs/python/build/gcc-4.1.2/release/address-model-64/instruction-set-opteron/threading-multi/object/function_doc_signature.o" "libs/python/src/object/function_doc_signature.cpp" I tried to follow the latest Getting Started instructions, which changed a bit from the last version I built (1.44.0) to build bjam: cd tools/build/v2 bootstrap.sh bjam install --prefix=../../.. cd ../../.. bin/bjam --user-config=user-config.LINUX_AMDF7 threading=multi instruction-set=opteron address-model=64 variant=release link=static,shared --stagedir=stageF7 stage My user-config.LINUX_AMDF7 file contains this: using gcc : 4.1.2 : /usr/bin/g++ : <compileflags>"-fPIC -fno-strict-aliasing -fno-tree-ccp" <linkflags>"-fPIC -fno-strict-aliasing -fno-tree-ccp" ; using python : 2.5 : /usr ; Can someone explain why the compilations are not getting the correct include path for Python (/usr/include/python2.5/)? BTW, the Getting Started page http://www.boost.org/doc/libs/1_46_1/more/getting_started/unix-variants.html in section 5.2.1 step 2 tells me to "Run bootstrap.bat". -- Dick Hadsell 203-992-6320 Fax: 203-992-6001 Reply-to: hadsell@blueskystudios.com Blue Sky Studios http://www.blueskystudios.com 1 American Lane, Greenwich, CT 06831-2560

At Thu, 24 Mar 2011 18:33:43 -0400, Richard Hadsell wrote:
I tried to follow the latest Getting Started instructions, which changed a bit from the last version I built (1.44.0) to build bjam:
cd tools/build/v2 bootstrap.sh bjam install --prefix=../../.. cd ../../.. bin/bjam --user-config=user-config.LINUX_AMDF7 threading=multi instruction-set=opteron address-model=64 variant=release link=static,shared --stagedir=stageF7 stage
If you add --debug-configuration to your bjam command-line, it should be revealing.
My user-config.LINUX_AMDF7 file contains this:
using gcc : 4.1.2 : /usr/bin/g++ : <compileflags>"-fPIC -fno-strict-aliasing -fno-tree-ccp" <linkflags>"-fPIC -fno-strict-aliasing -fno-tree-ccp" ; using python : 2.5 : /usr ;
Can someone explain why the compilations are not getting the correct include path for Python (/usr/include/python2.5/)?
BTW, the Getting Started page http://www.boost.org/doc/libs/1_46_1/more/getting_started/unix-variants.html in section 5.2.1 step 2 tells me to "Run bootstrap.bat".
That's a problem; could you please file a bug report at http://svn.boost.org? Thanks, -- Dave Abrahams BoostPro Computing http://www.boostpro.com

Dave Abrahams wrote:
At Thu, 24 Mar 2011 18:33:43 -0400, Richard Hadsell wrote:
I tried to follow the latest Getting Started instructions, which changed a bit from the last version I built (1.44.0) to build bjam:
cd tools/build/v2 bootstrap.sh bjam install --prefix=../../.. cd ../../.. bin/bjam --user-config=user-config.LINUX_AMDF7 threading=multi instruction-set=opteron address-model=64 variant=release link=static,shared --stagedir=stageF7 stage
If you add --debug-configuration to your bjam command-line, it should be revealing.
Running this command: bin/bjam --user-config=user-config.LINUX_AMDF7 --debug-configuration threading=multi instruction-set=opteron address-model=64 variant=release link=static,shared --stagedir=stageF7 stage | & tee build.release.log here is the first part of the log: notice: found boost-build.jam at /netDISKS/cgi/LINUX_AMD64/cgi/vendor/library/boost/boost_1_46_1/boost-build.jam notice: loading Boost.Build from /netDISKS/cgi/LINUX_AMD64/cgi/vendor/library/boost/boost_1_46_1/tools/build/v2 notice: Searching /etc /u/hadsell /netDISKS/cgi/LINUX_AMD64/cgi/vendor/library/boost/boost_1_46_1/tools/build/v2 /usr/share/boost-build /netDISKS/cgi/LINUX_AMD64/cgi/vendor/library/boost/boost_1_46_1/tools/build/v2/kernel /netDISKS/cgi/LINUX_AMD64/cgi/vendor/library/boost/boost_1_46_1/tools/build/v2/util /netDISKS/cgi/LINUX_AMD64/cgi/vendor/library/boost/boost_1_46_1/tools/build/v2/build /netDISKS/cgi/LINUX_AMD64/cgi/vendor/library/boost/boost_1_46_1/tools/build/v2/tools /netDISKS/cgi/LINUX_AMD64/cgi/vendor/library/boost/boost_1_46_1/tools/build/v2/contrib /netDISKS/cgi/LINUX_AMD64/cgi/vendor/library/boost/boost_1_46_1/tools/build/v2/. for site-config configuration file site-config.jam . notice: Loading site-config configuration file site-config.jam from /netDISKS/cgi/LINUX_AMD64/cgi/vendor/library/boost/boost_1_46_1/tools/build/v2/site-config.jam . notice: Loading explicitly specified user configuration file: /netDISKS/cgi/LINUX_AMD64/cgi/vendor/library/boost/boost_1_46_1/user-config.LINUX_AMDF7 notice: Searching /netDISKS/cgi/LINUX_AMD64/cgi/vendor/library/boost/boost_1_46_1 for user-config configuration file user-config.LINUX_AMDF7 . notice: Loading user-config configuration file user-config.LINUX_AMDF7 from /netDISKS/cgi/LINUX_AMD64/cgi/vendor/library/boost/boost_1_46_1/user-config.LINUX_AMDF7 . notice: will use '/usr/bin/g++' for gcc, condition <toolset>gcc-4.1.2 notice: using gcc libraries :: <toolset>gcc-4.1.2 :: /usr/bin /usr/lib /usr/lib32 /usr/lib64 notice: using gcc archiver :: <toolset>gcc-4.1.2 :: /usr/bin/ar notice: using gcc ranlib :: <toolset>gcc-4.1.2 :: /usr/bin/ranlib warning: toolset gcc initialization: can not find tool windres warning: initialized from /netDISKS/cgi/LINUX_AMD64/cgi/vendor/library/boost/boost_1_46_1/tools/build/v2/build/project.jam:886 notice: using rc compiler :: <toolset>gcc-4.1.2 :: /usr/bin/as notice: [python-cfg] Configuring python... notice: [python-cfg] user-specified version: "2.5" notice: [python-cfg] user-specified cmd-or-prefix: "/usr" notice: [python-cfg] Checking interpreter command "/usr/bin/python2.5"... notice: [python-cfg] running command '"/usr/bin/python2.5" -c "from sys import *; print('version=%d.%d\nplatform=%s\nprefix=%s\nexec_prefix=%s\nexecutable=%s' % (version_info[0],version_info[1],platform,prefix,exec_prefix,executable))" 2>&1' notice: [python-cfg] ...requested configuration matched! notice: [python-cfg] Details of this Python configuration: notice: [python-cfg] interpreter command: "/usr/bin/python2.5" notice: [python-cfg] include path: "/usr/include/python2.5" notice: [python-cfg] library path: "/usr/lib/python2.5/config" "/usr/lib" notice: Searching for project-config configuration file project-config.jam . notice: Loading project-config configuration file project-config.jam from project-config.jam . notice: [python-cfg] Configuring python... notice: [python-cfg] user-specified version: "2.5" notice: [python-cfg] user-specified cmd-or-prefix: "/usr" notice: [python-cfg] Checking interpreter command "/usr/bin/python2.5"... notice: [python-cfg] running command '"/usr/bin/python2.5" -c "from sys import *; print('version=%d.%d\nplatform=%s\nprefix=%s\nexec_prefix=%s\nexecutable=%s' % (version_info[0],version_info[1],platform,prefix,exec_prefix,executable))" 2>&1' notice: [python-cfg] ...requested configuration matched! notice: [python-cfg] Details of this Python configuration: notice: [python-cfg] interpreter command: "/usr/bin/python2.5" notice: [python-cfg] include path: "/usr/include/python2.5" notice: [python-cfg] library path: "/usr/lib/python2.5/config" "/usr/lib" notice: iostreams: using prebuilt zlib notice: iostreams: using prebuilt bzip2 Performing configuration checks - has_icu builds : no warning: Graph library does not contain MPI-based parallel components. note: to enable them, add "using mpi ;" to your user-config.jam - ../config//has_gcc_visibility builds : yes - ../config//has_long_double_support builds : yes warning: skipping optional Message Passing Interface (MPI) library. note: to enable MPI support, add "using mpi ;" to user-config.jam. note: to suppress this message, pass "--without-mpi" to bjam. note: otherwise, you can safely ignore this message. error: No best alternative for /python_for_extensions next alternative: required properties: <python>2.5 <target-os>linux matched next alternative: required properties: <python>2.5 <target-os>linux matched error: No best alternative for /python_for_extensions next alternative: required properties: <python>2.5 <target-os>linux matched next alternative: required properties: <python>2.5 <target-os>linux matched Component configuration: - date_time : building - filesystem : building - graph : building - graph_parallel : building - iostreams : building - math : building - mpi : building - program_options : building - python : building - random : building - regex : building - serialization : building - signals : building - system : building - test : building - thread : building - wave : building ...patience... ...patience... ...patience... ...found 6582 targets... ...updating 62 targets... gcc.compile.c++ bin.v2/libs/python/build/gcc-4.1.2/release/address-model-64/instruction-set-opteron/link-static/threading-multi/numeric.o In file included from ./boost/python/detail/prefix.hpp:13, from ./boost/python/numeric.hpp:8, from libs/python/src/numeric.cpp:6: ./boost/python/detail/wrap_python.hpp:50:23: error: pyconfig.h: No such file or directory ./boost/python/detail/wrap_python.hpp:75:24: error: patchlevel.h: No such file or directory ./boost/python/detail/wrap_python.hpp:78:2: error: #error Python 2.2 or higher is required for this version of Boost.Python. ./boost/python/detail/wrap_python.hpp:142:21: error: Python.h: No such file or directory [snip 2034 lines of error messages] "/usr/bin/g++" -ftemplate-depth-128 -O3 -finline-functions -Wno-inline -Wall -fPIC -fno-strict-aliasing -fno-tree-ccp -march=opteron -pthread -m64 -DBOOST_ALL_NO_LIB=1 -DBOOST_PYTHON_SOURCE -DBOOST_PYTHON_STATIC_LIB -DNDEBUG -I"." -c -o "bin.v2/libs/python/build/gcc-4.1.2/release/address-model-64/instruction-set-opteron/link-static/threading-multi/numeric.o" "libs/python/src/numeric.cpp" ...failed gcc.compile.c++ bin.v2/libs/python/build/gcc-4.1.2/release/address-model-64/instruction-set-opteron/link-static/threading-multi/numeric.o... -- Dick Hadsell 203-992-6320 Fax: 203-992-6001 Reply-to: hadsell@blueskystudios.com Blue Sky Studios http://www.blueskystudios.com 1 American Lane, Greenwich, CT 06831-2560

At Fri, 25 Mar 2011 10:38:11 -0400, Richard Hadsell wrote:
Dave Abrahams wrote:
At Thu, 24 Mar 2011 18:33:43 -0400, Richard Hadsell wrote:
I tried to follow the latest Getting Started instructions, which changed a bit from the last version I built (1.44.0) to build bjam:
cd tools/build/v2 bootstrap.sh bjam install --prefix=../../.. cd ../../.. bin/bjam --user-config=user-config.LINUX_AMDF7 threading=multi instruction-set=opteron address-model=64 variant=release link=static,shared --stagedir=stageF7 stage
If you add --debug-configuration to your bjam command-line, it should be revealing.
Running this command:
bin/bjam --user-config=user-config.LINUX_AMDF7 --debug-configuration threading=multi instruction-set=opteron address-model=64 variant=release link=static,shared --stagedir=stageF7 stage | & tee build.release.log
| grep python and rearranging a bit:
gcc.compile.c++ bin.v2/libs/python/build/gcc-4.1.2/release/address-model-64/instruction-set-opteron/link-static/threading-multi/numeric.o In file included from ./boost/python/detail/prefix.hpp:13, from ./boost/python/numeric.hpp:8, from libs/python/src/numeric.cpp:6: ./boost/python/detail/wrap_python.hpp:50:23: error: pyconfig.h: No such file or directory
OK, so this is failing to find the python headers.
notice: [python-cfg] Configuring python... notice: [python-cfg] user-specified version: "2.5" notice: [python-cfg] user-specified cmd-or-prefix: "/usr" notice: [python-cfg] Checking interpreter command "/usr/bin/python2.5"... notice: [python-cfg] running command '"/usr/bin/python2.5" -c "from sys import *; print('version=%d.%d\nplatform=%s\nprefix=%s\nexec_prefix=%s\nexecutable=%s' % (version_info[0],version_info[1],platform,prefix,exec_prefix,executable))" 2>&1' notice: [python-cfg] ...requested configuration matched! notice: [python-cfg] Details of this Python configuration: notice: [python-cfg] interpreter command: "/usr/bin/python2.5" notice: [python-cfg] include path: "/usr/include/python2.5"
Does that path have a file called pyconfig.h in it? If not, you might need to add something to your user-config or site-config file that gives the correct #include path.
error: No best alternative for /python_for_extensions next alternative: required properties: <python>2.5 <target-os>linux matched next alternative: required properties: <python>2.5 <target-os>linux matched error: No best alternative for /python_for_extensions next alternative: required properties: <python>2.5 <target-os>linux matched next alternative: required properties: <python>2.5 <target-os>linux matched
I've never really understood the logic behind Boost.Build's matching of alternatives. I think the messages above are probably innocuous, but they could be a problem (possibly related to https://trac.lvk.cs.msu.su/boost.build/wiki/AlternativeSelection). You should ask about that on the boost.build mailing list. HTH, -- Dave Abrahams BoostPro Computing http://www.boostpro.com

AMDG On 03/25/2011 08:44 AM, Dave Abrahams wrote:
error: No best alternative for /python_for_extensions next alternative: required properties:<python>2.5<target-os>linux matched next alternative: required properties:<python>2.5<target-os>linux matched error: No best alternative for /python_for_extensions next alternative: required properties:<python>2.5<target-os>linux matched next alternative: required properties:<python>2.5<target-os>linux matched
I've never really understood the logic behind Boost.Build's matching of alternatives. I think the messages above are probably innocuous, but they could be a problem (possibly related to https://trac.lvk.cs.msu.su/boost.build/wiki/AlternativeSelection). You should ask about that on the boost.build mailing list.
I think it is a problem. It looks like python got configured twice, and the python toolset isn't filtering out the second one even though it's the same as the first. Thus, an ambiguity. In Christ, Steven Watanabe

I think it is a problem. It looks like python got configured twice, and the python toolset isn't filtering out the second one even though it's the same as the first. Thus, an ambiguity. This was a good clue. It forced me to examine why there were 2 python config steps. Eliminating the second one, caused by a bogus
Steven Watanabe wrote: project-config.jam file, solved the problem. Thank you for looking at the problem. -- Dick Hadsell 203-992-6320 Fax: 203-992-6001 Reply-to: hadsell@blueskystudios.com Blue Sky Studios http://www.blueskystudios.com 1 American Lane, Greenwich, CT 06831-2560

Dave Abrahams wrote:
OK, so this is failing to find the python headers.
notice: [python-cfg] Configuring python... notice: [python-cfg] user-specified version: "2.5" notice: [python-cfg] user-specified cmd-or-prefix: "/usr" notice: [python-cfg] Checking interpreter command "/usr/bin/python2.5"... notice: [python-cfg] running command '"/usr/bin/python2.5" -c "from sys import *; print('version=%d.%d\nplatform=%s\nprefix=%s\nexec_prefix=%s\nexecutable=%s' % (version_info[0],version_info[1],platform,prefix,exec_prefix,executable))" 2>&1' notice: [python-cfg] ...requested configuration matched! notice: [python-cfg] Details of this Python configuration: notice: [python-cfg] interpreter command: "/usr/bin/python2.5" notice: [python-cfg] include path: "/usr/include/python2.5"
Does that path have a file called pyconfig.h in it? If not, you might need to add something to your user-config or site-config file that gives the correct #include path.
Yes, it does. And Boost 1.41.0 and 1.44.0 built the python library with no problem finding the headers.
error: No best alternative for /python_for_extensions next alternative: required properties: <python>2.5 <target-os>linux matched next alternative: required properties: <python>2.5 <target-os>linux matched error: No best alternative for /python_for_extensions next alternative: required properties: <python>2.5 <target-os>linux matched next alternative: required properties: <python>2.5 <target-os>linux matched
I've never really understood the logic behind Boost.Build's matching of alternatives. I think the messages above are probably innocuous, but they could be a problem (possibly related to https://trac.lvk.cs.msu.su/boost.build/wiki/AlternativeSelection). You should ask about that on the boost.build mailing list.
Hmm ... You think I should go to a different mailing list to ask about my build problem? -- Dick Hadsell 203-992-6320 Fax: 203-992-6001 Reply-to: hadsell@blueskystudios.com Blue Sky Studios http://www.blueskystudios.com 1 American Lane, Greenwich, CT 06831-2560

Richard Hadsell wrote:
Dave Abrahams wrote:
Does that path have a file called pyconfig.h in it? If not, you might need to add something to your user-config or site-config file that gives the correct #include path.
Yes, it does. And Boost 1.41.0 and 1.44.0 built the python library with no problem finding the headers.
error: No best alternative for /python_for_extensions next alternative: required properties: <python>2.5 <target-os>linux matched next alternative: required properties: <python>2.5 <target-os>linux matched error: No best alternative for /python_for_extensions next alternative: required properties: <python>2.5 <target-os>linux matched next alternative: required properties: <python>2.5 <target-os>linux matched
I've never really understood the logic behind Boost.Build's matching of alternatives. I think the messages above are probably innocuous, but they could be a problem (possibly related to https://trac.lvk.cs.msu.su/boost.build/wiki/AlternativeSelection). You should ask about that on the boost.build mailing list. Problem solved.
There was a project-config.jam file in the boost home directory. It was left over from an earlier errant execution of bootstrap.sh (in the home directory). This extra config file confused the configuration process, as evidenced by the second set of [python-cfg] notices and the "No best alternative for /python_for_extensions" messages. Thank you for looking at the problem for me. -- Dick Hadsell 203-992-6320 Fax: 203-992-6001 Reply-to: hadsell@blueskystudios.com Blue Sky Studios http://www.blueskystudios.com 1 American Lane, Greenwich, CT 06831-2560

On 24 March 2011 22:33, Richard Hadsell <hadsell@blueskystudios.com> wrote:
BTW, the Getting Started page http://www.boost.org/doc/libs/1_46_1/more/getting_started/unix-variants.html in section 5.2.1 step 2 tells me to "Run bootstrap.bat".
Thanks, that's fixed now on the website and in trunk. You might have to force a reload to see the new version. Daniel
participants (4)
-
Daniel James
-
Dave Abrahams
-
Richard Hadsell
-
Steven Watanabe