Skip to content

lionlai1989/xtensor_pybind11_cmake

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Steps to reproduce:

  1. Create venv, activate venv, and update pip:
python3 -m venv venv && source venv/bin/activate && python3 -m pip install --upgrade pip
  1. Installation: There are two ways to install.
  • Git clone repo and install from source:
git clone --recursive https://github.com/lionlai1989/xtensor_pybind11_cmake.git
python3 -m pip install .
  • Install from github:
python3 -m pip install "mymodule @ git+ssh://[email protected]/lionlai1989/xtensor_pybind11_cmake.git"
  1. Verify installation:
>>> import numpy as np
>>> import mymodule
>>> v = np.arange(15).reshape(3, 5)
>>> mymodule.sum_of_sines(v)
1.2853996391883833
  1. Link the library xtensor::use_xsimd to my target mymodule in CMakeLists.txt:
  • Uncomment Line:44 in CMakeLists.txt:
target_link_libraries(mymodule PUBLIC xtensor pybind11::module xtensor-python Python::NumPy xtensor::optimize xtensor::use_xsimd)
  • The error when python3 -m pip install .:
      -- Configuring done (1.3s)
      CMake Error at src/mypackage/CMakeLists.txt:5 (target_link_libraries):
        Target "sum_of_sines_static" links to:
      
          xtensor::optimize
      
        but the target was not found.  Possible reasons include:
      
          * There is a typo in the target name.
          * A find_package call is missing for an IMPORTED target.
          * An ALIAS target is missing.
      
      
      
      -- Generating done (0.0s)
      CMake Warning:
        Manually-specified variables were not used by the project:
      
          EXAMPLE_VERSION_INFO
      
      
      CMake Generate step failed.  Build files cannot be regenerated correctly.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published