gcc.compile.c++ bin.v2/libs/python/build/gcc-13.2/gentoorelease/pch-off/python-3.10/threading-multi/visibility-hidden/numpy/dtype.o "x86_64-pc-linux-gnu-g++" -fvisibility-inlines-hidden -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -O2 -march=native -pipe -std=c++17 -fPIC -m64 -pthread -finline-functions -Wno-inline -Wall -fvisibility=hidden -DBOOST_ALL_NO_LIB=1 -DBOOST_COBALT_USE_STD_PMR=1 -DBOOST_NUMPY_SOURCE -DNDEBUG -I"." -I"/usr/include/python3.10" -I"/usr/lib/python3.10/site-packages/numpy/_core/include" -c -o "bin.v2/libs/python/build/gcc-13.2/gentoorelease/pch-off/python-3.10/threading-multi/visibility-hidden/numpy/dtype.o" "libs/python/src/numpy/dtype.cpp" In file included from ./boost/python/detail/is_xxx.hpp:8, from ./boost/python/detail/is_auto_ptr.hpp:9, from ./boost/python/detail/copy_ctor_mutates_rhs.hpp:8, from ./boost/python/detail/value_arg.hpp:7, from ./boost/python/object/forward.hpp:10, from ./boost/python/object/pointer_holder.hpp:16, from ./boost/python/to_python_indirect.hpp:10, from ./boost/python/converter/arg_to_python.hpp:10, from ./boost/python/call.hpp:15, from ./boost/python/object_core.hpp:14, from ./boost/python/args.hpp:22, from ./boost/python.hpp:11, from ./boost/python/numpy/internal.hpp:17, from libs/python/src/numpy/dtype.cpp:11: ./boost/python/detail/is_auto_ptr.hpp:17:40: warning: ‘template<class> class std::auto_ptr’ is deprecated: use 'std::unique_ptr' instead [-Wdeprecated-declarations] 17 | BOOST_PYTHON_IS_XXX_DEF(auto_ptr, std::auto_ptr, 1) | ^~~~~~~~ ./boost/detail/is_xxx.hpp:20:4: note: in definition of macro ‘BOOST_DETAIL_IS_XXX_DEF’ 20 | qualified_name< BOOST_PP_ENUM_PARAMS_Z(1, nargs, T) > \ | ^~~~~~~~~~~~~~ ./boost/python/detail/is_auto_ptr.hpp:17:1: note: in expansion of macro ‘BOOST_PYTHON_IS_XXX_DEF’ 17 | BOOST_PYTHON_IS_XXX_DEF(auto_ptr, std::auto_ptr, 1) | ^~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/memory:78, from ./boost/function/function_base.hpp:34, from ./boost/function/function_template.hpp:14, from ./boost/function/function0.hpp:10, from ./boost/python/errors.hpp:13, from ./boost/python/handle.hpp:11, from ./boost/python/args_fwd.hpp:10, from ./boost/python/args.hpp:10: /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/unique_ptr.h:65:28: note: declared here 65 | template<typename> class auto_ptr; | ^~~~~~~~ libs/python/src/numpy/dtype.cpp: In member function ‘int boost::python::numpy::dtype::get_itemsize() const’: libs/python/src/numpy/dtype.cpp:101:83: error: ‘PyArray_Descr’ {aka ‘struct _PyArray_Descr’} has no member named ‘elsize’ 101 | int dtype::get_itemsize() const { return reinterpret_cast<PyArray_Descr*>(ptr())->elsize;} | ^~~~~~ Reproducible: Always
Hi Attila, I ran into this too. Try downgrading to =dev-python/numpy1.26.4 https://github.com/numpy/numpy/releases/tag/v1.26.4 Both boost v1.84 and v1.85 were failing for me and after downgrading numpy, "no more problems". Also, it compiled for me using =sys-devel/gcc-13.3.0. Best Regards, -Chicago
(In reply to Chicago from comment #1) > Hi Attila, > > I ran into this too. > Try downgrading to =dev-python/numpy1.26.4 > https://github.com/numpy/numpy/releases/tag/v1.26.4 > > Both boost v1.84 and v1.85 were failing for me and after downgrading > numpy, "no more problems". > > Also, it compiled for me using =sys-devel/gcc-13.3.0. > > Best Regards, > -Chicago Thanks for sharing! What I don't understand is, that according to numpy's documentation elsize is still the member of PyArray_Descr struct in contrast to the error message. Or I have to take a closer look...
(In reply to Attila Tóth from comment #2) > (In reply to Chicago from comment #1) > > Hi Attila, > > > > I ran into this too. > > Try downgrading to =dev-python/numpy1.26.4 > > https://github.com/numpy/numpy/releases/tag/v1.26.4 > > > > Both boost v1.84 and v1.85 were failing for me and after downgrading > > numpy, "no more problems". > > > > Also, it compiled for me using =sys-devel/gcc-13.3.0. > > > > Best Regards, > > -Chicago > > Thanks for sharing! > What I don't understand is, that according to numpy's documentation elsize > is still the member of PyArray_Descr struct in contrast to the error > message. Or I have to take a closer look... https://numpy.org/devdocs/numpy_2_0_migration_guide.html#the-pyarray-descr-struct-has-been-changed
Yeah, I don't know. Boost breaks things ALL OF THE TIME. When I noticed the numpy 2 package was merely a release candidate, I went to the homepage and it looked like the 1.26.4 release was actually more fresh; so that's why I gave it a try.
Created attachment 894689 [details, diff] https://github.com/boostorg/python/pull/432 with the path fixed dropping https://github.com/boostorg/python/pull/432.patch into "/etc/portage/patches/dev-libs/boost" wont work, because the patch is missing the path element "libs/python" since it should be patching "libs/python/src/numpy/dtype.cpp" The attached patch just fixes the paths, putting it in "/etc/portage/patches/dev-libs/boost" works for me.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7c4165b90a91bb690c3a21dc686ab72ce2c741af commit 7c4165b90a91bb690c3a21dc686ab72ce2c741af Author: Sam James <sam@gentoo.org> AuthorDate: 2024-05-31 22:34:43 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2024-05-31 22:35:49 +0000 dev-libs/boost: fix build w/ numpy-2 Closes: https://bugs.gentoo.org/932459 Signed-off-by: Sam James <sam@gentoo.org> dev-libs/boost/boost-1.85.0.ebuild | 1 + .../boost/files/boost-1.85.0-python-numpy-2.patch | 26 ++++++++++++++++++++++ 2 files changed, 27 insertions(+) Additionally, it has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b3c11ad7888226360acbfca8ffc210dd3cf43ddd commit b3c11ad7888226360acbfca8ffc210dd3cf43ddd Author: Sam James <sam@gentoo.org> AuthorDate: 2024-05-31 22:37:35 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2024-05-31 22:37:35 +0000 dev-libs/boost: subslot depend on numpy no revbump as it didn't build for >=2 until now anyway Bug: https://bugs.gentoo.org/932459 Signed-off-by: Sam James <sam@gentoo.org> dev-libs/boost/boost-1.85.0.ebuild | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
This also happens on stable tree when you pull in dev-python/numpy:0/2 and compile dev-libs/boost-1.84.0-r3 against it. For now I masked this numpy slot and see if that resolves my issue. 17 | BOOST_PYTHON_IS_XXX_DEF(auto_ptr, std::auto_ptr, 1) | ^~~~~~~~ ./boost/detail/is_xxx.hpp4: note: in definition of macro ‘BOOST_DETAIL_IS_XXX_DEF’ 20 | qualified_name< BOOST_PP_ENUM_PARAMS_Z(1, nargs, T) > \ | ^~~~~~~~~~~~~~ ./boost/python/detail/is_auto_ptr.hpp1: note: in expansion of macro ‘BOOST_PYTHON_IS_XXX_DEF’ 17 | BOOST_PYTHON_IS_XXX_DEF(auto_ptr, std::auto_ptr, 1) | ^~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/memory:78, from ./boost/function/function_base.hpp:34, from ./boost/function/detail/prologue.hpp:18, from ./boost/function/function_template.hpp:13, from ./boost/function/detail/maybe_include.hpp:15, from ./boost/function/function0.hpp:11, from ./boost/python/errors.hpp:13, from ./boost/python/handle.hpp:11, from ./boost/python/args_fwd.hpp:10, from ./boost/python/args.hpp /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/unique_ptr.h28: note: declared here 65 | template<typename> class auto_ptr; | ^~~~~~~~ libs/python/src/numpy/dtype.cpp: In member function ‘int boost::get_itemsize() const’: libs/python/src/numpy/dtype.cpp83: error: ‘PyArray_Descr’ {aka ‘struct _PyArray_Descr’} has no member named ‘elsize’
(In reply to Joost Ruis from comment #7) > This also happens on stable tree when you pull in dev-python/numpy:0/2 and > compile dev-libs/boost-1.84.0-r3 against it. > > For now I masked this numpy slot and see if that resolves my issue. > > > 17 | BOOST_PYTHON_IS_XXX_DEF(auto_ptr, std::auto_ptr, 1) > | ^~~~~~~~ > ./boost/detail/is_xxx.hpp4: note: in definition of macro > ‘BOOST_DETAIL_IS_XXX_DEF’ > 20 | qualified_name< BOOST_PP_ENUM_PARAMS_Z(1, nargs, T) > > \ > | ^~~~~~~~~~~~~~ > ./boost/python/detail/is_auto_ptr.hpp1: note: in expansion of macro > ‘BOOST_PYTHON_IS_XXX_DEF’ > 17 | BOOST_PYTHON_IS_XXX_DEF(auto_ptr, std::auto_ptr, 1) > | ^~~~~~~~~~~~~~~~~~~~~~~ > In file included from > /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/memory:78, > from ./boost/function/function_base.hpp:34, > from ./boost/function/detail/prologue.hpp:18, > from ./boost/function/function_template.hpp:13, > from ./boost/function/detail/maybe_include.hpp:15, > from ./boost/function/function0.hpp:11, > from ./boost/python/errors.hpp:13, > from ./boost/python/handle.hpp:11, > from ./boost/python/args_fwd.hpp:10, > from ./boost/python/args.hpp > > /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/unique_ptr.h28: > note: declared here > 65 | template<typename> class auto_ptr; > | ^~~~~~~~ > libs/python/src/numpy/dtype.cpp: In member function ‘int > boost::get_itemsize() const’: > libs/python/src/numpy/dtype.cpp83: error: ‘PyArray_Descr’ {aka > ‘struct _PyArray_Descr’} has no member named ‘elsize’ Yes masking dev-python/numpy:0/2 on my stable tree resolved my issue! I am going to reopen this bug since it now affects stable tree.
I filed bug 935739 the other day.