question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[package] pybind11/2.6.1: CMake warning and error emitted for test_package example

See original GitHub issue

Hi, I have a directory containing all of the files from the pybind11/2.6.1 test package (minus the conanfile.py) and the following conanfile.txt:

[requires]                                                                      
pybind11/2.6.1                                                                  
                                                                                
[generators]                                                                    
cmake 

I expected that I would be able to execute the following commands:

  • conan install . --build missing
  • cmake .
  • make

However, I observe the following output from CMake:

-- The CXX compiler identification is GNU 9.3.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/g++-9 - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Conan: Adjusting output directories
-- Conan: Using cmake global configuration
-- Conan: Adjusting default RPATHs Conan policies
-- Conan: Adjusting language standard
-- Current conanbuildinfo.cmake directory: /home/dchapp/repos/conan-center-index/recipes/pybind11/all/test
-- Conan: Compiler GCC>=5, checking major version 9.3
-- Conan: Checking correct version: 9.3
-- Found PythonInterp: /usr/bin/python (found version "2.7.17") 
-- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython2.7.so
CMake Warning at /home/dchapp/.conan/data/pybind11/2.6.1/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/lib/cmake/pybind11/pybind11Tools.cmake:17 (message):
  Set PYBIND11_PYTHON_VERSION to search for a specific version, not
  PYTHON_VERSION (which is an output).  Assuming that is what you meant to do
  and continuing anyway.
Call Stack (most recent call first):
  /home/dchapp/.conan/data/pybind11/2.6.1/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/lib/cmake/pybind11/pybind11Common.cmake:201 (include)
  /home/dchapp/.conan/data/pybind11/2.6.1/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/lib/cmake/pybind11/pybind11Install.cmake:249 (include)
  conanbuildinfo.cmake:781 (include)
  conanbuildinfo.cmake:259 (conan_include_build_modules)
  CMakeLists.txt:5 (conan_basic_setup)


-- Performing Test HAS_FLTO
-- Performing Test HAS_FLTO - Success
-- Found pybind11: /home/dchapp/.conan/data/pybind11/2.6.1/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include (found version "" )
CMake Error at CMakeLists.txt:7 (find_package):
  By not providing "Findpybind11.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "pybind11",
  but CMake did not find one.

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

    pybind11Config.cmake
    pybind11-config.cmake

  Add the installation prefix of "pybind11" to CMAKE_PREFIX_PATH or set
  "pybind11_DIR" to a directory containing one of the above files.  If
  "pybind11" provides a separate development package or SDK, be sure it has
  been installed.


-- Configuring incomplete, errors occurred!
See also "/home/dchapp/repos/conan-center-index/recipes/pybind11/all/test/CMakeFiles/CMakeOutput.log".

If I use the deprecated(?) conan package pybind11/2.3.0@conan/stable I do not observe this error. At this point I am unsure whether this is a problem with how I’m using conan or how the package is defined. Any assistance would be welcome.

Package and Environment Details (include every applicable attribute)

  • Package Name/Version: pybind11/2.6.1
  • Operating System+version: Linux Ubuntu 18.04
  • Compiler+version: GCC 9.3
  • Conan version: conan 1.31.0
  • Python version: Python 3.6.9

Conan profile (output of conan profile show default or conan profile show <profile> if custom profile is in use)

Configuration for profile default:

[settings]
os=Linux
os_build=Linux
arch=x86_64
arch_build=x86_64
compiler=gcc
compiler.version=9.3
compiler.libcxx=libstdc++11
build_type=Release
[options]
[build_requires]
[env]
CC=/usr/bin/gcc-9
CXX=/usr/bin/g++-9

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
danimtbcommented, Apr 20, 2021

Should be working fine after #4445 got merged

0reactions
prince-chrismccommented, Mar 12, 2021

We are aware, Conan still official supports older versions so we have not changed it =)

Again, you most likely do have your project setup correctly, I’d encourage you to try the slack channel there a lot of helpful community members. You can also open an issue and we’ll do our best to get to it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

message — CMake 3.25.1 Documentation
CMake Deprecation Error or Warning if variable CMAKE_ERROR_DEPRECATED or CMAKE_WARN_DEPRECATED is enabled, respectively, else no message. (none) or NOTICE.
Read more >
How to set warning level in CMake?
For example, if a new warning appears in a future version of the toolchain, the compiler will emit an error and your user...
Read more >
Zephyr CMake Package
Any application located inside this tree, is simply referred to as a Zephyr repository application. In this example hello_world is a Zephyr ...
Read more >
Tutorial: Managing Compiler Warnings with CMake
Previously, I simply modified the CMAKE_CXX_FLAGS variable on the command line to set the appropriate warning flags. So on CI, for example, I ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found