boostorg / boostorg/build

Failed to build with python and python 3.5

Open
#633 3 comments 0 reactions 0 assignees View on GitHub
transition
Dominant language
C++
Stars
251
Forks
63
PR merge metrics
No merged PRs in 30d

Description

OS: RHEL 7
Python 3.5.2 |Anaconda 4.2.0 (64-bit)
boost 1.73

I try to build the boost lib with a python 3.5 from an anaconda3.

I bootstrap the boost:
`./bootstrap.sh --prefix=$HOME/boost`
It detects the correct python:

Building Boost.Build engine with toolset gcc... tools/build/src/engine/b2
Detecting Python version... 3.5
Detecting Python root... /home/joergboe/anaconda3
Unicode/ICU support for Boost.Regex?... /usr
Generating Boost.Build configuration in project-config.jam for gcc...

Then I start the build:
`./b2 -j8 --with-python --build-dir=$HOME/boost/build --stagedir=$HOME/boost/statge -q stage`
The build fails:

In file included from ./boost/python/detail/prefix.hpp:13:0,
from ./boost/python/long.hpp:8,
from libs/python/src/long.cpp:5:
./boost/python/detail/wrap_python.hpp:57:23: fatal error: pyconfig.h: No such file or directory
# include
^
compilation terminated.

"g++" -fvisibility-inlines-hidden -fPIC -m64 -pthread -O3 -finline-functions -Wno-inline -Wall -fvisibility=hidden -DBOOST_ALL_NO_LIB=1 -DBOOST_PYTHON_SOURCE -DNDEBUG -I"." -I"/home/joergboe/anaconda3/include/python3.5" -c -o "/home/joergboe/boost/build/boost/bin.v2/libs/python/build/gcc-4.8.5/release/python-3.5/threading-multi/visibility-hidden/long.o" "libs/python/src/long.cpp"

...failed gcc.compile.c++ /home/joergboe/boost/build/boost/bin.v2/libs/python/build/gcc-4.8.5/release/python-3.5/threading-multi/visibility-hidden/long.o...

Apparently the automatic python configuration expects the python include path at:
`/home/joergboe/anaconda3/include/python3.5"`
but the real include path is:
`/home/joergboe/anaconda3/include/python3.5m`

The python installation reports the include path correctly:

python3-config --includes
-I/home/joergboe/anaconda3/include/python3.5m -I/home/joergboe/anaconda3/include/python3.5m

The same with python:

python -c "import sysconfig; print(sysconfig.get_path('include'));"
/home/joergboe/anaconda3/include/python3.5m

Similar issues were reported several times:
#443
#289

Is there a solution ?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.