symforce-org / symforce

Fast symbolic computation, code generation, and nonlinear optimization for robotics
https://symforce.org
Apache License 2.0
1.41k stars 145 forks source link

Cython not found in Python binary directory #240

Open aaron-skydio opened 1 year ago

aaron-skydio commented 1 year ago

Describe the bug If building in a Python environment whose bin directory is not on the PATH (e.g. doing a local pip install but not in a conda environment), symenginepy will not find Cython. symenginepy uses CMake find_program at FindCython.cmake:8, and fails with the error on line 48.

We should probably fix this by either telling symenginepy where to find cython, adding the directory containing the cython binary to PATH for the symenginepy build, or modifying the symenginepy build to always invoke cython as python -m cython.

Sample error message:

-- Python include path: /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8
-- Python version: 3.8
-- Python install path: /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages
-- Found Python: /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8  
CMake Error at cmake/FindCython.cmake:48 (MESSAGE):
  Could not find Cython.  Please install Cython.
Call Stack (most recent call first):
  CMakeLists.txt:17 (find_package)

Environment (please complete the following information):