You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The output of cmake . is below, and you can see that the INCLUDE_DIRS will cause a problem:
-- The C compiler identification is GNU 5.4.1
-- The CXX compiler identification is GNU 5.4.1
-- 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 PythonInterp: /usr/bin/python3.5 (found version "3.5.2")
-- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython3.5m.so
-- Performing Test HAS_CPP14_FLAG
-- Performing Test HAS_CPP14_FLAG - Success
-- Performing Test HAS_CPP11_FLAG
-- Performing Test HAS_CPP11_FLAG - Success
-- Found pybind11 v2.1.dev0: /usr/local/include;/usr/include/python3.5m
-- Performing Test HAS_FLTO
-- Performing Test HAS_FLTO - Success
-- LTO enabled
-- Configuring done
-- Generating done
The output of make VERBOSE=1 is:
[ 50%] Building CXX object CMakeFiles/cmake_example.dir/src/main.cpp.o
/usr/bin/c++ -Dcmake_example_EXPORTS -I/usr/local/include -I/usr/include/python3.5m -fPIC -std=c++14 -flto -fno-fat-lto-objects -o CMakeFiles/cmake_example.dir/src/main.cpp.o -c /home/kevin/src/cmake_example/src/main.cpp
/home/kevin/src/cmake_example/src/main.cpp:1:31: fatal error: pybind11/pybind11.h: No such file or directory
The text was updated successfully, but these errors were encountered:
I've looked into this further and I seem to have solved the problem:
It appears that my pybind11-supplied cmake files were out of date.
Installing pybind11 via pip does not install the pybind11/tools files.
I was able to get things working by installing pybind11 via "cmake . && make install"
In other words, I somehow had out of date files in /usr/local/share/cmake/pybind11. Upgrading pybind11 via sudo pip3 install --upgrade pybind11 did not upgrade those files.
It point 2 above an issue that needs fixing? I have confirmed this behavior on OS X and Ubuntu Linux. The cmake files are, however, installed, via conda install pybind11.
I see now that this came up in #698. It seems like there is a documentation issue here. In order to have both the cmake files installed and the ability to say python -m pybind11 --includes, one has to both make install and pip install . the package. Is that the current state of things?
Issue description
Trying to use find_package in the cmake_example results in failure to find pybind11 headers when pybind11 is in /usr/local
The issue appears to be that the include path is set to
/usr/local/include
rather than/usr/local/include/python3.5
Reproducible example code
This is on Ubuntu 16.04, with pybind11 2.2.1 installed via pip3.
pybind11 does know how to get the correct include paths:
Below is how I found the issue:
I cloned the cmake_example (non-recursively) and modified CMakeLists to read:
The output of
cmake .
is below, and you can see that the INCLUDE_DIRS will cause a problem:The output of
make VERBOSE=1
is:The text was updated successfully, but these errors were encountered: