blueyeti / jit.realsense

RealSense external for Max/MSP
20 stars 8 forks source link

D415 on macOS #2

Open akamatsu opened 6 years ago

akamatsu commented 6 years ago

Hi, I'm using v0.1 of jit.realsense.mxo for D415 on macOS and Max 7 says: "uvc_open2(...) returned Not supported". Do you have v0.2 of .mxo?

I also try to build it and cmake says:

$ cmake .. -DCMAKE_BUILD_TYPE=Release -- Info: REALSENSE_VERSION_STRING=2.10.0 -- Try OpenMP C flag = [ ] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP C flag = [-fopenmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP C flag = [-fopenmp=libomp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP C flag = [/openmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP C flag = [-Qopenmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP C flag = [-openmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP C flag = [-xopenmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP C flag = [+Oopenmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP C flag = [-qsmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP C flag = [-mp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP CXX flag = [ ] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP CXX flag = [-fopenmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP CXX flag = [-fopenmp=libomp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP CXX flag = [/openmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP CXX flag = [-Qopenmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP CXX flag = [-openmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP CXX flag = [-xopenmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP CXX flag = [+Oopenmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP CXX flag = [-qsmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP CXX flag = [-mp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Could NOT find OpenMP (missing: OpenMP_C_FLAGS OpenMP_CXX_FLAGS) CMake Error at librealsense/CMakeLists.txt:89 (message):

OpenMP package is missing!

-- Configuring incomplete, errors occurred! See also "/Users/aka/jit.realsense/build/CMakeFiles/CMakeOutput.log". See also "/Users/aka/jit.realsense/build/CMakeFiles/CMakeError.log".

Do you have any idea ?

jcelerier commented 6 years ago

hi, is d415 the latest camera ? If so I really doubt it would work, this code hasn't been updated for a bunch of time. SR300 works however... if it's similar maybe you will be in luck :p

At the very least, the librealsense submodule should be updated to the latest version, which will certainly break some stuff.

These openmp flags are weird: it looks like you're on macOS and AFAIK Apple's Clang version does not support it (but I could be mistaken). Can you try to build the Intel librealsense examples on their own ? If this does not work I don't think I'll be able to help you.

akamatsu commented 6 years ago

Hi jcelerier, Yes, D415 is the latest camera. I can build the Intel librealsense and it works fine. Thank you for your advice.

akamatsu commented 6 years ago

Hi jcelerier, I could cmakle with -DBUILD_WITH_OPENMP=false and still have a trouble.

$ cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_WITH_OPENMP=false -- Info: REALSENSE_VERSION_STRING=2.10.2 CMake Warning at librealsense/CMakeLists.txt:565 (message): Using libuvc!

CMake Error: The following variables are used in this project, but they are set to NOTFOUND. Please set them or make sure they are set and tested correctly in the CMake files: /Users/aka/jit.realsense/FILE_H_DIR used as include directory in directory /Users/aka/jit.realsense

-- Configuring incomplete, errors occurred! See also "/Users/aka/jit.realsense/build/CMakeFiles/CMakeOutput.log".

Thank you.

jcelerier commented 6 years ago

hi, could you try replacing the lines starting at line 58 in the CMakeLists.txt by :

FIND_PATH(FILE_H_DIR Files.h
    HINTS
    /System/Library/Frameworks/
    /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/Headers/
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/Headers
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/Headers
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/Headers
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/Headers
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/Headers)
jcelerier commented 6 years ago

(I think that only adding the /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/Headers line would be enough but in doubt...)

jcelerier commented 6 years ago

or if it does not work, add a path found when running find /Applications/Xcode.app -name Files.h in terminal

akamatsu commented 6 years ago

adding the /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/Headers line is enough. cmake generates files.

$ cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_WITH_OPENMP=false -- Info: REALSENSE_VERSION_STRING=2.10.0 CMake Warning at librealsense/CMakeLists.txt:552 (message): Using libuvc!

-- Configuring done -- Generating done -- Build files have been written to: /Users/aka/jit.realsense/build

But another error on cmake --build .

$ cmake --build . [ 1%] Building CXX object CMakeFiles/jit.realsense.dir/jit.realsense.cpp.o /Users/aka/jit.realsense/jit.realsense.cpp:1:10: fatal error: 'librealsense/rs.hpp' file not found

include <librealsense/rs.hpp>

     ^~~~~~~~~~~~~~~~~~~~~

1 error generated. make[2]: [CMakeFiles/jit.realsense.dir/jit.realsense.cpp.o] Error 1 make[1]: [CMakeFiles/jit.realsense.dir/all] Error 2 make: *** [all] Error 2

Sorry for bothering you again but I really appreciate your advice.

jcelerier commented 6 years ago

hmmm... it looks like the API entirely changed; I opened an issue on the realsense tracker (https://github.com/IntelRealSense/librealsense/issues/1371) but I would say that this is at least a few days of work.

jcelerier commented 6 years ago

hi, I could get hold of D415 and D435 cameras ; as a result the external starts working with those. I should have a fully operational version by next week.

akamatsu commented 6 years ago

Super!! I really appreciate it.

jcelerier commented 6 years ago

I have a windows version working, but the mac SDK still has bugs. I'll keep you posted when it's finally stable enough for a mac release.

akamatsu commented 6 years ago

I see. Thank you.

jcelerier commented 6 years ago

There was a fix from the realsense team : https://github.com/IntelRealSense/librealsense/issues/1586 ; it's the bug that I was encountering so hopefully I'll be able to make a macos release soon :)

akamatsu commented 6 years ago

Wao! Thank you for your long term efforts.