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

Fails to build on Windows 10 (Using VS compiler) #2

Closed
AlexNayl opened this issue Feb 12, 2022 · 6 comments
Closed

Fails to build on Windows 10 (Using VS compiler) #2

AlexNayl opened this issue Feb 12, 2022 · 6 comments

Comments

@AlexNayl
Copy link

I was installing MadCad via pip on PowerShell, when this dependency generated a build error.

arrex/dtypes.c(5259): error C2036: 'void *': unknown size

It appears that is issue is that you're doing arithmetic on a void type pointer, this isn't allowed by the c standard due to the fact that void types have no known size. Although gcc allows this, which is why this was likely not detected before.

@AlexNayl
Copy link
Author

AlexNayl commented Feb 12, 2022

Heres the full log if its any help

PS C:\Users\Alex> pip3 install arrex
Collecting arrex
  Using cached arrex-0.3.1.tar.gz (191 kB)
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: arrex
  Building wheel for arrex (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [27 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build\lib.win-amd64-3.8
      creating build\lib.win-amd64-3.8\arrex
      copying arrex\glm.py -> build\lib.win-amd64-3.8\arrex
      copying arrex\numbers_struct.py -> build\lib.win-amd64-3.8\arrex
      copying arrex\numpy.py -> build\lib.win-amd64-3.8\arrex
      copying arrex\proto_dtype.py -> build\lib.win-amd64-3.8\arrex
      copying arrex\__init__.py -> build\lib.win-amd64-3.8\arrex
      copying arrex\dtypes.c -> build\lib.win-amd64-3.8\arrex
      copying arrex\list.c -> build\lib.win-amd64-3.8\arrex
      copying arrex\numbers.c -> build\lib.win-amd64-3.8\arrex
      copying arrex\dtypes.pyx -> build\lib.win-amd64-3.8\arrex
      copying arrex\list.pyx -> build\lib.win-amd64-3.8\arrex
      copying arrex\numbers.pyx -> build\lib.win-amd64-3.8\arrex
      copying arrex\dtypes.pxd -> build\lib.win-amd64-3.8\arrex
      running build_ext
      building 'arrex.dtypes' extension
      creating build\temp.win-amd64-3.8
      creating build\temp.win-amd64-3.8\Release
      creating build\temp.win-amd64-3.8\Release\arrex
      F:\Program Files\VisualStudioCommunity\IDE\VC\Tools\MSVC\14.30.30705\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:\users\alex\appdata\local\programs\python\python38\include -Ic:\users\alex\appdata\local\programs\python\python38\include "-IF:\Program Files\VisualStudioCommunity\IDE\VC\Tools\MSVC\14.30.30705\ATLMFC\include" "-IF:\Program Files\VisualStudioCommunity\IDE\VC\Tools\MSVC\14.30.30705\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" "-IF:\Windows Kits\10\include\10.0.19041.0\ucrt" "-IF:\Windows Kits\10\\include\10.0.19041.0\\shared" "-IF:\Windows Kits\10\\include\10.0.19041.0\\um" "-IF:\Windows Kits\10\\include\10.0.19041.0\\winrt" "-IF:\Windows Kits\10\\include\10.0.19041.0\\cppwinrt" /Tcarrex/dtypes.c /Fobuild\temp.win-amd64-3.8\Release\arrex/dtypes.obj
      dtypes.c
      arrex/dtypes.c(5259): error C2036: 'void *': unknown size
      error: command 'F:\\Program Files\\VisualStudioCommunity\\IDE\\VC\\Tools\\MSVC\\14.30.30705\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for arrex
  Running setup.py clean for arrex
Failed to build arrex
Installing collected packages: arrex
  Running setup.py install for arrex ... error
  error: subprocess-exited-with-error

  × Running setup.py install for arrex did not run successfully.
  │ exit code: 1
  ╰─> [27 lines of output]
      running install
      running build
      running build_py
      creating build
      creating build\lib.win-amd64-3.8
      creating build\lib.win-amd64-3.8\arrex
      copying arrex\glm.py -> build\lib.win-amd64-3.8\arrex
      copying arrex\numbers_struct.py -> build\lib.win-amd64-3.8\arrex
      copying arrex\numpy.py -> build\lib.win-amd64-3.8\arrex
      copying arrex\proto_dtype.py -> build\lib.win-amd64-3.8\arrex
      copying arrex\__init__.py -> build\lib.win-amd64-3.8\arrex
      copying arrex\dtypes.c -> build\lib.win-amd64-3.8\arrex
      copying arrex\list.c -> build\lib.win-amd64-3.8\arrex
      copying arrex\numbers.c -> build\lib.win-amd64-3.8\arrex
      copying arrex\dtypes.pyx -> build\lib.win-amd64-3.8\arrex
      copying arrex\numbers.pyx -> build\lib.win-amd64-3.8\arrex
      copying arrex\dtypes.pxd -> build\lib.win-amd64-3.8\arrex
      running build_ext
      building 'arrex.dtypes' extension
      creating build\temp.win-amd64-3.8
      creating build\temp.win-amd64-3.8\Release
      creating build\temp.win-amd64-3.8\Release\arrex
      F:\Program Files\VisualStudioCommunity\IDE\VC\Tools\MSVC\14.30.30705\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:\users\alex\appdata\local\programs\python\python38\include -Ic:\users\alex\appdata\local\programs\python\python38\include "-IF:\Program Files\VisualStudioCommunity\IDE\VC\Tools\MSVC\14.30.30705\ATLMFC\include" "-IF:\Program Files\VisualStudioCommunity\IDE\VC\Tools\MSVC\14.30.30705\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" "-IF:\Windows Kits\10\include\10.0.19041.0\ucrt" "-IF:\Windows Kits\10\\include\10.0.19041.0\\shared" "-IF:\Windows Kits\10\\include\10.0.19041.0\\um" "-IF:\Windows Kits\10\\include\10.0.19041.0\\winrt" "-IF:\Windows Kits\10\\include\10.0.19041.0\\cppwinrt" /Tcarrex/dtypes.c /Fobuild\temp.win-amd64-3.8\Release\arrex/dtypes.obj
      dtypes.c
      arrex/dtypes.c(5259): error C2036: 'void *': unknown size
      error: command 'F:\\Program Files\\VisualStudioCommunity\\IDE\\VC\\Tools\\MSVC\\14.30.30705\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> arrex

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

jimy-byerley added a commit that referenced this issue Feb 13, 2022
…typedlist from void* (pointer of nothing) to char* (point of bytes), so the compiler allows pointer aritmetics
@jimy-byerley
Copy link
Owner

jimy-byerley commented Feb 13, 2022

Damn you are right ! I changed too many things working only on linux that I missed that point with the VS compiler
That should be fixed by now (it compiles and works fine on my side on win10), can you try on your side ? then I will publish an update.

Just for this test you will need to pip install cython in order to recompile from the cython code

@AlexNayl
Copy link
Author

I built directly from the repo to test your fix via the following command.
pip install git+https://github.com/jimy-byerley/arrex
It now builds fine on Windows 10 via PowerShell, so I think this is resolved.

Thanks for the quick response!

@jimy-byerley
Copy link
Owner

Good news ! Thanks for reporting and testing !

@ZiguoAtGitHub
Copy link

ZiguoAtGitHub commented Feb 5, 2024

Hi @jimy-byerley , I met the same problem when I installed pymadcad.
I had tried installing cython with pip install cython and succeeded, but the arrex still could not be installed successfully with pip install arerx. Here are the errors:

PS D:\BaiduNetdiskWorkspace\TestVenv> pip install arrex
Collecting arrex
Using cached arrex-0.5.2.tar.gz (280 kB)
Preparing metadata (setup.py) ... done
Installing collected packages: arrex
DEPRECATION: arrex is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at pypa/pip#8559
Running setup.py install for arrex ... error
error: subprocess-exited-with-error

× Running setup.py install for arrex did not run successfully.
│ exit code: 1
╰─> [24 lines of output]
running install
D:\BaiduNetdiskWorkspace\TestVenv\venv\Lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running build
running build_py
creating build
creating build\lib.win-amd64-cpython-311
copying arrex\glm.py -> build\lib.win-amd64-cpython-311\arrex
copying arrex\numbers_struct.py -> build\lib.win-amd64-cpython-311\arrex
copying arrex\numpy.py -> build\lib.win-amd64-cpython-311\arrex
copying arrex\proto_dtype.py -> build\lib.win-amd64-cpython-311\arrex
copying arrex_init_.py -> build\lib.win-amd64-cpython-311\arrex
copying arrex\dtypes.c -> build\lib.win-amd64-cpython-311\arrex
copying arrex\list.c -> build\lib.win-amd64-cpython-311\arrex
copying arrex\numbers.c -> build\lib.win-amd64-cpython-311\arrex
copying arrex\array.pyx -> build\lib.win-amd64-cpython-311\arrex
copying arrex\dtypes.pyx -> build\lib.win-amd64-cpython-311\arrex
copying arrex\list.pyx -> build\lib.win-amd64-cpython-311\arrex
copying arrex\numbers.pyx -> build\lib.win-amd64-cpython-311\arrex
copying arrex\dtypes.pxd -> build\lib.win-amd64-cpython-311\arrex
running build_ext
building 'arrex.dtypes' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

╰─> arrex

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

Then I tried with pip install git+https://github.com/jimy-byerley/arrex, here is the errors:

PS D:\BaiduNetdiskWorkspace\TestVenv> pip install git+https://github.com/jimy-byerley/arrex
Collecting git+https://github.com/jimy-byerley/arrex
Cloning https://github.com/jimy-byerley/arrex to c:\users\xuzig\appdata\local\temp\pip-req-build-9f48a3r9
Running command git clone --filter=blob:none --quiet https://github.com/jimy-byerley/arrex 'C:\Users\xuzig\AppData\Local\Temp\pip-req-build-9f48a3r9'
fatal: unable to access 'https://github.com/jimy-byerley/arrex/': Failed to connect to github.com port 443 after 21273 ms: Couldn't connect to server
error: subprocess-exited-with-error

× git clone --filter=blob:none --quiet https://github.com/jimy-byerley/arrex 'C:\Users\xuzig\AppData\Local\Temp\pip-req-build-9f48a3r9' did not run successfully.
│ exit code: 128
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× git clone --filter=blob:none --quiet https://github.com/jimy-byerley/arrex 'C:\Users\xuzig\AppData\Local\Temp\pip-req-build-9f48a3r9' did not run successfully.
│ exit code: 128
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

Could you help me with this? Thanks.

@jimy-byerley
Copy link
Owner

This is not the same issue.
As you can see, pip shows you the following error message

error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
[end of output]

When you compile arrex with cython, you need to install a C/C++ compiler as well. Here, python is complaining being not able to find the compiler, so I guess you haven't installed one. Please follow the link the message is providing.

For the second error

Running command git clone --filter=blob:none --quiet https://github.com/jimy-byerley/arrex 'C:\Users\xuzig\AppData\Local\Temp\pip-req-build-9f48a3r9'
fatal: unable to access 'https://github.com/jimy-byerley/arrex/': Failed to connect to github.com port 443 after 21273 ms: Couldn't connect to server

You can see that git is not able to access the only repo, this might be because your internet connection is broken or because of your proxy or lan config ... not an issue with arrex

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

3 participants