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

During Cmake configuration: Could not find a package configuration file provided by pybind11_abseil #4380

Closed
carlosal1015 opened this issue Sep 19, 2024 · 7 comments
Assignees
Labels
Build: CMake CMake based build issue Help Needed Modeling/Usage problem
Milestone

Comments

@carlosal1015
Copy link

What version of OR-Tools and what language are you using?
Version: v9.11
Language: Python

What operating system (Linux, Windows, ...) and version?
Arch linux
What did you do?
Steps to reproduce the behavior:
I am installing from here. This is the log.

==> Making package: python-or-tools 9.11-1 (Thu Sep 19 12:00:02 2024)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found or-tools-9.11.tar.gz
==> Validating source files with b2sums...
    or-tools-9.11.tar.gz ... Passed
==> Extracting sources...
  -> Extracting or-tools-9.11.tar.gz with bsdtar
==> Starting build()...
-- The CXX compiler identification is GNU 14.2.1
-- The C compiler identification is GNU 14.2.1
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/sbin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/sbin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- ortools version: 9.11.9999
-- Build type: None
-- Build C++ library: OFF
-- Build standalone Glop: ON
-- Build Python: ON
-- Build Java: OFF
-- Build .Net: OFF
-- Build Flatzinc: OFF
-- Build LP Parser: OFF
-- Build MathOpt: OFF
-- Build samples: OFF
-- Build C++ samples: OFF
-- Build Python samples: OFF
-- Build Java samples: OFF
-- Build .Net samples: OFF
-- Build examples: ON
-- Build C++ examples: OFF
-- Build Python examples: ON
-- Build Java examples: OFF
-- Build .Net examples: OFF
-- Build documentation: OFF
-- Install doc: OFF
-- Build all dependencies: OFF
-- Build ZLIB: OFF
-- Build abseil-cpp: OFF
-- Build protobuf: OFF
-- Build eigen3: OFF
-- Build re2: OFF
-- Build googletest: OFF
-- Build benchmark: OFF
-- BOP support: OFF
-- COIN-OR support: OFF
-- GLOP support: OFF
-- GLPK support: OFF
-- Gurobi support: OFF
-- HiGHS support: OFF
-- PDLP support: OFF
-- SCIP support: OFF
-- CPLEX support: OFF
-- Xpress support: OFF
-- Python: Build pybind11: OFF
-- Python: Build pybind11_protobuf: OFF
-- Python: Build pybind11_abseil: OFF
-- Python: Generate stub file: ON
-- Python: Build doc: OFF
-- Python: Create venv: ON
-- Python: Allow venv to use system site packages: OFF
-- Python: Fetch dependencies: OFF
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Found ZLIB: /usr/lib/libz.so (found version "1.3.1")
CMake Warning (dev) at /usr/lib/cmake/pybind11/FindPythonLibsNew.cmake:101 (message):
  Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules
  are removed.  Run "cmake --help-policy CMP0148" for policy details.  Use
  the cmake_policy command to set the policy and suppress this warning, or
  preferably upgrade to using FindPython, either by calling it explicitly
  before pybind11, or by setting PYBIND11_FINDPYTHON ON before pybind11.
Call Stack (most recent call first):
  /usr/lib/cmake/pybind11/pybind11Tools.cmake:50 (find_package)
  /usr/lib/cmake/pybind11/pybind11Common.cmake:228 (include)
  /usr/lib/cmake/pybind11/pybind11Config.cmake:250 (include)
  cmake/system_deps.cmake:98 (find_package)
  CMakeLists.txt:402 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found PythonInterp: /usr/sbin/python3 (found suitable version "3.12.6", minimum required is "3.7")
-- Found PythonLibs: /usr/lib/libpython3.12.so
-- Performing Test HAS_FLTO
-- Performing Test HAS_FLTO - Success
-- Found pybind11: /usr/include (found version "2.13.6")
CMake Error at cmake/system_deps.cmake:102 (find_package):
  By not providing "Findpybind11_abseil.cmake" in CMAKE_MODULE_PATH this
  project has asked CMake to find a package configuration file provided by
  "pybind11_abseil", but CMake did not find one.

  Could not find a package configuration file provided by "pybind11_abseil"
  with any of the following names:

    pybind11_abseilConfig.cmake
    pybind11_abseil-config.cmake

  Add the installation prefix of "pybind11_abseil" to CMAKE_PREFIX_PATH or
  set "pybind11_abseil_DIR" to a directory containing one of the above files.
  If "pybind11_abseil" provides a separate development package or SDK, be
  sure it has been installed.
Call Stack (most recent call first):
  CMakeLists.txt:402 (include)

What did you expect to see

What did you see instead?

Looks like that pybind11_abseil do not provide cmake configuration files and gives the error.

@Mizux
Copy link
Collaborator

Mizux commented Sep 19, 2024

two options until pybind11_abseil provide its own cmake config install stuff (PR is welcome):

  • let OR-Tools build it for you using -DBUILD_pybind11_abseil

    or-tools/CMakeLists.txt

    Lines 379 to 381 in fd00bf8

    CMAKE_DEPENDENT_OPTION(BUILD_pybind11_abseil "Build the pybind11_abseil dependency Library" OFF
    "NOT BUILD_DEPS" ON)
    message(STATUS "Python: Build pybind11_abseil: ${BUILD_pybind11_abseil}")
  • create your own Findpybind11_abseil.cmake module and populate it with the needed target

ref: pybind/pybind11_abseil#6

ps:

FROM archlinux:latest AS base

...
-DBUILD_pybind11_abseil=ON \
-DBUILD_pybind11_protobuf=ON \

@carlosal1015
Copy link
Author

carlosal1015 commented Sep 22, 2024

It is very nice that Dockerfile works with Arch Linux. OK, by now using pybind11-abseil and pybind11-protobuf, but is not working with system python-protobuf: https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=python-or-tools#n48

--   Checking for external dependencies
CMake Error at /usr/share/cmake/Modules/FetchContent.cmake:2472 (find_package):
  Could not find a configuration file for package "Protobuf" that is
  compatible with requested version "4.23.3".

  The following configuration files were considered but not accepted:

    /usr/lib/cmake/protobuf/protobuf-config.cmake, version: 28.1.0
    /lib/cmake/protobuf/protobuf-config.cmake, version: 28.1.0

Call Stack (most recent call first):
  /usr/share/cmake/Modules/FetchContent.cmake:2362 (__FetchContent_MakeAvailable_find_package)
  /tmp/makepkg/python-or-tools/src/build/_deps/pybind11_protobuf-src/CMakeLists.txt:80 (FetchContent_MakeAvailable)
-- Configuring incomplete, errors occurred!
==> ERROR: A failure occurred in build().

@Mizux
Copy link
Collaborator

Mizux commented Sep 23, 2024

this issue is the easy one, you need to hack the borken pybind11_protobuf cmake dependencies management (need to send PR upstream if I have time)

look at our patch and replace 4.23.3 by 28.1.0:

+if(NOT TARGET protobuf::libprotobuf)
+ if(USE_SYSTEM_PROTOBUF)
+ set(_protobuf_package_args 4.23.3 REQUIRED)
+ else()
+ set(_protobuf_package_args 4.23.3)
+ endif()
+ FetchContent_Declare(
+ Protobuf
+ GIT_REPOSITORY "https://github.com/protocolbuffers/protobuf.git"
+ GIT_TAG v23.3
+ GIT_SUBMODULES ""
+ FIND_PACKAGE_ARGS ${_protobuf_package_args} NAMES protobuf)
+ set(protobuf_BUILD_TESTS OFF CACHE INTERNAL "")
+ FetchContent_MakeAvailable(Protobuf)
+endif()

@mCr86
Copy link

mCr86 commented Oct 5, 2024

Hi,
I am facing the same problem with pybind11_protobuf.
Could you help me to replace 4.23.3 by 28.1.0 and install the package from AUR?
I don't know how to do it.
Thanks.

@carlosal1015
Copy link
Author

@mCr86 , the idea is change this two numbers here because when cmake create build/_deps/pybind11_protobuf-src/CMakeLists.txt is point to version incompatible with downstream Arch Linux package.

@carlosal1015
Copy link
Author

Many thanks @Mizux for help us. @mCr86 please try python-or-tools 9.11-4 in AUR.

@mCr86
Copy link

mCr86 commented Oct 6, 2024

Ok.
Thanks!

@Mizux Mizux self-assigned this Oct 7, 2024
@Mizux Mizux added Help Needed Modeling/Usage problem Build: CMake CMake based build issue labels Oct 7, 2024
@Mizux Mizux added this to the v9.12 milestone Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build: CMake CMake based build issue Help Needed Modeling/Usage problem
Projects
None yet
Development

No branches or pull requests

3 participants