python中调用C++类

【pybind11笔记】python调用c++类_pybind11调用c++类-CSDN博客

pybind11 documentation

一,conda下安装pyibind11

pip install pybind11
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting pybind11
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/04/e8/a22d08220cb5e230007d9b0c11e429c3b19d01315d1a99dbd45e3bf97386/pybind11-2.13.5-py3-none-any.whl (240 kB)
Installing collected packages: pybind11
Successfully installed pybind11-2.13.5

二,下载最新版本 Version 2.13.5

三,安装 python3-dev,2.13.5版本

        1,第一种方法sudo  apt-get install安装

        2,直接下载代码编译 

四,编译测试程序

mkdir build
cd build
cmake ..
make check -j 4
CMake Error at CMakeLists.txt:95 (find_package):
  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.

报错了

搜索一下是否存在 

find / -name pybind11-config.cmake  #可用find找一下

sudo find / -name pybind11Config.cmake
第二条找到了

cmake cmake -Dpybind11_DIR=/home/tieren/anaconda3/envs/ssp/lib/python3.10/site-packages/pybind11/share/cmake/pybind11/ ..

发现缺少pytest,安装pytest

CMake Warning at /home/tieren/anaconda3/envs/ssp/lib/python3.10/site-packages/pybind11/share/cmake/pybind11/pybind11Common.cmake:282 (message):
  Missing: pytest 3.1

  Try: /home/tieren/anaconda3/envs/ssp/bin/python -m pip install pytest
Call Stack (most recent call first):
  CMakeLists.txt:515 (pybind11_find_import)
pip install pytest

这样cmake 编译就通过了,下面编译程序

make check -j 4
make check -j 16
[  1%] Building CXX object CMakeFiles/cross_module_gil_utils.dir/cross_module_gil_utils.cpp.o
[  3%] Building CXX object CMakeFiles/pybind11_cross_module_tests.dir/pybind11_cross_module_tests.cpp.o
[  5%] Building CXX object CMakeFiles/cross_module_interleaved_error_already_set.dir/cross_module_interleaved_error_already_set.cpp.o
[  7%] Building CXX object CMakeFiles/eigen_tensor_avoid_stl_array.dir/eigen_tensor_avoid_stl_array.cpp.o
[  8%] Building CXX object CMakeFiles/pybind11_tests.dir/pybind11_tests.cpp.o
[ 10%] Building CXX object CMakeFiles/pybind11_tests.dir/test_async.cpp.o
[ 12%] Building CXX object CMakeFiles/pybind11_tests.dir/test_buffers.cpp.o
[ 14%] Building CXX object CMakeFiles/pybind11_tests.dir/test_builtin_casters.cpp.o
[ 15%] Building CXX object CMakeFiles/pybind11_tests.dir/test_const_name.cpp.o
[ 17%] Building CXX object CMakeFiles/pybind11_tests.dir/test_copy_move.cpp.o
[ 19%] Building CXX object CMakeFiles/pybind11_tests.dir/test_class.cpp.o
[ 21%] Building CXX object CMakeFiles/pybind11_tests.dir/test_chrono.cpp.o
[ 24%] Building CXX object CMakeFiles/pybind11_tests.dir/test_callbacks.cpp.o
[ 24%] Building CXX object CMakeFiles/pybind11_tests.dir/test_call_policies.cpp.o
[ 28%] Building CXX object CMakeFiles/pybind11_tests.dir/test_constants_and_functions.cpp.o
[ 28%] Building CXX object CMakeFiles/pybind11_tests.dir/test_custom_type_casters.cpp.o
[ 29%] Building CXX object CMakeFiles/pybind11_tests.dir/test_custom_type_setup.cpp.o
[ 31%] Linking CXX shared module cross_module_gil_utils.cpython-310-x86_64-linux-gnu.so
[ 33%] Building CXX object CMakeFiles/pybind11_tests.dir/test_docstring_options.cpp.o
[ 35%] Building CXX object CMakeFiles/pybind11_tests.dir/test_eigen_matrix.cpp.o
[ 36%] Linking CXX shared module cross_module_interleaved_error_already_set.cpython-310-x86_64-linux-gnu.so
[ 38%] Building CXX object CMakeFiles/pybind11_tests.dir/test_eigen_tensor.cpp.o
[ 40%] Building CXX object CMakeFiles/pybind11_tests.dir/test_enum.cpp.o
[ 42%] Building CXX object CMakeFiles/pybind11_tests.dir/test_eval.cpp.o
[ 43%] Building CXX object CMakeFiles/pybind11_tests.dir/test_exceptions.cpp.o
[ 45%] Building CXX object CMakeFiles/pybind11_tests.dir/test_factory_constructors.cpp.o
[ 45%] Built target cross_module_gil_utils
[ 45%] Built target cross_module_interleaved_error_already_set
[ 49%] Building CXX object CMakeFiles/pybind11_tests.dir/test_gil_scoped.cpp.o
[ 49%] Building CXX object CMakeFiles/pybind11_tests.dir/test_iostream.cpp.o
[ 50%] Building CXX object CMakeFiles/pybind11_tests.dir/test_kwargs_and_defaults.cpp.o
[ 52%] Building CXX object CMakeFiles/pybind11_tests.dir/test_local_bindings.cpp.o
[ 54%] Building CXX object CMakeFiles/pybind11_tests.dir/test_methods_and_attributes.cpp.o
[ 56%] Building CXX object CMakeFiles/pybind11_tests.dir/test_modules.cpp.o
[ 57%] Building CXX object CMakeFiles/pybind11_tests.dir/test_multiple_inheritance.cpp.o
[ 59%] Building CXX object CMakeFiles/pybind11_tests.dir/test_numpy_array.cpp.o
[ 61%] Linking CXX shared module eigen_tensor_avoid_stl_array.cpython-310-x86_64-linux-gnu.so
[ 63%] Building CXX object CMakeFiles/pybind11_tests.dir/test_numpy_dtypes.cpp.o
lto-wrapper: warning: using serial compilation of 3 LTRANS jobs
[ 64%] Building CXX object CMakeFiles/pybind11_tests.dir/test_numpy_vectorize.cpp.o
[ 66%] Building CXX object CMakeFiles/pybind11_tests.dir/test_opaque_types.cpp.o
[ 68%] Building CXX object CMakeFiles/pybind11_tests.dir/test_operator_overloading.cpp.o
[ 70%] Building CXX object CMakeFiles/pybind11_tests.dir/test_pickling.cpp.o
[ 71%] Building CXX object CMakeFiles/pybind11_tests.dir/test_python_multiple_inheritance.cpp.o
[ 73%] Linking CXX shared module pybind11_cross_module_tests.cpython-310-x86_64-linux-gnu.so
[ 75%] Building CXX object CMakeFiles/pybind11_tests.dir/test_pytypes.cpp.o
[ 77%] Building CXX object CMakeFiles/pybind11_tests.dir/test_sequences_and_iterators.cpp.o
lto-wrapper: warning: using serial compilation of 6 LTRANS jobs
[ 78%] Building CXX object CMakeFiles/pybind11_tests.dir/test_smart_ptr.cpp.o
[ 78%] Built target eigen_tensor_avoid_stl_array
[ 80%] Building CXX object CMakeFiles/pybind11_tests.dir/test_stl.cpp.o
[ 82%] Building CXX object CMakeFiles/pybind11_tests.dir/test_stl_binders.cpp.o
[ 84%] Building CXX object CMakeFiles/pybind11_tests.dir/test_tagbased_polymorphic.cpp.o
[ 85%] Building CXX object CMakeFiles/pybind11_tests.dir/test_thread.cpp.o
[ 87%] Building CXX object CMakeFiles/pybind11_tests.dir/test_type_caster_pyobject_ptr.cpp.o
[ 89%] Building CXX object CMakeFiles/pybind11_tests.dir/test_type_caster_std_function_specializations.cpp.o
[ 91%] Building CXX object CMakeFiles/pybind11_tests.dir/test_union.cpp.o
[ 92%] Building CXX object CMakeFiles/pybind11_tests.dir/test_unnamed_namespace_a.cpp.o
[ 94%] Building CXX object CMakeFiles/pybind11_tests.dir/test_unnamed_namespace_b.cpp.o
[ 96%] Building CXX object CMakeFiles/pybind11_tests.dir/test_vector_unique_ptr_member.cpp.o
[ 98%] Building CXX object CMakeFiles/pybind11_tests.dir/test_virtual_functions.cpp.o
[ 98%] Built target pybind11_cross_module_tests
[100%] Linking CXX shared module pybind11_tests.cpython-310-x86_64-linux-gnu.so
lto-wrapper: warning: using serial compilation of 62 LTRANS jobs
[100%] Built target pybind11_tests
================================================== test session starts ===================================================
platform linux -- Python 3.10.14, pytest-8.3.2, pluggy-1.5.0
C++ Info: 11.4.0 C++17 __pybind11_internals_v4_gcc_libstdcpp_cxxabi1016__ PYBIND11_SIMPLE_GIL_MANAGEMENT=False PYBIND11_NUMPY_1_ONLY=False
rootdir: /home/tieren/cpppython/pybind11-2.13.5/tests
configfile: pytest.ini
collected 642 items / 6 skipped                                                                                          

../test_async.py ..                                                                                                [  0%]
../test_builtin_casters.py ........s.......s...                                                                    [  3%]
../test_call_policies.py ........                                                                                  [  4%]
../test_callbacks.py .............s.                                                                               [  7%]
../test_chrono.py ...........................................                                                      [ 13%]
../test_class.py ....................................                                                              [ 19%]
../test_const_name.py ......................                                                                       [ 22%]
../test_constants_and_functions.py ......                                                                          [ 23%]
../test_copy_move.py .........                                                                                     [ 25%]
../test_custom_type_casters.py ...                                                                                 [ 25%]
../test_custom_type_setup.py ..                                                                                    [ 25%]
../test_docstring_options.py .                                                                                     [ 26%]
../test_enum.py ..........                                                                                         [ 27%]
../test_eval.py ....                                                                                               [ 28%]
../test_exceptions.py ..........................                                                                   [ 32%]
../test_factory_constructors.py ...............                                                                    [ 34%]
../test_gil_scoped.py ..........................................................................................   [ 48%]
../test_iostream.py ......................                                                                         [ 52%]
../test_kwargs_and_defaults.py ........                                                                            [ 53%]
../test_local_bindings.py ..........                                                                               [ 54%]
../test_methods_and_attributes.py .......................                                                          [ 58%]
../test_modules.py .......                                                                                         [ 59%]
../test_multiple_inheritance.py ..................                                                                 [ 62%]
../test_opaque_types.py ...                                                                                        [ 62%]
../test_operator_overloading.py .....                                                                              [ 63%]
../test_pickling.py ........                                                                                       [ 64%]
../test_python_multiple_inheritance.py ..                                                                          [ 65%]
../test_pytypes.py .............................s................................................................. [ 79%]
...........sssssssssss                                                                                             [ 83%]
../test_sequences_and_iterators.py ................                                                                [ 85%]
../test_smart_ptr.py .............                                                                                 [ 87%]
../test_stl.py .........ss............                                                                             [ 91%]
../test_stl_binders.py ..s...........                                                                              [ 93%]
../test_tagbased_polymorphic.py .                                                                                  [ 93%]
../test_thread.py ..                                                                                               [ 94%]
../test_type_caster_pyobject_ptr.py .................                                                              [ 96%]
../test_type_caster_std_function_specializations.py .                                                              [ 96%]
../test_union.py .                                                                                                 [ 97%]
../test_unnamed_namespace_a.py ....                                                                                [ 97%]
../test_unnamed_namespace_b.py .                                                                                   [ 97%]
../test_vector_unique_ptr_member.py ....                                                                           [ 98%]
../test_virtual_functions.py ..........                                                                            [100%]

================================================ short test summary info =================================================
SKIPPED [1] ../test_buffers.py:13: could not import 'numpy': No module named 'numpy'
SKIPPED [1] ../test_eigen_matrix.py:7: could not import 'numpy': No module named 'numpy'
SKIPPED [1] ../test_eigen_tensor.py:7: could not import 'numpy': No module named 'numpy'
SKIPPED [1] ../test_numpy_array.py:8: could not import 'numpy': No module named 'numpy'
SKIPPED [1] ../test_numpy_dtypes.py:11: could not import 'numpy': No module named 'numpy'
SKIPPED [1] ../test_numpy_vectorize.py:7: could not import 'numpy': No module named 'numpy'
SKIPPED [1] ../test_builtin_casters.py:322: could not import 'numpy': No module named 'numpy'
SKIPPED [1] ../test_builtin_casters.py:492: could not import 'numpy': No module named 'numpy'
SKIPPED [1] ../test_callbacks.py:218: Current PYBIND11_INTERNALS_VERSION too low
SKIPPED [1] ../test_pytypes.py:420: Not defined: PYBIND11_HANDLE_REF_DEBUG
SKIPPED [1] ../test_pytypes.py:1027: C++20 feature not available.
SKIPPED [1] ../test_pytypes.py:1038: C++20 feature not available.
SKIPPED [3] ../test_pytypes.py:1053: <ranges> not available.
SKIPPED [3] ../test_pytypes.py:1066: <ranges> not available.
SKIPPED [3] ../test_pytypes.py:1078: <ranges> not available.
SKIPPED [1] ../test_stl.py:149: no <experimental/optional>
SKIPPED [1] ../test_stl.py:181: no <boost/optional>
SKIPPED [1] ../test_stl_binders.py:91: could not import 'numpy': No module named 'numpy'
============================================ 624 passed, 24 skipped in 7.75s =============================================
[100%] Built target pytest
[100%] Built target check

安装numpy  

pip install numpy

再次make check -j 16

make check -j 16
Consolidate compiler generated dependencies of target cross_module_gil_utils
Consolidate compiler generated dependencies of target pybind11_cross_module_tests
Consolidate compiler generated dependencies of target cross_module_interleaved_error_already_set
Consolidate compiler generated dependencies of target eigen_tensor_avoid_stl_array
[  3%] Built target cross_module_gil_utils
[  8%] Built target cross_module_interleaved_error_already_set
[ 10%] Built target pybind11_cross_module_tests
[ 14%] Built target eigen_tensor_avoid_stl_array
Consolidate compiler generated dependencies of target pybind11_tests
[100%] Built target pybind11_tests
================================================== test session starts ===================================================
platform linux -- Python 3.10.14, pytest-8.3.2, pluggy-1.5.0
C++ Info: 11.4.0 C++17 __pybind11_internals_v4_gcc_libstdcpp_cxxabi1016__ PYBIND11_SIMPLE_GIL_MANAGEMENT=False PYBIND11_NUMPY_1_ONLY=False
rootdir: /home/tieren/cpppython/pybind11-2.13.5/tests
configfile: pytest.ini
collected 893 items                                                                                                      

../test_async.py ..                                                                                                [  0%]
../test_buffers.py ..........................                                                                      [  3%]
../test_builtin_casters.py ....................                                                                    [  5%]
../test_call_policies.py ........                                                                                  [  6%]
../test_callbacks.py .............s.                                                                               [  7%]
../test_chrono.py ...........................................                                                      [ 12%]
../test_class.py ....................................                                                              [ 16%]
../test_const_name.py ......................                                                                       [ 19%]
../test_constants_and_functions.py ......                                                                          [ 19%]
../test_copy_move.py .........                                                                                     [ 20%]
../test_custom_type_casters.py ...                                                                                 [ 21%]
../test_custom_type_setup.py ..                                                                                    [ 21%]
../test_docstring_options.py .                                                                                     [ 21%]
../test_eigen_matrix.py ......................ss.......                                                            [ 25%]
../test_eigen_tensor.py .......................................................................................... [ 35%]
...................                                                                                                [ 37%]
../test_enum.py ..........                                                                                         [ 38%]
../test_eval.py ....                                                                                               [ 38%]
../test_exceptions.py ..........................                                                                   [ 41%]
../test_factory_constructors.py ...............                                                                    [ 43%]
../test_gil_scoped.py ..........................................................................................   [ 53%]
../test_iostream.py ......................                                                                         [ 55%]
../test_kwargs_and_defaults.py ........                                                                            [ 56%]
../test_local_bindings.py ..........                                                                               [ 58%]
../test_methods_and_attributes.py .......................                                                          [ 60%]
../test_modules.py .......                                                                                         [ 61%]
../test_multiple_inheritance.py ..................                                                                 [ 63%]
../test_numpy_array.py ..............................................................                              [ 70%]
../test_numpy_dtypes.py ...............                                                                            [ 72%]
../test_numpy_vectorize.py ........                                                                                [ 72%]
../test_opaque_types.py ...                                                                                        [ 73%]
../test_operator_overloading.py .....                                                                              [ 73%]
../test_pickling.py ........                                                                                       [ 74%]
../test_python_multiple_inheritance.py ..                                                                          [ 74%]
../test_pytypes.py .............................s................................................................. [ 85%]
...........sssssssssss                                                                                             [ 88%]
../test_sequences_and_iterators.py ................                                                                [ 89%]
../test_smart_ptr.py .............                                                                                 [ 91%]
../test_stl.py .........ss............                                                                             [ 93%]
../test_stl_binders.py ..............                                                                              [ 95%]
../test_tagbased_polymorphic.py .                                                                                  [ 95%]
../test_thread.py ..                                                                                               [ 95%]
../test_type_caster_pyobject_ptr.py .................                                                              [ 97%]
../test_type_caster_std_function_specializations.py .                                                              [ 97%]
../test_union.py .                                                                                                 [ 97%]
../test_unnamed_namespace_a.py ....                                                                                [ 98%]
../test_unnamed_namespace_b.py .                                                                                   [ 98%]
../test_vector_unique_ptr_member.py ....                                                                           [ 98%]
../test_virtual_functions.py ..........                                                                            [100%]

================================================ short test summary info =================================================
SKIPPED [1] ../test_callbacks.py:218: Current PYBIND11_INTERNALS_VERSION too low
SKIPPED [1] ../test_eigen_matrix.py:750: could not import 'scipy': No module named 'scipy'
SKIPPED [1] ../test_eigen_matrix.py:760: could not import 'scipy': No module named 'scipy'
SKIPPED [1] ../test_pytypes.py:420: Not defined: PYBIND11_HANDLE_REF_DEBUG
SKIPPED [1] ../test_pytypes.py:1027: C++20 feature not available.
SKIPPED [1] ../test_pytypes.py:1038: C++20 feature not available.
SKIPPED [3] ../test_pytypes.py:1053: <ranges> not available.
SKIPPED [3] ../test_pytypes.py:1066: <ranges> not available.
SKIPPED [3] ../test_pytypes.py:1078: <ranges> not available.
SKIPPED [1] ../test_stl.py:149: no <experimental/optional>
SKIPPED [1] ../test_stl.py:181: no <boost/optional>
============================================ 876 passed, 17 skipped in 10.93s ============================================
[100%] Built target pytest
[100%] Built target check

缺少scipy,pip install scipy,再次编译make check -j 16

make check -j 16
[  8%] Built target cross_module_interleaved_error_already_set
[  8%] Built target cross_module_gil_utils
[ 10%] Built target pybind11_cross_module_tests
[ 14%] Built target eigen_tensor_avoid_stl_array
[100%] Built target pybind11_tests
================================================== test session starts ===================================================
platform linux -- Python 3.10.14, pytest-8.3.2, pluggy-1.5.0
C++ Info: 11.4.0 C++17 __pybind11_internals_v4_gcc_libstdcpp_cxxabi1016__ PYBIND11_SIMPLE_GIL_MANAGEMENT=False PYBIND11_NUMPY_1_ONLY=False
rootdir: /home/tieren/cpppython/pybind11-2.13.5/tests
configfile: pytest.ini
collected 893 items                                                                                                      

../test_async.py ..                                                                                                [  0%]
../test_buffers.py ..........................                                                                      [  3%]
../test_builtin_casters.py ....................                                                                    [  5%]
../test_call_policies.py ........                                                                                  [  6%]
../test_callbacks.py .............s.                                                                               [  7%]
../test_chrono.py ...........................................                                                      [ 12%]
../test_class.py ....................................                                                              [ 16%]
../test_const_name.py ......................                                                                       [ 19%]
../test_constants_and_functions.py ......                                                                          [ 19%]
../test_copy_move.py .........                                                                                     [ 20%]
../test_custom_type_casters.py ...                                                                                 [ 21%]
../test_custom_type_setup.py ..                                                                                    [ 21%]
../test_docstring_options.py .                                                                                     [ 21%]
../test_eigen_matrix.py ...............................                                                            [ 25%]
../test_eigen_tensor.py .......................................................................................... [ 35%]
...................                                                                                                [ 37%]
../test_enum.py ..........                                                                                         [ 38%]
../test_eval.py ....                                                                                               [ 38%]
../test_exceptions.py ..........................                                                                   [ 41%]
../test_factory_constructors.py ...............                                                                    [ 43%]
../test_gil_scoped.py ..........................................................................................   [ 53%]
../test_iostream.py ......................                                                                         [ 55%]
../test_kwargs_and_defaults.py ........                                                                            [ 56%]
../test_local_bindings.py ..........                                                                               [ 58%]
../test_methods_and_attributes.py .......................                                                          [ 60%]
../test_modules.py .......                                                                                         [ 61%]
../test_multiple_inheritance.py ..................                                                                 [ 63%]
../test_numpy_array.py ..............................................................                              [ 70%]
../test_numpy_dtypes.py ...............                                                                            [ 72%]
../test_numpy_vectorize.py ........                                                                                [ 72%]
../test_opaque_types.py ...                                                                                        [ 73%]
../test_operator_overloading.py .....                                                                              [ 73%]
../test_pickling.py ........                                                                                       [ 74%]
../test_python_multiple_inheritance.py ..                                                                          [ 74%]
../test_pytypes.py .............................s................................................................. [ 85%]
...........sssssssssss                                                                                             [ 88%]
../test_sequences_and_iterators.py ................                                                                [ 89%]
../test_smart_ptr.py .............                                                                                 [ 91%]
../test_stl.py .........ss............                                                                             [ 93%]
../test_stl_binders.py ..............                                                                              [ 95%]
../test_tagbased_polymorphic.py .                                                                                  [ 95%]
../test_thread.py ..                                                                                               [ 95%]
../test_type_caster_pyobject_ptr.py .................                                                              [ 97%]
../test_type_caster_std_function_specializations.py .                                                              [ 97%]
../test_union.py .                                                                                                 [ 97%]
../test_unnamed_namespace_a.py ....                                                                                [ 98%]
../test_unnamed_namespace_b.py .                                                                                   [ 98%]
../test_vector_unique_ptr_member.py ....                                                                           [ 98%]
../test_virtual_functions.py ..........                                                                            [100%]

================================================ short test summary info =================================================
SKIPPED [1] ../test_callbacks.py:218: Current PYBIND11_INTERNALS_VERSION too low
SKIPPED [1] ../test_pytypes.py:420: Not defined: PYBIND11_HANDLE_REF_DEBUG
SKIPPED [1] ../test_pytypes.py:1027: C++20 feature not available.
SKIPPED [1] ../test_pytypes.py:1038: C++20 feature not available.
SKIPPED [3] ../test_pytypes.py:1053: <ranges> not available.
SKIPPED [3] ../test_pytypes.py:1066: <ranges> not available.
SKIPPED [3] ../test_pytypes.py:1078: <ranges> not available.
SKIPPED [1] ../test_stl.py:149: no <experimental/optional>
SKIPPED [1] ../test_stl.py:181: no <boost/optional>
============================================ 878 passed, 15 skipped in 11.06s ============================================
[100%] Built target pytest
[100%] Built target check

到这里编译基本过关!

编译已有的例子

[scikit_build_example]

https://github.com/pybind/scikit_build_example

  • pip install ./scikit_build_example
 pip install ./scikit_build_example-master
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Processing ./scikit_build_example-master
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: scikit_build_example
  Building wheel for scikit_build_example (pyproject.toml) ... done
  Created wheel for scikit_build_example: filename=scikit_build_example-0.0.1-cp310-cp310-linux_x86_64.whl size=56371 sha256=6a05e18503a79b5f11bb60cd687495c6742ef53ae6e56945c5d7fb48b15363d1
  Stored in directory: /home/tieren/.cache/pip/wheels/ca/9b/7c/4a8f9bdf4e3a42c8e1d87ef78717e25de45b3cb1944b2da25e
Successfully built scikit_build_example
Installing collected packages: scikit_build_example
Successfully installed scikit_build_example-0.0.1

编译cmake_example

pip install ./cmake_example
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Processing ./cmake_example
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: cmake_example
  Building wheel for cmake_example (pyproject.toml) ... done
  Created wheel for cmake_example: filename=cmake_example-0.0.1-cp310-cp310-linux_x86_64.whl size=52522 sha256=5085de9106769de8c9e22e473c370971246257c7b8b43d6343c2f9c129652207
  Stored in directory: /tmp/pip-ephem-wheel-cache-96kqossf/wheels/95/b6/9b/2705ad99f1c7156e7a97c5da1a5620fb8b16863b19aa2bb3ae
Successfully built cmake_example
Installing collected packages: cmake_example
Successfully installed cmake_example-0.0.1

初步功能完成。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值