-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Build issue on linux(centos) #1159
Comments
It's a bit hard to tell from that output what's happening--it looks either truncated or reformatted. Can you post the cmake invocation from a clean build directory, too (so that we can see how the project gets configured). You can also try using |
So, I tried |
Oops, that should have been |
With |
I'm using a python virtual environment. Below is the logs of cmake invocation and the verbose build logs: 1. Cmake invocation logs : (python3_env1) [user@lnxdev02 build]$ cmake .. I did a Pytest download and here is the details for them - (python3_env1) [user@lnxdev02 build]$ /mnt/home/user/python3_env1/bin/python -m pip install pytest 2. Verbose make logs 'make check VERBOSE=1' /usr/bin/cmake -H/mnt/lnxutil6/user/python3_env1/pybind11-master -B/mnt/lnxutil6/user/python3_env1/pybind11-master/build --check-build-system CMakeFiles/Makefile.cmake 0 |
Please surround multiline output with three tick-marks ```, that keeps the formatting easy to read. That's not a normal env for CentOS7, GCC 4.8 is the default. Did you build it with make first? It looks to me like it's trying to run the test without building first - I don't think it's set up with the dependencies that way. Also, finally, try |
Ahh, I think that error comes from the fact you are in a virtual environment. Pybind11 can't detect a virtual environment when you are using the embedded interpreter, and |
Well, I did install this on a virtual environment on my personal machine. However, I find this error in my work environment. I am not sure why. |
CMake's find_library can return a static library in some conditions (certainly if the shared object isn't present; I'm not sure if there are other conditions as well), which we don't support (and fails). This improves the libpython detection by getting the shared library name directly from Python rather than letting CMake guess (by prepending `lib` and appending library suffixes). This should, at least, prevent the embedded build from failing as in issue pybind#1159 -- instead it should either find the proper shared library, or else result in a compilation failure from the missing library.
My guess is that the issue is coming from:
AFAICT we don't support linking in a static python; I've submitted PR #1162 that should hopefully avoid picking up the static libpython in the future. It's either going to fix your build by finding the correct shared library or else break it, but at least if it breaks it it'll (hopefully) now be with a missing library error. |
In the meantime, you can use |
Thanks Jagerman.
|
This only affects embedding. For regular module use everything should work fine (modules don't link to Python, but rather are built with missng symbols that get provided when the module is loaded by Python). I don't know the answer to 2 if you want to embed statically. I expect it is possible, but will take some effort. |
This is needed when using linuxdeploy / appimagecraft to create an AppImage and when cross compiling (f.e. with MXE) to find the python libraries. You may need to set CMAKE_FIND_ROOT_PATH_MODE_LIBRARY to BOTH when cross compiling. This may fix issues pybind#1718, pybind#1159, pybind#1330 and pybind#99.
This is needed when using linuxdeploy / appimagecraft to create an AppImage and when cross compiling (f.e. with MXE) to find the python libraries. You may need to set CMAKE_FIND_ROOT_PATH_MODE_LIBRARY to BOTH when cross compiling. This may fix issues pybind#1718, pybind#1159, pybind#1330 and pybind#99.
This is needed when using linuxdeploy / appimagecraft to create an AppImage and when cross compiling (f.e. with MXE) to find the python libraries. You may need to set CMAKE_FIND_ROOT_PATH_MODE_LIBRARY to BOTH when cross compiling. This may fix issues pybind#1718, pybind#1159, pybind#1330 and pybind#99.
Any solution to solve this issue? I have the same issue and I am on MacOs. @srinivasavaradan |
#1162 was closed because of complications (read further, there). I'm closing this. Do reopen if this is still a problem (after almost 3 years without further discussion). @Jeff-avatar Please open a new issue with a description of what goes wrong (and preferably a minimal example that we can try for ourselves). That's going to be easier to deal with. |
@YannickJadoul Thank you very much for your replay. I reopened an issue here, #2295 (comment). |
This is needed when using linuxdeploy / appimagecraft to create an AppImage and when cross compiling (f.e. with MXE) to find the python libraries. You may need to set CMAKE_FIND_ROOT_PATH_MODE_LIBRARY to BOTH when cross compiling. This may fix issues pybind#1718, pybind#1159, pybind#1330 and pybind#99.
Hello,
I downloaded pybind11 and ran the following steps as mentioned in the document - http://pybind11.readthedocs.io/en/master/basics.html
After installing the prerequisites, I do -
mkdir build
cd build
cmake ..
make check -j 4
After successfully completing the step 'cmake ..' I get the below errors after step 'make check -j 4'-
make[3]: * [tests/test_cmake_build/CMakeFiles/test_subdirectory_embed] Error 1 make[2]: * [tests/test_cmake_build/CMakeFiles/test_subdirectory_embed.dir/all] Error 2 make[2]: *** Waiting for unfinished jobs....
make[1]: * [tests/CMakeFiles/check.dir/rule] Error 2 make: * [check] Error 2
I am not sure what this means or how to fix this. Can someone point me in the right direction or explain what is happening here?.
Below is the complete log when I run 'make check -j 4'
"
Scanning dependencies of target test_subdirectory_embed Scanning dependencies of target test_subdirectory_target Scanning dependencies of target mock_install Scanning dependencies of target test_subdirectory_function -- Install configuration: "MinSizeRel" -- Installing: /mnt/home/srinivasa/python3_env/pybind11/build/mock_install/include/pybind11 -- Installing: /mnt/home/srinivasa/python3_env/pybind11/build/mock_install/include/pybind11/detail -- Installing: /mnt/home/srinivasa/python3_env/pybind11/build/mock_install/include/pybind11/detail/internals.h -- Installing: /mnt/home/srinivasa/python3_env/pybind11/build/mock_install/include/pybind11/detail/class.h -- Installing: /mnt/home/srinivasa/python3_env/pybind11/build/mock_install/include/pybind11/detail/typeid.h -- Installing: /mnt/home/srinivasa/python3_env/pybind11/build/mock_install/include/pybind11/detail/descr.h -- Installing: /mnt/home/srinivasa/python3_env/pybind11/build/mock_install/include/pybind11/detail/common.h -- Installing: /mnt/home/srinivasa/python3_env/pybind11/build/mock_install/include/pybind11/detail/init.h -- Installing: /mnt/home/srinivasa/python3_env/pybind11/build/mock_install/include/pybind11/pybind11.h -- Installing: /mnt/home/srinivasa/python3_env/pybind11/build/mock_install/include/pybind11/cast.h -- Installing: /mnt/home/srinivasa/python3_env/pybind11/build/mock_install/include/pybind11/common.h -- Installing: /mnt/home/srinivasa/python3_env/pybind11/build/mock_install/include/pybind11/attr.h -- Installing: /mnt/home/srinivasa/python3_env/pybind11/build/mock_install/include/pybind11/iostream.h -- Installing: /mnt/home/srinivasa/python3_env/pybind11/build/mock_install/include/pybind11/eigen.h -- Installing: /mnt/home/srinivasa/python3_env/pybind11/build/mock_install/include/pybind11/options.h -- Installing: /mnt/home/srinivasa/python3_env/pybind11/build/mock_install/include/pybind11/pytypes.h -- Installing: /mnt/home/srinivasa/python3_env/pybind11/build/mock_install/include/pybind11/stl_bind.h -- Installing: /mnt/home/srinivasa/python3_env/pybind11/build/mock_install/include/pybind11/buffer_info.h -- Installing: /mnt/home/srinivasa/python3_env/pybind11/build/mock_install/include/pybind11/chrono.h -- Installing: /mnt/home/srinivasa/python3_env/pybind11/build/mock_install/include/pybind11/eval.h -- Installing: /mnt/home/srinivasa/python3_env/pybind11/build/mock_install/include/pybind11/stl.h -- Installing: /mnt/home/srinivasa/python3_env/pybind11/build/mock_install/include/pybind11/embed.h -- Installing: /mnt/home/srinivasa/python3_env/pybind11/build/mock_install/include/pybind11/numpy.h -- Installing: /mnt/home/srinivasa/python3_env/pybind11/build/mock_install/include/pybind11/operators.h -- Installing: /mnt/home/srinivasa/python3_env/pybind11/build/mock_install/include/pybind11/functional.h -- Installing: /mnt/home/srinivasa/python3_env/pybind11/build/mock_install/include/pybind11/complex.h -- Installing: /mnt/home/srinivasa/python3_env/pybind11/build/mock_install/share/cmake/pybind11/pybind11Config.cmake -- Installing: /mnt/home/srinivasa/python3_env/pybind11/build/mock_install/share/cmake/pybind11/pybind11ConfigVersion.cmake -- Installing: /mnt/home/srinivasa/python3_env/pybind11/build/mock_install/share/cmake/pybind11/FindPythonLibsNew.cmake -- Installing: /mnt/home/srinivasa/python3_env/pybind11/build/mock_install/share/cmake/pybind11/pybind11Tools.cmake -- Installing: /mnt/home/srinivasa/python3_env/pybind11/build/mock_install/share/cmake/pybind11/pybind11Targets.cmake [ 0%] Built target mock_install Scanning dependencies of target pybind11_tests [ 2%] Building CXX object tests/CMakeFiles/pybind11_tests.dir/pybind11_tests.cpp.o [ 5%] Building CXX object tests/CMakeFiles/pybind11_tests.dir/test_buffers.cpp.o [ 8%] Building CXX object tests/CMakeFiles/pybind11_tests.dir/test_builtin_casters.cpp.o [ 11%] Building CXX object tests/CMakeFiles/pybind11_tests.dir/test_call_policies.cpp.o [ 14%] Building CXX object tests/CMakeFiles/pybind11_tests.dir/test_callbacks.cpp.o [ 17%] Building CXX object tests/CMakeFiles/pybind11_tests.dir/test_chrono.cpp.o [ 17%] Built target test_subdirectory_target Scanning dependencies of target pybind11_cross_module_tests [ 20%] Building CXX object tests/CMakeFiles/pybind11_cross_module_tests.dir/pybind11_cross_module_tests.cpp.o make[3]: * [tests/test_cmake_build/CMakeFiles/test_subdirectory_embed] Error 1 make[2]: [tests/test_cmake_build/CMakeFiles/test_subdirectory_embed.dir/all] Error 2 make[2]: Waiting for unfinished jobs.... [ 22%] Building CXX object tests/CMakeFiles/pybind11_tests.dir/test_class.cpp.o [ 22%] Built target test_subdirectory_function [ 25%] Building CXX object tests/CMakeFiles/pybind11_tests.dir/test_constants_and_functions.cpp.o [ 28%] Building CXX object tests/CMakeFiles/pybind11_tests.dir/test_copy_move.cpp.o [ 31%] Building CXX object tests/CMakeFiles/pybind11_tests.dir/test_docstring_options.cpp.o [ 34%] Building CXX object tests/CMakeFiles/pybind11_tests.dir/test_enum.cpp.o [ 37%] Building CXX object tests/CMakeFiles/pybind11_tests.dir/test_eval.cpp.o [ 40%] Building CXX object tests/CMakeFiles/pybind11_tests.dir/test_exceptions.cpp.o [ 42%] Building CXX object tests/CMakeFiles/pybind11_tests.dir/test_factory_constructors.cpp.o [ 45%] Building CXX object tests/CMakeFiles/pybind11_tests.dir/test_iostream.cpp.o [ 48%] Building CXX object tests/CMakeFiles/pybind11_tests.dir/test_kwargs_and_defaults.cpp.o [ 51%] Linking CXX shared module ../../tests/pybind11_cross_module_tests.cpython-36m-x86_64-linux-gnu.so [ 54%] Building CXX object tests/CMakeFiles/pybind11_tests.dir/test_local_bindings.cpp.o [ 57%] Building CXX object tests/CMakeFiles/pybind11_tests.dir/test_methods_and_attributes.cpp.o [ 60%] Building CXX object tests/CMakeFiles/pybind11_tests.dir/test_modules.cpp.o [ 60%] Built target pybind11_cross_module_tests [ 62%] Building CXX object tests/CMakeFiles/pybind11_tests.dir/test_multiple_inheritance.cpp.o [ 65%] Building CXX object tests/CMakeFiles/pybind11_tests.dir/test_numpy_array.cpp.o [ 68%] Building CXX object tests/CMakeFiles/pybind11_tests.dir/test_numpy_dtypes.cpp.o [ 71%] Building CXX object tests/CMakeFiles/pybind11_tests.dir/test_numpy_vectorize.cpp.o [ 74%] Building CXX object tests/CMakeFiles/pybind11_tests.dir/test_opaque_types.cpp.o [ 77%] Building CXX object tests/CMakeFiles/pybind11_tests.dir/test_operator_overloading.cpp.o [ 80%] Building CXX object tests/CMakeFiles/pybind11_tests.dir/test_pickling.cpp.o [ 82%] Building CXX object tests/CMakeFiles/pybind11_tests.dir/test_pytypes.cpp.o [ 85%] Building CXX object tests/CMakeFiles/pybind11_tests.dir/test_sequences_and_iterators.cpp.o [ 88%] Building CXX object tests/CMakeFiles/pybind11_tests.dir/test_smart_ptr.cpp.o [ 91%] Building CXX object tests/CMakeFiles/pybind11_tests.dir/test_stl.cpp.o [ 94%] Building CXX object tests/CMakeFiles/pybind11_tests.dir/test_stl_binders.cpp.o [ 97%] Building CXX object tests/CMakeFiles/pybind11_tests.dir/test_virtual_functions.cpp.o [100%] Linking CXX shared module ../../tests/pybind11_tests.cpython-36m-x86_64-linux-gnu.so ------ pybind11_tests.cpython-36m-x86_64-linux-gnu.so file size: 1807600 [100%] Built target pybind11_tests make[1]: * [tests/CMakeFiles/check.dir/rule] Error 2 make: *** [check] Error 2
"
The text was updated successfully, but these errors were encountered: