davidcortesortuno / oommfpy

Python library to analyse OOMMF and MuMax3 data files
BSD 2-Clause "Simplified" License
12 stars 7 forks source link

Error compiling oommfpy on windows 10   #3

Closed Falconcp closed 3 years ago

Falconcp commented 4 years ago

Hi,

I could not compile oommfpy in windows 10.

I have python 3.7 installed and I have created a python 3.6 environment for installation, cmd throws:

ERROR: Command errored out with exit status 1: command: 'C:\Users\Falcon\Anaconda3\envs\vtk\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Falcon\AppData\Local\Temp\pip-req-build-5tsjfwzl\setup.py'"'"'; file='"'"'C:\Users\Falcon\AppData\Local\Temp\pip-req-build-5tsjfwzl\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\Falcon\AppData\Local\Temp\pip-wheel-9iyg3owv' --python-tag cp36 cwd: C:\Users\Falcon\AppData\Local\Temp\pip-req-build-5tsjfwzl\ Complete output (24 lines): running bdist_wheel running build running build_py creating build creating build\lib.win-amd64-3.6 creating build\lib.win-amd64-3.6\oommfpy copying oommfpy\oommfpy.py -> build\lib.win-amd64-3.6\oommfpy copying oommfpy__init__.py -> build\lib.win-amd64-3.6\oommfpy creating build\lib.win-amd64-3.6\oommfpy\tools copying oommfpy\tools\omf2vtk.py -> build\lib.win-amd64-3.6\oommfpy\tools copying oommfpy\tools\plot_omf.py -> build\lib.win-amd64-3.6\oommfpy\tools copying oommfpy\tools\plot_slices.py -> build\lib.win-amd64-3.6\oommfpy\tools copying oommfpy\tools\plot_tools.py -> build\lib.win-amd64-3.6\oommfpy\tools copying oommfpy\tools__init__.py -> build\lib.win-amd64-3.6\oommfpy\tools running build_ext building 'oommfpy.tools.clib' extension creating build\temp.win-amd64-3.6 creating build\temp.win-amd64-3.6\Release creating build\temp.win-amd64-3.6\Release\oommfpy creating build\temp.win-amd64-3.6\Release\oommfpy\tools creating build\temp.win-amd64-3.6\Release\oommfpy\tools\clib C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MT -Ioommfpy/tools/clib -IC:\Users\Falcon\Anaconda3\envs\vtk\include -IC:\Users\Falcon\Anaconda3\envs\vtk\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" /Tcoommfpy/tools/clib/clib.c /Fobuild\temp.win-amd64-3.6\Release\oommfpy/tools/clib/clib.obj -std=c99 -O3 -Wno-cpp -Wno-unused-function cl : Command line error D8021 : invalid numeric argument '/Wno-cpp' error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\bin\HostX86\x64\cl.exe' failed with exit status 2

ERROR: Failed building wheel for oommfpy Running setup.py clean for oommfpy Failed to build oommfpy Installing collected packages: oommfpy Running setup.py install for oommfpy ... error ERROR: Command errored out with exit status 1: command: 'C:\Users\Falcon\Anaconda3\envs\vtk\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Falcon\AppData\Local\Temp\pip-req-build-5tsjfwzl\setup.py'"'"'; file='"'"'C:\Users\Falcon\AppData\Local\Temp\pip-req-build-5tsjfwzl\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record 'C:\Users\Falcon\AppData\Local\Temp\pip-record-xfamzg0z\install-record.txt' --single-version-externally-managed --compile cwd: C:\Users\Falcon\AppData\Local\Temp\pip-req-build-5tsjfwzl\ Complete output (24 lines): running install running build running build_py creating build creating build\lib.win-amd64-3.6 creating build\lib.win-amd64-3.6\oommfpy copying oommfpy\oommfpy.py -> build\lib.win-amd64-3.6\oommfpy copying oommfpy__init__.py -> build\lib.win-amd64-3.6\oommfpy creating build\lib.win-amd64-3.6\oommfpy\tools copying oommfpy\tools\omf2vtk.py -> build\lib.win-amd64-3.6\oommfpy\tools copying oommfpy\tools\plot_omf.py -> build\lib.win-amd64-3.6\oommfpy\tools copying oommfpy\tools\plot_slices.py -> build\lib.win-amd64-3.6\oommfpy\tools copying oommfpy\tools\plot_tools.py -> build\lib.win-amd64-3.6\oommfpy\tools copying oommfpy\tools__init__.py -> build\lib.win-amd64-3.6\oommfpy\tools running build_ext building 'oommfpy.tools.clib' extension creating build\temp.win-amd64-3.6 creating build\temp.win-amd64-3.6\Release creating build\temp.win-amd64-3.6\Release\oommfpy creating build\temp.win-amd64-3.6\Release\oommfpy\tools creating build\temp.win-amd64-3.6\Release\oommfpy\tools\clib C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MT -Ioommfpy/tools/clib -IC:\Users\Falcon\Anaconda3\envs\vtk\include -IC:\Users\Falcon\Anaconda3\envs\vtk\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" /Tcoommfpy/tools/clib/clib.c /Fobuild\temp.win-amd64-3.6\Release\oommfpy/tools/clib/clib.obj -std=c99 -O3 -Wno-cpp -Wno-unused-function cl : Command line error D8021 : invalid numeric argument '/Wno-cpp' error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\bin\HostX86\x64\cl.exe' failed with exit status 2

ERROR: Command errored out with exit status 1: 'C:\Users\Falcon\Anaconda3\envs\vtk\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Falcon\AppData\Local\Temp\pip-req-build-5tsjfwzl\setup.py'"'"'; file='"'"'C:\Users\Falcon\AppData\Local\Temp\pip-req-build-5tsjfwzl\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record 'C:\Users\Falcon\AppData\Local\Temp\pip-record-xfamzg0z\install-record.txt' --single-version-externally-managed --compile Check the logs for full command output.

thanks

Falconcp commented 4 years ago

i have change the extra_compile_args in setup.py by {'gcc': ['/Qstd=c99']} and the code work

davidcortesortuno commented 4 years ago

Interesting, I haven't built this library on Windows. I'll check and see what's the main issue, but it's nice it works for now with the solution you posted.

davidcortesortuno commented 4 years ago

I removed some of the compilation flags in the setup.py function, so you can try installing it.