robotpy / robotpy-cscore

Moved to https://github.com/robotpy/mostrobotpy
Other
18 stars 12 forks source link

Error building bdist_wheel on OSX #7

Closed virtuald closed 5 years ago

virtuald commented 7 years ago

Must be something in pybind11's setup script.

joshsizer commented 5 years ago

I was wondering if you might be able to help me install on Mac OSX 10.14.2, or atleast tell me that it's not possible at the moment.

Installed on system: clang: Apple LLVM version 10.0.0 (clang-1000.10.44.4) opencv: 4.0.1 and 2.4.13.7_2 python: 3.7 numpy: 1.15.4

I get slightly different errors when I use opencv 4 vs opencv 2. It always fails compiling ndarray_converter.cpp.

Here is the error log with opencv4 and opencv2 respectively: install_fail_opencv4.log install_fail_opencv2.log

Any help would be appreciated!

auscompgeek commented 5 years ago

OpenCV 4 is not supported: #39. OpenCV 2 only supports Python 2.

robotpy-cscore is (currently) only compatible with OpenCV 3.

joshsizer commented 5 years ago

Ah, this was a suspicion of mine, but there is no opencv3 package on Homebrew. I am starting to think I'll have to compile from source. Do you have any resource that steps me through that process?

Edit: I figured how to compile. For reference for other noobs like me:

  1. Download the source code for the version of opencv you want (version 3 for this)
  2. Create a directory within the source code folder called 'build'
  3. cd into build
  4. enter 'cmake -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=RELEASE ../'
  5. enter 'make install'

Now, when I tried installing with 'pip3 install robotpy-cscore', it said it could not find the file 'cscore_src/wpiutil/src/main/native/libuv/unix/bsd-ifaddrs.cpp'. To fix this, I downloaded robotpy-cscore to my machine, downloaded cscore_src, and downloaded pybind11 (linked to from this github repo). Then, I ran 'pip3 install .' inside the folder 'robotpy-cscore'.

virtuald commented 5 years ago

You could have done 'git submodule init' + 'git submodule update' as ~noted~ should be in the README.

joshsizer commented 5 years ago

Thanks for the quick responses. This project is awesome, I'd like to say thank you for all the hard work.

auscompgeek commented 5 years ago

FYI it seems the Homebrew folk have come to their senses and have an opencv@3 package now.

auscompgeek commented 5 years ago

Looks like the source package on PyPI actually builds now.