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

Compilation error: cannot initialize a parameter of type 'int32_t *' #6

Closed
cveaux opened this issue Mar 12, 2018 · 14 comments · Fixed by #12
Closed

Compilation error: cannot initialize a parameter of type 'int32_t *' #6

cveaux opened this issue Mar 12, 2018 · 14 comments · Fixed by #12

Comments

@cveaux
Copy link

cveaux commented Mar 12, 2018

Hi, I've being trying to install pyreaper, first with pip install pyreaper and then by cloning the repository and doing:
git submodule update --init --recursive
python setup.py build (I also tried python setup.py develop)

however in each case I got this error:

pyreaper/creaper.cpp:4153:155: error: cannot initialize a parameter of type 'int32_t *' (aka 'int *') with an rvalue of type '__pyx_t_5numpy_int32_t *' (aka 'long *')

it was preceded by this warning (although I think it's independent from the error message).
warning: "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-W#warnings]

Have you encountered this error before ?

@cveaux
Copy link
Author

cveaux commented Mar 12, 2018

I forgot to say that my version of Cython is 0.27.3

@cveaux
Copy link
Author

cveaux commented Mar 12, 2018

and the corresponding code in creaper.pyx:

/* "pyreaper/creaper.pyx":184

  •     = np.zeros(pN, dtype=np.float32)
    
  • et.GetTrackTimes(pm_track.ptr, & pm_times[0])
    
  • et.GetTrackVoicedFlags(pm_track.ptr, & pm[0])             # <<<<<<<<<<<<<<
    

@r9y9
Copy link
Owner

r9y9 commented Mar 12, 2018

I haven't encountered it ever. What platform are you on? Windows perhaps?

@cveaux
Copy link
Author

cveaux commented Mar 12, 2018

No I'm on OSX 10.13.3

@r9y9
Copy link
Owner

r9y9 commented Mar 12, 2018

I'm on OSX 10.13.3 too. Could you provide me more detailed information? python version, conda/virtualenv, gcc (clang) version, etc.

@cveaux
Copy link
Author

cveaux commented Mar 12, 2018

I'm using Python 2.7.10 (in a virtual environment)

clang --version:
Apple LLVM version 9.0.0 (clang-900.0.39.2)
Target: x86_64-apple-darwin17.4.0

and this is the flags used for the compilation:

cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -I/opt/X11/include -arch i386 -arch x86_64 -pipe -I/Users/cveaux/Projects/Deepzen/work/venv/lib/python2.7/site-packages/numpy/core/include -I/Users/cveaux/Projects/Deepzen/work/repos-3rd/pyreaper/lib/REAPER -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c pyreaper/creaper.cpp -o build/temp.macosx-10.13-intel-2.7/pyreaper/creaper.o

@r9y9
Copy link
Owner

r9y9 commented Mar 12, 2018

Okay, I think -arch i386 does cause the compile error. I didn't pay attention to 32-bit architectures.. Can you try the following command?

ARCHFLAGS="-arch x86_64" pip install pyreaper --no-cache-dir -v

@cveaux
Copy link
Author

cveaux commented Mar 12, 2018

Great, it compiles and install fine with the ARCHFLAGS.
Thanks!

@r9y9
Copy link
Owner

r9y9 commented Mar 12, 2018

Nice! I will leave the issue open until I find more general fix.

@marcopagnini
Copy link

on windows 10, 64-bit architecture, I have the same problem but cannot use the provided solution: simply no ARCHFLAGS option on windows to run pip. Doesn't work either to add this parameter as environment variable.
I am currently unable to install pyreaper in any form into my machine. BTW it works on Ubuntu 64-bit.
Please fix this because is quite a sensitive issue being limited to specific OS and/or architecture.

Error log extract:
...
pyreaper\creaper.cpp(4153) : error C2664: 'PyObject *(__pyx_obj_8pyreaper_7creaper_EpochTracker *,Track *,int32_t *)' : cannot convert parameter 3 from '__pyx_t_5numpy_int32_t *' to 'int32_t *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
pyreaper\creaper.cpp(4153) : error C2664: 'PyObject *(__pyx_obj_8pyreaper_7creaper_EpochTracker *,Track *,int32_t *)' : cannot convert parameter 1 from 'Track *' to '__pyx_obj_8pyreaper_7creaper_EpochTracker *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
...

@r9y9
Copy link
Owner

r9y9 commented May 27, 2018

Sorry for the inconvenience, but it's hard to fix for me since I don't have windows machines...

@r9y9
Copy link
Owner

r9y9 commented May 27, 2018

Seems like env command exists on windows? env ARCHFLAGS="-arch x86_64" pip install pyreaper --no-cache-dir -v ?

@stale
Copy link

stale bot commented May 29, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label May 29, 2019
@stale stale bot removed the wontfix label May 29, 2019
@stale
Copy link

stale bot commented Jul 28, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Jul 28, 2019
@r9y9 r9y9 added bug and removed wontfix labels Jul 29, 2019
@r9y9 r9y9 closed this as completed in #12 May 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants