Skip to content
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

Python3.11 + Cython-0.29.35 FindCython.cmake:71 issue #989

Closed
Nic30 opened this issue May 27, 2023 · 2 comments
Closed

Python3.11 + Cython-0.29.35 FindCython.cmake:71 issue #989

Nic30 opened this issue May 27, 2023 · 2 comments

Comments

@Nic30
Copy link

Nic30 commented May 27, 2023

Hello,
I found out that with python3.11 and latest cython something broke.
skbuild/resources/cmake/FindCython.cmake can not find cython no more.
(My guess is that it is some form of incompatibility with python3.11 or pip)
The cython is installed in system and also in virtualenv which I am using.
But use of virtual env does not make any difference and I am just saying for the sake of completeness.

project.toml

[build-system]
requires = ["setuptools", "wheel", "scikit-build", "Cython", "cmake", "ninja"]
build-backend = "setuptools.build_meta"
  • Ubuntu 23.04
  • scikit-build==0.17.5
  • pip3=23.0.1

$ whereis cython

/usr/local/bin/cython $PROJECT_DIR/venv/bin/cython 

$ cython --version

Cython version 0.29.35

$ python3 -m pip install .

Processing $PROJECT_DIR
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: $PROJECT_NAME
  Building wheel for $PROJECT_NAME (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Building wheel for $PROJECT_NAME (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [78 lines of output]
      
      
      --------------------------------------------------------------------------------
      -- Trying 'Ninja' generator
      --------------------------------
      ---------------------------
      ----------------------
      -----------------
      ------------
      -------
      --
      Not searching for unused variables given on the command line.
      -- The C compiler identification is GNU 12.2.0
      -- Detecting C compiler ABI info
      -- Detecting C compiler ABI info - done
      -- Check for working C compiler: /usr/bin/cc - skipped
      -- Detecting C compile features
      -- Detecting C compile features - done
      -- The CXX compiler identification is GNU 12.2.0
      -- 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
      -- Configuring done (0.2s)
      -- Generating done (0.0s)
      -- Build files have been written to: $PROJECT_DIR/_cmake_test_compile/build
      --
      -------
      ------------
      -----------------
      ----------------------
      ---------------------------
      --------------------------------
      -- Trying 'Ninja' generator - success
      --------------------------------------------------------------------------------
      
      Configuring Project
        Working directory:
          $PROJECT_DIR/_skbuild/linux-x86_64-3.11/cmake-build
        Command:
          /tmp/pip-build-env-z73uw8oc/overlay/lib/python3.11/site-packages/cmake/data/bin/cmake $PROJECT_DIR -G Ninja -DCMAKE_MAKE_PROGRAM:FILEPATH=/tmp/pip-build-env-z73uw8oc/overlay/lib/python3.11/site-packages/ninja/data/bin/ninja --no-warn-unused-cli -DCMAKE_INSTALL_PREFIX:PATH=$PROJECT_DIR/_skbuild/linux-x86_64-3.11/cmake-install -DPYTHON_VERSION_STRING:STRING=3.11.2 -DSKBUILD:INTERNAL=TRUE -DCMAKE_MODULE_PATH:PATH=/tmp/pip-build-env-z73uw8oc/overlay/lib/python3.11/site-packages/skbuild/resources/cmake -DPYTHON_EXECUTABLE:PATH=$PROJECT_DIR/venv/bin/python3 -DPYTHON_INCLUDE_DIR:PATH=/usr/include/python3.11 -DPYTHON_LIBRARY:PATH=/usr/lib/x86_64-linux-gnu/libpython3.11.so -DPython_EXECUTABLE:PATH=$PROJECT_DIR/venv/bin/python3 -DPython_ROOT_DIR:PATH=$PROJECT_DIR/venv -DPython_FIND_REGISTRY:STRING=NEVER -DPython_INCLUDE_DIR:PATH=/usr/include/python3.11 -DPython3_EXECUTABLE:PATH=$PROJECT_DIR/venv/bin/python3 -DPython3_ROOT_DIR:PATH=$PROJECT_DIR/venv -DPython3_FIND_REGISTRY:STRING=NEVER -DPython3_INCLUDE_DIR:PATH=/usr/include/python3.11 -DCMAKE_MAKE_PROGRAM:FILEPATH=/tmp/pip-build-env-z73uw8oc/overlay/lib/python3.11/site-packages/ninja/data/bin/ninja -DCMAKE_BUILD_TYPE:STRING=Release
      
      Not searching for unused variables given on the command line.
      -- Building python $PROJECT_NAME module with lib$PROJECT_NAME linked in
      CMake Error at /tmp/pip-build-env-z73uw8oc/overlay/lib/python3.11/site-packages/skbuild/resources/cmake/FindCython.cmake:71 (message):
        Command "/tmp/pip-build-env-hg48c_t3/overlay/bin/cython;--version" failed
        with output:
      
      Call Stack (most recent call first):
        CMakeLists.txt:19 (find_package)
      
      _modinit_prefix:PyInit_
      -- Configuring incomplete, errors occurred!
      Traceback (most recent call last):
        File "/tmp/pip-build-env-z73uw8oc/overlay/lib/python3.11/site-packages/skbuild/setuptools_wrap.py", line 666, in setup
          env = cmkr.configure(
                ^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-z73uw8oc/overlay/lib/python3.11/site-packages/skbuild/cmaker.py", line 357, in configure
          raise SKBuildError(msg)
      
      An error occurred while configuring with CMake.
        Command:
          /tmp/pip-build-env-z73uw8oc/overlay/lib/python3.11/site-packages/cmake/data/bin/cmake $PROJECT_DIR -G Ninja -DCMAKE_MAKE_PROGRAM:FILEPATH=/tmp/pip-build-env-z73uw8oc/overlay/lib/python3.11/site-packages/ninja/data/bin/ninja --no-warn-unused-cli -DCMAKE_INSTALL_PREFIX:PATH=$PROJECT_DIR/_skbuild/linux-x86_64-3.11/cmake-install -DPYTHON_VERSION_STRING:STRING=3.11.2 -DSKBUILD:INTERNAL=TRUE -DCMAKE_MODULE_PATH:PATH=/tmp/pip-build-env-z73uw8oc/overlay/lib/python3.11/site-packages/skbuild/resources/cmake -DPYTHON_EXECUTABLE:PATH=$PROJECT_DIR/venv/bin/python3 -DPYTHON_INCLUDE_DIR:PATH=/usr/include/python3.11 -DPYTHON_LIBRARY:PATH=/usr/lib/x86_64-linux-gnu/libpython3.11.so -DPython_EXECUTABLE:PATH=$PROJECT_DIR/venv/bin/python3 -DPython_ROOT_DIR:PATH=$PROJECT_DIR/venv -DPython_FIND_REGISTRY:STRING=NEVER -DPython_INCLUDE_DIR:PATH=/usr/include/python3.11 -DPython3_EXECUTABLE:PATH=$PROJECT_DIR/venv/bin/python3 -DPython3_ROOT_DIR:PATH=$PROJECT_DIR/venv -DPython3_FIND_REGISTRY:STRING=NEVER -DPython3_INCLUDE_DIR:PATH=/usr/include/python3.11 -DCMAKE_MAKE_PROGRAM:FILEPATH=/tmp/pip-build-env-z73uw8oc/overlay/lib/python3.11/site-packages/ninja/data/bin/ninja -DCMAKE_BUILD_TYPE:STRING=Release
        Source directory:
          $PROJECT_DIR
        Working directory:
          $PROJECT_DIR/_skbuild/linux-x86_64-3.11/cmake-build
      Please see CMake's output for more information.
      
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for $PROJECT_NAME
Failed to build $PROJECT_NAME

For sake of completeness:
PROJECT_DIR=/home/nic30/Documents/workspace/hdlConvertor
PROJECT_NAME=hdlConvertor
PROJECT_URL=https://github.com/nic30/hdlConvertor

@henryiii
Copy link
Contributor

This is a bug:

https://github.com/Nic30/hdlConvertor/blob/56b2da68d494f8cec3e22d74e219415c151259f9/CMakeLists.txt#L18

You can't "require" the PythonLibs, in some places (like manylinux) the libs are not present and that's okay, you don't need them to build. I'd just remove that line, since PythonExtensions does this for you.

whereis cython

Your system version of Cython has nothing to do with the isolated environment Pip or Build builds in, by the way. It's installed from [build-system] requires = [...].

@Nic30
Copy link
Author

Nic30 commented Jun 9, 2023

You can't "require" the PythonLibs

Thanks.

@Nic30 Nic30 closed this as completed Jun 9, 2023
henryiii added a commit to henryiii/hdlConvertor that referenced this issue Jun 9, 2023
This is already included in PythonExtensions & is not valid with "REQUIRED". See scikit-build/scikit-build#989
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants