prisonerjohn / ofxRealSense2

MIT License
12 stars 2 forks source link

Mac libraries don't work? #1

Open sourya-sen opened 4 years ago

sourya-sen commented 4 years ago

Multiple errors trying to compile on Mac, with a D415 camera. See screenshot.

Screenshot 2019-10-19 at 10 24 43 AM
sourya-sen commented 4 years ago

Huh, ok, it turns out git is not letting me download the Mac libs that are on this repo. It turns out that a git clone command is only doing 132 byte files, which is obviously not correctly. After installing git-lfs and trying out git lfs clone, I get the following error.

Cloning into 'ofxRealSense2'...
remote: Enumerating objects: 169, done.
remote: Counting objects: 100% (169/169), done.
remote: Compressing objects: 100% (132/132), done.
remote: Total 283 (delta 48), reused 126 (delta 33), pack-reused 114
Receiving objects: 100% (283/283), 198.51 KiB | 105.00 KiB/s, done.
Resolving deltas: 100% (72/72), done.
batch response: This repository is over its data quota. Account responsible for LFS bandwidth should purchase more data packs to restore access.                
error: failed to fetch some objects from 'https://github.com/prisonerjohn/ofxRealSense2.git/info/lfs'

Funnily enough, when I try to download the repo, that ain't working either.

Screenshot 2019-10-25 at 9 07 09 PM

I'm off to investigate how to compile the libs myself now.

sourya-sen commented 4 years ago

In case someone else is looking at this, the libs can be compiled by cloning the librealsense repository (https://github.com/IntelRealSense/librealsense) and following the directions from https://github.com/IntelRealSense/librealsense/blob/master/doc/installation_osx.md with the additional flag of -BUILD_SHARED_LIBS=false in step 4/cmake command. After that, the .a files can be grabbed from the following locations and replaced in the addon folder (/libs/librealsense2/lib/osx).

./build/librealsense2.a
./build/common/fw/libuvc_fw.a
./build/third-party/realsense-file/librealsense-file.a
./build/third-party/libtm/fw/libfw.a
./build/third-party/libtm/libtm/src/libtm.a
./build/src/gl/librealsense2-gl.a

Additionally, the libs/libusb/lib/osx/libusb-1.0.a file can be replaced with file with the same name from usr/local/Cellar/libusb/1.0.22/lib/

This will make the example compile but will give the following error.

[ fatal ] setup: API version mismatch: librealsense.so was compiled with API version 2.29.0 but the application was compiled with 2.25.0! Make sure correct version of the library is installed (make install)

Running make install in the librealsense won't fix this, but I ran it nevertheless. What needs to be done is to grab the librealsense/include/librealsense2 folder and replacing the same folder within ofxRealSense2/libs/librealsense2/include.

Now the example compiles fine and works!

sourya-sen commented 4 years ago
Screenshot 2019-10-26 at 9 45 50 AM