Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compile with python 3.13t (nogil) #458

Open
subaochen opened this issue Dec 2, 2024 · 2 comments
Open

compile with python 3.13t (nogil) #458

subaochen opened this issue Dec 2, 2024 · 2 comments

Comments

@subaochen
Copy link

subaochen commented Dec 2, 2024

I have installed free-threading python 3.13 following https://py-free-threading.github.io/installing_cpython/ on ubuntu 22.04(with gcc 11.04.0), with command:

conda create -n nogil --override-channels -c conda-forge python-freethreading

But compile python 3.13t with boost-1.86.0 failed, below the steps:

1, configure boost successfully:
./bootstrap.sh --with-python=/home/mydesktop/anaconda3/envs/nogil

2, compile boost failed:
./b2 --toolset=gcc --with-python include="/home/mydesktop/anaconda3/envs/nogil/include/python3.13t/" --with-thread --with-date_time --with-chrono --with-system
3, error message:

`gcc.compile.c++ bin.v2/libs/python/build/gcc-11/release/x86_64/link-static/python-3.13/threading-multi/visibility-hidden/dict.o
In file included from ./boost/python/detail/prefix.hpp:13,
                 from ./boost/python/dict.hpp:8,
                 from libs/python/src/dict.cpp:4:
./boost/python/detail/wrap_python.hpp:57:11: fatal error: pyconfig.h: No such file or directory
   57 | # include <pyconfig.h>
      |           ^~~~~~~~~~~~
compilation terminated.

    "g++"   -fvisibility-inlines-hidden -m64 -pthread -O3 -finline-functions -Wno-inline -Wall -fvisibility=hidden  -DBOOST_ALL_NO_LIB=1 -DBOOST_COBALT_USE_STD_PMR=1 -DBOOST_PYTHON_SOURCE -DBOOST_PYTHON_STATIC_LIB -DNDEBUG   -I"." -I"/home/subaochen/anaconda3/envs/nogil/include/python3.13" -I"/home/subaochen/anaconda3/envs/nogil/include/python3.1t"  -c -o "bin.v2/libs/python/build/gcc-11/release/x86_64/link-static/python-3.13/threading-multi/visibility-hidden/dict.o" "libs/python/src/dict.cpp"

...failed gcc.compile.c++ bin.v2/libs/python/build/gcc-11/release/x86_64/link-static/python-3.13/threading-multi/visibility-hidden/dict.o...
gcc.compile.c++ bin.v2/libs/python/build/gcc-11/release/x86_64/link-static/python-3.13/threading-multi/visibility-hidden/str.o
In file included from ./boost/python/detail/prefix.hpp:13,
                 from ./boost/python/str.hpp:8,
                 from libs/python/src/str.cpp:4:
./boost/python/detail/wrap_python.hpp:57:11: fatal error: pyconfig.h: No such file or directory
   57 | # include <pyconfig.h>
      |           ^~~~~~~~~~~~
compilation terminated.

Obviously I missed "pyconfig.h", but i successfully compiled boost 1.86 with python 3.11 with the same step. Any suggestions? Thanks in advance!

@mclow mclow transferred this issue from boostorg/boost Dec 2, 2024
@stefanseefeld
Copy link
Member

@grafikrobot , do you know what's wrong here ? My b2 knowledge is next to non-existent.

@grafikrobot
Copy link
Member

@stefanseefeld hmm.. something strange is going on with the include paths for python:

-I"/home/subaochen/anaconda3/envs/nogil/include/python3.13"
-I"/home/subaochen/anaconda3/envs/nogil/include/python3.1t"

It would help if we got the output of running the build with the --debug-configuration option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants