Your message dated Wed, 11 Dec 2019 17:37:55 +0100
with message-id <157608227567.18318.4611554648798153289@hoothoot>
and subject line Re: Bug#946565: regression: Could NOT find Boost (missing:
python3)
has caused the Debian Bug report #946565,
regarding regression: Could NOT find Boost (missing: python3)
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
946565: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=946565
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: libboost-python1.67-dev
Version: 1.67.0-15
Severity: important
Hi,
I'm using the following CMakeLists.txt:
cmake_minimum_required(VERSION 3.13)
project(foo)
find_package(PythonLibs 3 REQUIRED)
find_package(Boost 1.45.0 COMPONENTS "python3" REQUIRED)
Everything works fine on Debian Buster with libboost-python1.67-dev
version 1.67.0-13:
-- The C compiler identification is GNU 8.3.0
-- The CXX compiler identification is GNU 8.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython3.7m.so (found
suitable version "3.7.3", minimum required is "3")
-- Boost version: 1.67.0
-- Found the following Boost libraries:
-- python3
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp
The problem only occurs after upgrading to 1.67.0-15 from unstable:
-- The C compiler identification is GNU 8.3.0
-- The CXX compiler identification is GNU 8.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython3.7m.so (found
suitable version "3.7.5", minimum required is "3")
CMake Error at
/usr/share/cmake-3.15/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
Could NOT find Boost (missing: python3) (found suitable version "1.67.0",
minimum required is "1.45.0")
Call Stack (most recent call first):
/usr/share/cmake-3.15/Modules/FindPackageHandleStandardArgs.cmake:378
(_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake-3.15/Modules/FindBoost.cmake:2161
(find_package_handle_standard_args)
CMakeLists.txt:4 (find_package)
-- Configuring incomplete, errors occurred!
See also "/tmp/CMakeFiles/CMakeOutput.log".
Please fix this regression.
Thanks!
cheers, josch
--- End Message ---
--- Begin Message ---
Hi Dimitri,
Quoting Dimitri John Ledkov (2019-12-11 02:14:23)
> On Wed, 11 Dec 2019 at 00:45, Johannes 'josch' Schauer <[email protected]>
> wrote:
> > I'm using the following CMakeLists.txt:
> >
> > cmake_minimum_required(VERSION 3.13)
> > project(foo)
> > find_package(PythonLibs 3 REQUIRED)
> > find_package(Boost 1.45.0 COMPONENTS "python3" REQUIRED)
> >
>
> Above uses obsolete ways of finding both python and boost-python components.
>
> PythonLibs has moved onto to just Python, with components.
> Boost has moved onto providing fixed abi components only, without any
> "convenience" libraries. After all, one cannot simply change
> boost_python3 so-name to be 3.8 instead of 3.7.
> Added bonus, this new way works across all OSes and Distros, be it
> Debian/Ubuntu/Fedora/RHEL/Windows/MacOSX/vanilla-upstream-self-compiled.
>
> The new way of doing things is shown in our autopkgtests:
> https://salsa.debian.org/debian/boost/raw/master/debian/tests/srcs/python/CMakeLists.txt
>
> NB! note that python3-dev or python3-all-dev is needed
> NB! note that there are slightly different names for the Python_*
> variables i.e. one may need to change PYTHON_* variables to Python_
> with new suffixes
>
> Which will be updated if things change in the future, including here
> verbatim for convenience
>
> project(Boost CXX)
> cmake_minimum_required(VERSION 3.0)
>
> FIND_PACKAGE(Python 3 REQUIRED COMPONENTS Interpreter Development)
> INCLUDE_DIRECTORIES( ${Python_INCLUDE_DIR} )
>
> FIND_PACKAGE(Boost COMPONENTS
> python${Python_VERSION_MAJOR}${Python_VERSION_MINOR} REQUIRED)
> INCLUDE_DIRECTORIES (${Boost_INCLUDE_DIRS})
>
> ADD_LIBRARY(demo1 SHARED demo1.cpp)
> TARGET_LINK_LIBRARIES(demo1 ${Boost_LIBRARIES} ${Python_LIBRARIES})
>
> ADD_LIBRARY(demo2 SHARED demo2.cpp)
> TARGET_LINK_LIBRARIES(demo2 ${Boost_LIBRARIES} ${Python_LIBRARIES})
>
> Or forexample, you can query what the currenty py3versions default
> version is and requet pythonXY boost component that way.
>
> > Everything works fine on Debian Buster with libboost-python1.67-dev
> > version 1.67.0-13:
>
> This new way of doing things, will also work on prior debian releases.
>
> python python3 python-pyXY are all obsolete (and at times Debian-only)
> abi symlinks
>
> python27 python37 python38 are the only ones that are going to be
> available going forward, and also have been available in the past.
>
> Please adjust your CMakeLists for the future.
thank you for taking the time for your very informative and useful reply!
It is great that there is now a way to use boost, python and cmake that is
supposed to work across all distros and OSes. I also really like that you
implemented this as an autopkgtest!
Unfortunately, already Debian stretch is too old for this to work as
FindPython.cmake was only introduced in cmake 3.12. Also boost versions before
1.67 do not work with this new approach. Since Debian Stretch as well as Ubuntu
Xenial and Bionic are all still supported, I'm now using the following CMake
snippet:
if(${CMAKE_VERSION} VERSION_LESS "3.12")
# FindPythonLibs has been deprecated since CMake 3.12
# these CMake versions do not ship with FindPython.cmake
find_package(PythonLibs 3 REQUIRED)
set(version ${PYTHONLIBS_VERSION_STRING})
STRING( REGEX REPLACE "([0-9.]+).[0-9]+(rc[0-9]+)?" "\\1"
version ${version} )
STRING( REGEX REPLACE "[^0-9]" "" version ${version} )
set(pyincl ${PYTHON_INCLUDE_DIRS})
set(pylibs ${PYTHON_LIBRARIES})
else()
# FindPython3 is new in CMake 3.12
find_package(Python 3 REQUIRED COMPONENTS Interpreter
Development)
set(version ${Python_VERSION_MAJOR}${Python_VERSION_MINOR})
set(pyincl ${Python_INCLUDE_DIR})
set(pylibs ${Python_LIBRARIES})
endif()
message(STATUS "found python version: ${version}")
if (Boost_VERSION LESS "106700")
find_package(Boost COMPONENTS "python-py${version}" REQUIRED)
else()
find_package(Boost COMPONENTS python${version} REQUIRED)
endif()
Since this is only a change in behaviour and not a bug, I'm closing this
report.
Thanks!
cheers, josch
signature.asc
Description: signature
--- End Message ---