alidist icon indicating copy to clipboard operation
alidist copied to clipboard

fedora 37:: Boost compile error due to wrong python used

Open adriansev opened this issue 1 year ago • 0 comments

Seems that boost use python as dependency and given that is build before python, it will use system python. on fedora 37 this will break with messages related to Py_TYPE like:

2023-04-29@09:28:17:DEBUG:O2Physics:boost:o2physics:     "g++"   -std=c++17 -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"/usr/include/python3.11"  -c -o "build-boost/boost/bin.v2/libs/python/build/gcc-12.2.0/release/cxxstd-17-iso/python-3.11/threading-multi/visibility-hidden/object/life_support.o" "libs/python/src/object/life_support.cpp"
2023-04-29@09:28:17:DEBUG:O2Physics:boost:o2physics: 
2023-04-29@09:28:17:DEBUG:O2Physics:boost:o2physics: In file included from /usr/include/python3.11/Python.h:44,
2023-04-29@09:28:17:DEBUG:O2Physics:boost:o2physics:                  from ./boost/python/detail/wrap_python.hpp:178,
2023-04-29@09:28:17:DEBUG:O2Physics:boost:o2physics:                  from ./boost/python/detail/prefix.hpp:13,
2023-04-29@09:28:17:DEBUG:O2Physics:boost:o2physics:                  from ./boost/python/object/life_support.hpp:7,
2023-04-29@09:28:17:DEBUG:O2Physics:boost:o2physics:                  from libs/python/src/object/life_support.cpp:5:
2023-04-29@09:28:17:DEBUG:O2Physics:boost:o2physics: libs/python/src/object/life_support.cpp: In function 'PyObject* boost::python::objects::make_nurse_and_patient(PyObject*, PyObject*)':
2023-04-29@09:28:17:DEBUG:O2Physics:boost:o2physics: libs/python/src/object/life_support.cpp:96:9: error: lvalue required as left operand of assignment
2023-04-29@09:28:17:DEBUG:O2Physics:boost:o2physics:    96 |         Py_TYPE(&life_support_type) = &PyType_Type;
2023-04-29@09:28:17:DEBUG:O2Physics:boost:o2physics:       |         ^~~~~~~
2023-04-29@09:28:18:DEBUG:O2Physics:boost:o2physics: ...failed gcc.compile.c++ build-boost/boost/bin.v2/libs/python/build/gcc-12.2.0/release/cxxstd-17-iso/python-3.11/threading-multi/visibility-hidden/object/life_support.o...
2023-04-29@09:28:18:DEBUG:O2Physics:boost:o2physics: gcc.compile.c++ build-boost/boost/bin.v2/libs/python/build/gcc-12.2.0/release/cxxstd-17-iso/python-3.11/threading-multi/visibility-hidden/object/enum.o
2023-04-29@09:28:18:DEBUG:O2Physics:boost:o2physics: 
2023-04-29@09:28:18:DEBUG:O2Physics:boost:o2physics:     "g++"   -std=c++17 -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"/usr/include/python3.11"  -c -o "build-boost/boost/bin.v2/libs/python/build/gcc-12.2.0/release/cxxstd-17-iso/python-3.11/threading-multi/visibility-hidden/object/enum.o" "libs/python/src/object/enum.cpp"
2023-04-29@09:28:18:DEBUG:O2Physics:boost:o2physics: 
2023-04-29@09:28:18:DEBUG:O2Physics:boost:o2physics: In file included from /usr/include/python3.11/Python.h:44,
2023-04-29@09:28:18:DEBUG:O2Physics:boost:o2physics:                  from ./boost/python/detail/wrap_python.hpp:178,
2023-04-29@09:28:18:DEBUG:O2Physics:boost:o2physics:                  from ./boost/python/detail/prefix.hpp:13,
2023-04-29@09:28:18:DEBUG:O2Physics:boost:o2physics:                  from ./boost/python/object_core.hpp:10,
2023-04-29@09:28:18:DEBUG:O2Physics:boost:o2physics:                  from ./boost/python/object/enum_base.hpp:8,
2023-04-29@09:28:18:DEBUG:O2Physics:boost:o2physics:                  from libs/python/src/object/enum.cpp:6:
2023-04-29@09:28:18:DEBUG:O2Physics:boost:o2physics: libs/python/src/object/enum.cpp: In function 'boost::python::api::object boost::python::objects::{anonymous}::new_enum_type(const char*, const char*)':
2023-04-29@09:28:18:DEBUG:O2Physics:boost:o2physics: libs/python/src/object/enum.cpp:156:11: error: lvalue required as left operand of assignment
2023-04-29@09:28:18:DEBUG:O2Physics:boost:o2physics:   156 |           Py_TYPE(&enum_type_object) = incref(&PyType_Type);
2023-04-29@09:28:18:DEBUG:O2Physics:boost:o2physics:       |           ^~~~~~~
2023-04-29@09:28:19:DEBUG:O2Physics:boost:o2physics: ...failed gcc.compile.c++ build-boost/boost/bin.v2/libs/python/build/gcc-12.2.0/release/cxxstd-17-iso/python-3.11/threading-multi/visibility-hidden/object/enum.o...

adriansev avatar Apr 29 '23 06:04 adriansev