-
I'm trying to get pybind11 working on a new system. I have tried multiple versions of pybind11, along with both python 3.8.8 and a 3.9.0. No matter what I do, even simple examples cause a segmentation fault on import. This happens on the tests as well and they fail. Example cmake outptut: -- The CXX compiler identification is GNU 8.4.1
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- pybind11 v2.7.1
-- CMake 3.19.7
-- Found PythonInterp: /usr/licensed/anaconda3/2021.5/bin/python3.8 (found version "3.8.8")
-- Found PythonLibs: /usr/licensed/anaconda3/2021.5/lib/libpython3.8.so
-- PYTHON 3.8.8
-- Performing Test HAS_FLTO
-- Performing Test HAS_FLTO - Success
-- pybind11::lto enabled
-- pybind11::thin_lto enabled
-- Setting tests build type to MinSizeRel as none was specified
-- Building tests with Eigen v3.3.4
-- Found Boost: /usr/include (found suitable version "1.66.0", minimum required is "1.56")
-- Found pytest 6.2.3
-- Downloading catch v2.13.2...
-- Building interpreter tests using Catch v2.13.2
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- pybind11 v2.7.1
-- pybind11 v2.7.1
-- Configuring done
-- Generating done
-- Build files have been written to: /foo/pybind11-2.7.1/build Compile line cd /foo/pybind11-2.7.1/build/tests && /usr/bin/c++ -DPYBIND11_TEST_BOOST -DPYBIND11_TEST_EIGEN -Dpybind11_tests_EXPORTS -I/foo/pybind11-2.7.1/include -isystem /usr/licensed/anaconda3/2021.5/include/python3.8 -isystem /usr/include/eigen3 -Os -DNDEBUG -fPIC -fvisibility=hidden -Wall -Wextra -Wconversion -Wcast-qual -Wdeprecated -Wundef -Wnon-virtual-dtor -flto -fno-fat-lto-objects -o CMakeFiles/pybind11_tests.dir/pybind11_tests.cpp.o -c /foo/pybind11-2.7.1/tests/pybind11_tests.cpp Abbreviated link line cd /foo/pybind11-2.7.1/build/tests && /usr/local/cmake/3.19.7/bin/cmake -E cmake_link_script CMakeFiles/pybind11_tests.dir/link.txt --verbose=1
/usr/bin/c++ -fPIC -Os -DNDEBUG -flto -shared -o pybind11_tests.cpython-38-x86_64-linux-gnu.so CMakeFiles/pybind11_tests.dir/pybind11_tests.cpp.o ... -lstdc++fs Test output $ make check
[ 4%] Built target cross_module_gil_utils
[ 8%] Built target pybind11_cross_module_tests
[ 89%] Built target pybind11_tests
make[3]: *** [tests/CMakeFiles/pytest.dir/build.make:78: tests/CMakeFiles/pytest] Segmentation fault (core dumped)
make[2]: *** [CMakeFiles/Makefile2:364: tests/CMakeFiles/pytest.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:429: tests/CMakeFiles/check.dir/rule] Error 2
make: *** [Makefile:262: check] Error 2 Any help or advice on what the issue could be would be greatly appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Are you using the compiler used for Python? If there's a pretty bad compiler mismatch, that could cause issues building extensions. (We test on lots of systems, so don't see an obvious problem - the fact you seem to be able to pick Pythons makes that the most obvious thing that might have an issue) |
Beta Was this translation helpful? Give feedback.
Are you using the compiler used for Python? If there's a pretty bad compiler mismatch, that could cause issues building extensions.
(We test on lots of systems, so don't see an obvious problem - the fact you seem to be able to pick Pythons makes that the most obvious thing that might have an issue)