pmneila/PyMCubes

Build Error

Robdei opened this issue · 1 comments

Hello, I'm trying to install PyMCubes through pip, and I get the following output:

C:\Users\Administrator>pip install PyMCubes
Collecting PyMCubes
  Using cached PyMCubes-0.0.6.tar.gz
Building wheels for collected packages: PyMCubes
  Running setup.py bdist_wheel for PyMCubes ... error
  Complete output from command C:\ProgramData\Anaconda3\python.exe -u -c "import
 setuptools, tokenize;__file__='C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\pip-b
uild-de4_f7_s\\PyMCubes\\setup.py';f=getattr(tokenize, 'open', open)(__file__);c
ode=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'
))" bdist_wheel -d C:\Users\ADMINI~1\AppData\Local\Temp\tmp93c1esmzpip-wheel- --
python-tag cp36:
  Warning: Extension name 'mcubes._mcubes' does not match fully qualified name '
_mcubes' of 'mcubes/src/_mcubes.pyx'
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-3.6
  creating build\lib.win-amd64-3.6\mcubes
  copying mcubes\exporter.py -> build\lib.win-amd64-3.6\mcubes
  copying mcubes\__init__.py -> build\lib.win-amd64-3.6\mcubes
  running build_ext
  building 'mcubes._mcubes' extension
  creating build\temp.win-amd64-3.6
  creating build\temp.win-amd64-3.6\Release
  creating build\temp.win-amd64-3.6\Release\mcubes
  creating build\temp.win-amd64-3.6\Release\mcubes\src
  C:\ProgramData\Anaconda3\Library\mingw-w64\bin\gcc.exe -mdll -O -Wall -DMS_WIN
64 -Imcubes/src -IC:\ProgramData\Anaconda3\lib\site-packages\numpy\core\include
-IC:\ProgramData\Anaconda3\include -IC:\ProgramData\Anaconda3\include -c mcubes/
src/_mcubes.cpp -o build\temp.win-amd64-3.6\Release\mcubes\src\_mcubes.o -std=c+
+11
  In file included from C:\ProgramData\Anaconda3\lib\site-packages\numpy\core\in
clude/numpy/ndarraytypes.h:1809:0,
                   from C:\ProgramData\Anaconda3\lib\site-packages\numpy\core\in
clude/numpy/ndarrayobject.h:18,
                   from C:\ProgramData\Anaconda3\lib\site-packages\numpy\core\in
clude/numpy/arrayobject.h:4,
                   from mcubes/src/_mcubes.cpp:518:
  C:\ProgramData\Anaconda3\lib\site-packages\numpy\core\include/numpy/npy_1_7_de
precated_api.h:13:79: note: #pragma message: C:\ProgramData\Anaconda3\lib\site-p
ackages\numpy\core\include/numpy/npy_1_7_deprecated_api.h(12) : Warning Msg: Usi
ng deprecated NumPy API, disable it by #defining NPY_NO_DEPRECATED_API NPY_1_7_A
PI_VERSION
                            "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
")

 ^
  In file included from C:/ProgramData/Anaconda3/Library/mingw-w64/include/c++/5
.3.0/complex:44:0,
                   from mcubes/src/pyarraymodule.h:13,
                   from mcubes/src/pywrapper.h:6,
                   from mcubes/src/_mcubes.cpp:520:
  C:/ProgramData/Anaconda3/Library/mingw-w64/include/c++/5.3.0/cmath:1119:11: er
ror: '::hypot' has not been declared
     using ::hypot;
             ^
  mcubes/src/_mcubes.cpp: In function 'PyTypeObject* __Pyx_ImportType(const char
*, const char*, size_t, int)':
  mcubes/src/_mcubes.cpp:6737:53: warning: unknown conversion type character 'z'
 in format [-Wformat=]
               module_name, class_name, basicsize, size);
                                                       ^
  mcubes/src/_mcubes.cpp:6737:53: warning: unknown conversion type character 'z'
 in format [-Wformat=]
  mcubes/src/_mcubes.cpp:6737:53: warning: too many arguments for format [-Wform
at-extra-args]
  error: command 'C:\\ProgramData\\Anaconda3\\Library\\mingw-w64\\bin\\gcc.exe'
failed with exit status 1

  ----------------------------------------
  Failed building wheel for PyMCubes
  Running setup.py clean for PyMCubes
Failed to build PyMCubes
Installing collected packages: PyMCubes
  Running setup.py install for PyMCubes ... error
    Complete output from command C:\ProgramData\Anaconda3\python.exe -u -c "impo
rt setuptools, tokenize;__file__='C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\pip
-build-de4_f7_s\\PyMCubes\\setup.py';f=getattr(tokenize, 'open', open)(__file__)
;code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exe
c'))" install --record C:\Users\ADMINI~1\AppData\Local\Temp\pip-r6wqmcgl-record\
install-record.txt --single-version-externally-managed --compile:
    Warning: Extension name 'mcubes._mcubes' does not match fully qualified name
 '_mcubes' of 'mcubes/src/_mcubes.pyx'
    running install
    running build
    running build_py
    creating build
    creating build\lib.win-amd64-3.6
    creating build\lib.win-amd64-3.6\mcubes
    copying mcubes\exporter.py -> build\lib.win-amd64-3.6\mcubes
    copying mcubes\__init__.py -> build\lib.win-amd64-3.6\mcubes
    running build_ext
    building 'mcubes._mcubes' extension
    creating build\temp.win-amd64-3.6
    creating build\temp.win-amd64-3.6\Release
    creating build\temp.win-amd64-3.6\Release\mcubes
    creating build\temp.win-amd64-3.6\Release\mcubes\src
    C:\ProgramData\Anaconda3\Library\mingw-w64\bin\gcc.exe -mdll -O -Wall -DMS_W
IN64 -Imcubes/src -IC:\ProgramData\Anaconda3\lib\site-packages\numpy\core\includ
e -IC:\ProgramData\Anaconda3\include -IC:\ProgramData\Anaconda3\include -c mcube
s/src/_mcubes.cpp -o build\temp.win-amd64-3.6\Release\mcubes\src\_mcubes.o -std=
c++11
    In file included from C:\ProgramData\Anaconda3\lib\site-packages\numpy\core\
include/numpy/ndarraytypes.h:1809:0,
                     from C:\ProgramData\Anaconda3\lib\site-packages\numpy\core\
include/numpy/ndarrayobject.h:18,
                     from C:\ProgramData\Anaconda3\lib\site-packages\numpy\core\
include/numpy/arrayobject.h:4,
                     from mcubes/src/_mcubes.cpp:518:
    C:\ProgramData\Anaconda3\lib\site-packages\numpy\core\include/numpy/npy_1_7_
deprecated_api.h:13:79: note: #pragma message: C:\ProgramData\Anaconda3\lib\site
-packages\numpy\core\include/numpy/npy_1_7_deprecated_api.h(12) : Warning Msg: U
sing deprecated NumPy API, disable it by #defining NPY_NO_DEPRECATED_API NPY_1_7
_API_VERSION
                              "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSI
ON")

   ^
    In file included from C:/ProgramData/Anaconda3/Library/mingw-w64/include/c++
/5.3.0/complex:44:0,
                     from mcubes/src/pyarraymodule.h:13,
                     from mcubes/src/pywrapper.h:6,
                     from mcubes/src/_mcubes.cpp:520:
    C:/ProgramData/Anaconda3/Library/mingw-w64/include/c++/5.3.0/cmath:1119:11:
error: '::hypot' has not been declared
       using ::hypot;
               ^
    mcubes/src/_mcubes.cpp: In function 'PyTypeObject* __Pyx_ImportType(const ch
ar*, const char*, size_t, int)':
    mcubes/src/_mcubes.cpp:6737:53: warning: unknown conversion type character '
z' in format [-Wformat=]
                 module_name, class_name, basicsize, size);
                                                         ^
    mcubes/src/_mcubes.cpp:6737:53: warning: unknown conversion type character '
z' in format [-Wformat=]
    mcubes/src/_mcubes.cpp:6737:53: warning: too many arguments for format [-Wfo
rmat-extra-args]
    error: command 'C:\\ProgramData\\Anaconda3\\Library\\mingw-w64\\bin\\gcc.exe
' failed with exit status 1

    ----------------------------------------
Command "C:\ProgramData\Anaconda3\python.exe -u -c "import setuptools, tokenize;
__file__='C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\pip-build-de4_f7_s\\PyMCube
s\\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\ADMINI~1\AppData\Local\Temp\pip-r6wqmcgl-record\install-record.txt --sin
gle-version-externally-managed --compile" failed with error code 1 in C:\Users\A
DMINI~1\AppData\Local\Temp\pip-build-de4_f7_s\PyMCubes\

This looks like a Cython problem, but I've updated python, Cython, gcc, and numpy to the most recent versions. I get a similar error if I try to build using py setup.py build instead of pip.

Hi,

It's a problem with mingw-w64. See for example Theano/Theano#4926. Apparently there is a known solution. Unfortunately I'm on vacations now with limited internet and compiler access. I'll try to upload a fix in a few days. Sorry for the inconvenience.