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

error upgrading to 0.0.25 in windows 10 #214

Open
qodesign opened this issue Jan 30, 2025 · 5 comments
Open

error upgrading to 0.0.25 in windows 10 #214

qodesign opened this issue Jan 30, 2025 · 5 comments

Comments

@qodesign
Copy link

I tried to upgrade to 0.0.25 and got this error :

Building wheels for collected packages: qldpc
Building wheel for qldpc (pyproject.toml) ... error
error: subprocess-exited-with-error

× Building wheel for qldpc (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [69 lines of output]
Compiling qldpc\codes_distance.pyx because it changed.
[1/1] Cythonizing qldpc\codes_distance.pyx
cl : Command line warning D9002 : ignoring unknown option '-O3'
cl : Command line warning D9002 : ignoring unknown option '-march=native'
_distance.c
C:\Conda\envs\qldpc-env\include\pyconfig.h(59): fatal error C1083: Cannot open include file: 'io.h': No such file or directory
...
subprocess.CalledProcessError: Command '['C:/Conda/envs/qldpc-env/python.exe', 'build-cython.py']' returned non-zero exit status 1.
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for qldpc
Failed to build qldpc
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (qldpc)

I'm running on windows 10. Mingwin is my primary compiler and -O3 is a valid directive for it but maybe cython doesn't pick that up
(I get the same error if VisualC is in the path)

@perlinm
Copy link
Collaborator

perlinm commented Jan 31, 2025

Interesting. The error log says that -O3 is not recognized, so maybe pip/setuptools is trying to use a different compiler.

We have two lines of attack:

  1. Installing a compiler + libraries that pip/setuptools will automatically recognize.
  2. Trying to tell pip to use mingwin if it is available.

Trying (1) first: can you try installing Microsoft Visual C++ 14.x with Visual Studio 2022 ( and see if doing so makes pip install qldpc==0.0.25 work?

Incidentally, the link above does tell me that I should try to use setuptools rather than distutils, and I do use distutils in build-cython.py. So let me also look into that and see if it changes anything.

@perlinm
Copy link
Collaborator

perlinm commented Jan 31, 2025

I switched to setuptools instead of distutils on the main branch of the repo (now also deployed in v0.0.26), though I doubt that will fix this issue.

@qodesign
Copy link
Author

I installed Microsoft Visual and got the same error. I then tried to "tell pip" where the c compiler is at.
According to Gemini this is how to do it :

set CC=C:\path\to\gcc.exe
pip install <package_name>

or

On Windows, if you are using Visual Studio, the easiest way is usually to open a "Developer Command Prompt for VS"

They both failed the same way.

I think you might have hard coded "CC" to "cl" so none of the options know what to do with "cl"...
but I'm not sure.

If there's no fix for this, maybe you can make the cython part optional so that other parts of the package can be upgraded and used...I think you use cython to speed up the distance calculations which is not that critical compared to other functions

@perlinm
Copy link
Collaborator

perlinm commented Feb 1, 2025

I presume you didn't literally type set CC=C:\path\to\gcc.exe, but put in the actual path to the gcc compiler? Also, did you follow the instructions here?

I'm willing to skip the fast distance calculations for Windows if necessary, but I want to try a bit more to see if we can get this working. If we can, I'll add documentation to the readme.

@qodesign
Copy link
Author

qodesign commented Feb 1, 2025

yes of course I didn't type that...(you're forgiven for saying that).
I think I tried everything at this point

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