adamstark/Gist

there are some errors as running "python setup.py build" on Mac Os

jenweilee opened this issue · 3 comments

the following is the log

1 running build
2 running config_cc
3 unifing config_cc, config, build_clib, build_ext, build commands --compiler options
4 running config_fc
5 unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
6 running build_src
7 build_src
8 building extension "gist" sources
9 build_src: building npy-pkg config files
10 running build_ext
11 customize UnixCCompiler
12 customize UnixCCompiler using build_ext
13 customize UnixCCompiler
14 customize UnixCCompiler using build_ext
15 building 'gist' extension
16 compiling C++ sources
17 C compiler: g++ -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -I/Users/jenweilee/anaconda3/include -arch x86_ 64 -I/Users/jenweilee/anaconda3/include -arch x86_64
18
19 compile options: '-DUSE_FFTW -I/Users/jenweilee/anaconda3/lib/python3.6/site-packages/numpy/core/include -I/Users/jenweilee/anaconda3/lib/python3. 6/site-packages/numpy/core/include -I/usr/local/include -I/Users/jenweilee/anaconda3/include/python3.6m -c'
20 g++: GistPythonModule.cpp
21 In file included from GistPythonModule.cpp:4:
22 In file included from /Users/jenweilee/anaconda3/lib/python3.6/site-packages/numpy/core/include/numpy/arrayobject.h:4:
23 In file included from /Users/jenweilee/anaconda3/lib/python3.6/site-packages/numpy/core/include/numpy/ndarrayobject.h:18:
24 In file included from /Users/jenweilee/anaconda3/lib/python3.6/site-packages/numpy/core/include/numpy/ndarraytypes.h:1818:
25 /Users/jenweilee/anaconda3/lib/python3.6/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: "Using deprecated NumPy AP I, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-W#warnings]
26 #warning "Using deprecated NumPy API, disable it by "
27 ^
28 GistPythonModule.cpp:44:12: error: use of undeclared identifier 'PyInt_FromLong'; did you mean 'PyLong_FromLong'?
29 return PyInt_FromLong((long) gist.getAudioFrameSize());
30 ^~~~~~~~~~~~~~
31 PyLong_FromLong
32 /Users/jenweilee/anaconda3/include/python3.6m/longobject.h:18:24: note: 'PyLong_FromLong' declared here
33 PyAPI_FUNC(PyObject *) PyLong_FromLong(long);
34 ^
35 GistPythonModule.cpp:50:12: error: use of undeclared identifier 'PyInt_FromLong'; did you mean 'PyLong_FromLong'?
36 return PyInt_FromLong((long) gist.getSamplingFrequency());
37 ^~~~~~~~~~~~~~
38 PyLong_FromLong
39 /Users/jenweilee/anaconda3/include/python3.6m/longobject.h:18:24: note: 'PyLong_FromLong' declared here
40 PyAPI_FUNC(PyObject *) PyLong_FromLong(long);
41 ^
42 GistPythonModule.cpp:309:11: error: use of undeclared identifier 'Py_InitModule'
43 (void)Py_InitModule("gist", gist_methods);
44 ^
45 GistPythonModule.cpp:317:5: error: no matching function for call to 'Py_SetProgramName'
46 Py_SetProgramName(argv[0]);
47 ^~~~~~~~~~~~~~~~~
48 /Users/jenweilee/anaconda3/include/python3.6m/pylifecycle.h:10:18: note: candidate function not viable: no known conversion from 'char *' to 'wcha r_t *' for 1st argument
49 PyAPI_FUNC(void) Py_SetProgramName(wchar_t *);
50 ^
51 1 warning and 4 errors generated.
52 In file included from GistPythonModule.cpp:4:
53 In file included from /Users/jenweilee/anaconda3/lib/python3.6/site-packages/numpy/core/include/numpy/arrayobject.h:4:
54 In file included from /Users/jenweilee/anaconda3/lib/python3.6/site-packages/numpy/core/include/numpy/ndarrayobject.h:18:
55 In file included from /Users/jenweilee/anaconda3/lib/python3.6/site-packages/numpy/core/include/numpy/ndarraytypes.h:1818:
56 /Users/jenweilee/anaconda3/lib/python3.6/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: "Using deprecated NumPy AP I, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-W#warnings]
57 #warning "Using deprecated NumPy API, disable it by "
58 ^
59 GistPythonModule.cpp:44:12: error: use of undeclared identifier 'PyInt_FromLong'; did you mean 'PyLong_FromLong'?
60 return PyInt_FromLong((long) gist.getAudioFrameSize());
61 ^~~~~~~~~~~~~~
62 PyLong_FromLong
63 /Users/jenweilee/anaconda3/include/python3.6m/longobject.h:18:24: note: 'PyLong_FromLong' declared here
64 PyAPI_FUNC(PyObject *) PyLong_FromLong(long);
65 ^
66 GistPythonModule.cpp:50:12: error: use of undeclared identifier 'PyInt_FromLong'; did you mean 'PyLong_FromLong'?
67 return PyInt_FromLong((long) gist.getSamplingFrequency());
68 ^~~~~~~~~~~~~~
69 PyLong_FromLong
70 /Users/jenweilee/anaconda3/include/python3.6m/longobject.h:18:24: note: 'PyLong_FromLong' declared here
71 PyAPI_FUNC(PyObject *) PyLong_FromLong(long);
72 ^
73 GistPythonModule.cpp:309:11: error: use of undeclared identifier 'Py_InitModule'
74 (void)Py_InitModule("gist", gist_methods);
75 ^
76 GistPythonModule.cpp:317:5: error: no matching function for call to 'Py_SetProgramName'
77 Py_SetProgramName(argv[0]);
78 ^~~~~~~~~~~~~~~~~
79 /Users/jenweilee/anaconda3/include/python3.6m/pylifecycle.h:10:18: note: candidate function not viable: no known conversion from 'char *' to 'wcha r_t *' for 1st argument
80 PyAPI_FUNC(void) Py_SetProgramName(wchar_t *);
81 ^
82 1 warning and 4 errors generated.

Hi there, I think this is because you are using Python 3, while this was developed for Python 2.7. Can you run...

python --version

and see what output it gives? Also which version of macOS are you using?

You could also try this in the short term...

python2.7 setup.py build

very appreciate
it is a pity that it does not support python3 version.