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

Library not loaded: @rpath/libopencv_core.3.4.dylib #1397

Closed
fakob opened this issue Mar 23, 2018 · 7 comments
Closed

Library not loaded: @rpath/libopencv_core.3.4.dylib #1397

fakob opened this issue Mar 23, 2018 · 7 comments

Comments

@fakob
Copy link

fakob commented Mar 23, 2018

  • Node Version: v9.7.1 and 5.6.0
  • Platform: Darwin Jakobs-MBP.lan 17.4.0 Darwin Kernel Version 17.4.0: Sun Dec 17 09:19:54 PST 2017; root:xnu-4570.41.2~1/RELEASE_X86_64 x86_64
  • Compiler: Apple LLVM version 9.0.0 (clang-900.0.39.2)
    Target: x86_64-apple-darwin17.4.0
    Thread model: posix
    InstalledDir: /Library/Developer/CommandLineTools/usr/bin
  • Module: opencv4nodejs with opencv-build

Hi,
For my project, which uses the electron-react-boilerplate and electron-builder, I am amongst others including the opencv4nodejs library which also adds a simple script for building opencv. My wish is to create an executable which includes the opencv library.
Building, packaging and running it on the build machine works fine, but as soon as I try the executable on a different machine, I get the following error when executing the app.

dlopen(/Applications/MoviePrint_v004.app/Contents/Resources/app.asar.unpacked/node_modules/opencv4nodejs/build/Release/opencv4nodejs.node, 1): Library not loaded: @rpath/libopencv_core.3.4.dylib Referenced from: /Applications/MoviePrint_v004.app/Contents/Resources/app.asar.unpacked/node_modules/opencv4nodejs/build/Release/opencv4nodejs.node Reason: image not found

Running otool -l opencv4nodejs.node shows the following:

...
Load command 8
          cmd LC_LOAD_DYLIB
      cmdsize 56
         name @rpath/libopencv_core.3.4.dylib (offset 24)
   time stamp 2 Thu Jan  1 01:00:02 1970
      current version 3.4.0
compatibility version 3.4.0
...
Load command 28
          cmd LC_RPATH
      cmdsize 120
         path /Users/jakob/Documents/Electron/MoviePrint_v004/app/node_modules/opencv-build/opencv/build/lib (offset 12)

I am not fully sure how exactly the linking works, but I assumed that rpath does not get resolved properly. Therefore I added multiple rpath options with $ORIGIN and @executable_path to the binding.gyp file for testing. E.g:

    "link_settings": {
        "libraries": [
          "-Wl,-rpath,$$ORIGIN/../Resources/app.asar.unpacked/node_modules/opencv-build/opencv/build/lib",
          "-Wl,-rpath,$$ORIGIN/../../../opencv-build/opencv/build/lib",
          "-Wl,-rpath,@executable_path/../Resources/app.asar.unpacked/node_modules/opencv-build/opencv/build/lib",
          "-Wl,-rpath,@executable_path/../../../opencv-build/opencv/build/lib"
        ],
      },

This added more LC_RPATH commands/paths to opencv4nodejs.node, but it did not solve my problem. Am I right that the rpath variable in @rpath/libopencv_core.3.4.dylib does not get resolved properly? Maybe my tests for referencing are still wrong, but I tried relative paths from the executable as well as from opencv4nodejs.node. Any idea what I am doing wrong, or how I can figure out how rpath gets resolved wrongly?

Verbose output (from npm or node-gyp):
> opencv4nodejs@3.1.0 install /Users/jakobschindegger/Documents/Electron/MoviePrint_v004/app/node_modules/opencv4nodejs
> node-gyp rebuild --verbose

gyp info it worked if it ends with ok
gyp verb cli [ '/usr/local/Cellar/node/9.7.1_1/bin/node',
gyp verb cli   '/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js',
gyp verb cli   'rebuild',
gyp verb cli   '--verbose' ]
gyp info using node-gyp@3.6.2
gyp info using node@9.7.1 | darwin | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "/usr/bin/python" in the PATH
gyp verb `which` succeeded /usr/bin/python /usr/bin/python
gyp verb check python version `/usr/bin/python -c "import platform; print(platform.python_version());"` returned: "2.7.10\n"
gyp verb get node dir no --target version specified, falling back to host node version: 9.7.1
gyp verb command install [ '9.7.1' ]
gyp verb install input version string "9.7.1"
gyp verb install installing version: 9.7.1
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version is already installed, need to check "installVersion"
gyp verb got "installVersion" 9
gyp verb needs "installVersion" 9
gyp verb install version is good
gyp verb get node dir target node version installed: 9.7.1
gyp verb build dir attempting to create "build" dir: /Users/jakobschindegger/Documents/Electron/MoviePrint_v004/app/node_modules/opencv4nodejs/build
gyp verb build dir "build" dir needed to be created? /Users/jakobschindegger/Documents/Electron/MoviePrint_v004/app/node_modules/opencv4nodejs/build
gyp verb build/config.gypi creating config file
gyp verb build/config.gypi writing out config file: /Users/jakobschindegger/Documents/Electron/MoviePrint_v004/app/node_modules/opencv4nodejs/build/config.gypi
gyp verb config.gypi checking for gypi file: /Users/jakobschindegger/Documents/Electron/MoviePrint_v004/app/node_modules/opencv4nodejs/config.gypi
gyp verb common.gypi checking for gypi file: /Users/jakobschindegger/Documents/Electron/MoviePrint_v004/app/node_modules/opencv4nodejs/common.gypi
gyp verb gyp gyp format was not specified; forcing "make"
gyp info spawn /usr/bin/python
gyp info spawn args [ '/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/jakobschindegger/Documents/Electron/MoviePrint_v004/app/node_modules/opencv4nodejs/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/jakobschindegger/.node-gyp/9.7.1/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/Users/jakobschindegger/.node-gyp/9.7.1',
gyp info spawn args   '-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/Users/jakobschindegger/.node-gyp/9.7.1/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/Users/jakobschindegger/Documents/Electron/MoviePrint_v004/app/node_modules/opencv4nodejs',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.' ]
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

gyp verb command build []
gyp verb build type Release
gyp verb architecture x64
gyp verb node dev dir /Users/jakobschindegger/.node-gyp/9.7.1
gyp verb `which` succeeded for `make` /usr/bin/make
gyp info spawn make
gyp info spawn args [ 'V=1', 'BUILDTYPE=Release', '-C', 'build' ]
  c++ '-DNODE_GYP_MODULE_NAME=opencv4nodejs' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DHAVE_CORE' '-DHAVE_HIGHGUI' '-DHAVE_IMGCODECS' '-DHAVE_IMGPROC' '-DHAVE_FEATURES2D' '-DHAVE_CALIB3D' '-DHAVE_PHOTO' '-DHAVE_OBJDETECT' '-DHAVE_ML' '-DHAVE_VIDEO' '-DHAVE_VIDEOIO' '-DHAVE_VIDEOSTAB' '-DHAVE_DNN' '-DHAVE_FACE' '-DHAVE_TEXT' '-DHAVE_TRACKING' '-DHAVE_XFEATURES2D' '-DHAVE_XIMGPROC' '-DBUILDING_NODE_EXTENSION' -I/Users/jakobschindegger/.node-gyp/9.7.1/include/node -I/Users/jakobschindegger/.node-gyp/9.7.1/src -I/Users/jakobschindegger/.node-gyp/9.7.1/deps/uv/include -I/Users/jakobschindegger/.node-gyp/9.7.1/deps/v8/include -I/Users/jakobschindegger/Documents/Electron/MoviePrint_v004/app/node_modules/opencv-build/opencv/build/include -I../cc -I../cc/core -I../cc/modules -I../../nan -I/Users/jakobschindegger/Documents/Electron/MoviePrint_v004/app/node_modules/macro-inferno/src  -Os -gdwarf-2 -mmacosx-version-min=10.7 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=gnu++0x -stdlib=libc++ -fno-rtti -fno-threadsafe-statics -fno-strict-aliasing -std=c++11 -stdlib=libc++ -MMD -MF ./Release/.deps/Release/obj.target/opencv4nodejs/cc/opencv4nodejs.o.d.raw   -c -o Release/obj.target/opencv4nodejs/cc/opencv4nodejs.o ../cc/opencv4nodejs.cc
In file included from ../cc/opencv4nodejs.cc:2:
In file included from ../cc/cvTypes/cvTypes.h:1:
../cc/macros.h:136:21: warning: comparison of integers of different signs: 'int' and 'uint32_t' (aka 'unsigned int') [-Wsign-compare]
                for (int i = 0; i < jsArray->Length(); i++) {
                                ~ ^ ~~~~~~~~~~~~~~~~~
In file included from ../cc/opencv4nodejs.cc:5:
In file included from ../cc/modules/io/io.h:4:
In file included from ../cc/core/Mat.h:5:
../cc/core/Vec.h:44:21: warning: comparison of integers of different signs: 'int' and 'uint32_t' (aka 'unsigned int') [-Wsign-compare]
                for (int i = 0; i < jsVecs->Length(); i++) {
                                ~ ^ ~~~~~~~~~~~~~~~~
In file included from ../cc/opencv4nodejs.cc:5:
In file included from ../cc/modules/io/io.h:4:
In file included from ../cc/core/Mat.h:8:
In file included from ../cc/core/RotatedRect.h:3:
../cc/core/Point.h:42:21: warning: comparison of integers of different signs: 'int' and 'uint32_t' (aka 'unsigned int') [-Wsign-compare]
                for (int i = 0; i < jsPts->Length(); i++) {
                                ~ ^ ~~~~~~~~~~~~~~~
In file included from ../cc/opencv4nodejs.cc:5:
In file included from ../cc/modules/io/io.h:4:
In file included from ../cc/core/Mat.h:1:
In file included from ../cc/Converters.h:2:
../cc/ArrayConverters.h:41:21: warning: comparison of integers of different signs: 'int' and 'uint32_t' (aka 'unsigned int') [-Wsign-compare]
                for (int i = 0; i < jsArr->Length(); i++) {
                                ~ ^ ~~~~~~~~~~~~~~~
../cc/AbstractConverter.h:60:25: note: in instantiation of member function 'ArrayConverterType<IntTypeConverter, int, int>::wrap' requested here
                return ConverterType::wrap(val);
                                      ^
../cc/core/Mat.h:43:48: note: in instantiation of member function 'AbstractConverter<ArrayConverterType<IntTypeConverter, int, int>, std::__1::vector<int, std::__1::allocator<int> > >::wrap' requested here
                info.GetReturnValue().Set(IntArrayConverter::wrap(sizes));
                                                             ^
4 warnings generated.
  c++ '-DNODE_GYP_MODULE_NAME=opencv4nodejs' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DHAVE_CORE' '-DHAVE_HIGHGUI' '-DHAVE_IMGCODECS' '-DHAVE_IMGPROC' '-DHAVE_FEATURES2D' '-DHAVE_CALIB3D' '-DHAVE_PHOTO' '-DHAVE_OBJDETECT' '-DHAVE_ML' '-DHAVE_VIDEO' '-DHAVE_VIDEOIO' '-DHAVE_VIDEOSTAB' '-DHAVE_DNN' '-DHAVE_FACE' '-DHAVE_TEXT' '-DHAVE_TRACKING' '-DHAVE_XFEATURES2D' '-DHAVE_XIMGPROC' '-DBUILDING_NODE_EXTENSION' -I/Users/jakobschindegger/.node-gyp/9.7.1/include/node -I/Users/jakobschindegger/.node-gyp/9.7.1/src -I/Users/jakobschindegger/.node-gyp/9.7.1/deps/uv/include -I/Users/jakobschindegger/.node-gyp/9.7.1/deps/v8/include -I/Users/jakobschindegger/Documents/Electron/MoviePrint_v004/app/node_modules/opencv-build/opencv/build/include -I../cc -I../cc/core -I../cc/modules -I../../nan -I/Users/jakobschindegger/Documents/Electron/MoviePrint_v004/app/node_modules/macro-inferno/src  -Os -gdwarf-2 -mmacosx-version-min=10.7 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=gnu++0x -stdlib=libc++ -fno-rtti -fno-threadsafe-statics -fno-strict-aliasing -std=c++11 -stdlib=libc++ -MMD -MF ./Release/.deps/Release/obj.target/opencv4nodejs/cc/cvTypes/cvTypes.o.d.raw   -c -o Release/obj.target/opencv4nodejs/cc/cvTypes/cvTypes.o ../cc/cvTypes/cvTypes.cc
In file included from ../cc/cvTypes/cvTypes.cc:1:
In file included from ../cc/cvTypes/cvTypes.h:1:
../cc/macros.h:136:21: warning: comparison of integers of different signs: 'int' and 'uint32_t' (aka 'unsigned int') [-Wsign-compare]
                for (int i = 0; i < jsArray->Length(); i++) {
                                ~ ^ ~~~~~~~~~~~~~~~~~
1 warning generated.
  c++ '-DNODE_GYP_MODULE_NAME=opencv4nodejs' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DHAVE_CORE' '-DHAVE_HIGHGUI' '-DHAVE_IMGCODECS' '-DHAVE_IMGPROC' '-DHAVE_FEATURES2D' '-DHAVE_CALIB3D' '-DHAVE_PHOTO' '-DHAVE_OBJDETECT' '-DHAVE_ML' '-DHAVE_VIDEO' '-DHAVE_VIDEOIO' '-DHAVE_VIDEOSTAB' '-DHAVE_DNN' '-DHAVE_FACE' '-DHAVE_TEXT' '-DHAVE_TRACKING' '-DHAVE_XFEATURES2D' '-DHAVE_XIMGPROC' '-DBUILDING_NODE_EXTENSION' -I/Users/jakobschindegger/.node-gyp/9.7.1/include/node -I/Users/jakobschindegger/.node-gyp/9.7.1/src -I/Users/jakobschindegger/.node-gyp/9.7.1/deps/uv/include -I/Users/jakobschindegger/.node-gyp/9.7.1/deps/v8/include -I/Users/jakobschindegger/Documents/Electron/MoviePrint_v004/app/node_modules/opencv-build/opencv/build/include -I../cc -I../cc/core -I../cc/modules -I../../nan -I/Users/jakobschindegger/Documents/Electron/MoviePrint_v004/app/node_modules/macro-inferno/src  -Os -gdwarf-2 -mmacosx-version-min=10.7 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=gnu++0x -stdlib=libc++ -fno-rtti -fno-threadsafe-statics -fno-strict-aliasing -std=c++11 -stdlib=libc++ -MMD -MF ./Release/.deps/Release/obj.target/opencv4nodejs/cc/cvTypes/imgprocConstants.o.d.raw   -c -o Release/obj.target/opencv4nodejs/cc/cvTypes/imgprocConstants.o ../cc/cvTypes/imgprocConstants.cc
In file included from ../cc/cvTypes/imgprocConstants.cc:1:
In file included from ../cc/cvTypes/imgprocConstants.h:1:
../cc/macros.h:136:21: warning: comparison of integers of different signs: 'int' and 'uint32_t' (aka 'unsigned int') [-Wsign-compare]
                for (int i = 0; i < jsArray->Length(); i++) {
                                ~ ^ ~~~~~~~~~~~~~~~~~
1 warning generated.
  c++ '-DNODE_GYP_MODULE_NAME=opencv4nodejs' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DHAVE_CORE' '-DHAVE_HIGHGUI' '-DHAVE_IMGCODECS' '-DHAVE_IMGPROC' '-DHAVE_FEATURES2D' '-DHAVE_CALIB3D' '-DHAVE_PHOTO' '-DHAVE_OBJDETECT' '-DHAVE_ML' '-DHAVE_VIDEO' '-DHAVE_VIDEOIO' '-DHAVE_VIDEOSTAB' '-DHAVE_DNN' '-DHAVE_FACE' '-DHAVE_TEXT' '-DHAVE_TRACKING' '-DHAVE_XFEATURES2D' '-DHAVE_XIMGPROC' '-DBUILDING_NODE_EXTENSION' -I/Users/jakobschindegger/.node-gyp/9.7.1/include/node -I/Users/jakobschindegger/.node-gyp/9.7.1/src -I/Users/jakobschindegger/.node-gyp/9.7.1/deps/uv/include -I/Users/jakobschindegger/.node-gyp/9.7.1/deps/v8/include -I/Users/jakobschindegger/Documents/Electron/MoviePrint_v004/app/node_modules/opencv-build/opencv/build/include -I../cc -I../cc/core -I../cc/modules -I../../nan -I/Users/jakobschindegger/Documents/Electron/MoviePrint_v004/app/node_modules/macro-inferno/src  -Os -gdwarf-2 -mmacosx-version-min=10.7 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=gnu++0x -stdlib=libc++ -fno-rtti -fno-threadsafe-statics -fno-strict-aliasing -std=c++11 -stdlib=libc++ -MMD -MF ./Release/.deps/Release/obj.target/opencv4nodejs/cc/cvTypes/videoCaptureProps.o.d.raw   -c -o Release/obj.target/opencv4nodejs/cc/cvTypes/videoCaptureProps.o ../cc/cvTypes/videoCaptureProps.cc
In file included from ../cc/cvTypes/videoCaptureProps.cc:1:
In file included from ../cc/cvTypes/videoCaptureProps.h:1:
In file included from ../cc/Converters.h:1:
In file included from ../cc/TypeConverters.h:1:
In file included from ../cc/AbstractConverter.h:1:
../cc/macros.h:136:21: warning: comparison of integers of different signs: 'int' and 'uint32_t' (aka 'unsigned int') [-Wsign-compare]
                for (int i = 0; i < jsArray->Length(); i++) {
                                ~ ^ ~~~~~~~~~~~~~~~~~
1 warning generated.
  c++ '-DNODE_GYP_MODULE_NAME=opencv4nodejs' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DHAVE_CORE' '-DHAVE_HIGHGUI' '-DHAVE_IMGCODECS' '-DHAVE_IMGPROC' '-DHAVE_FEATURES2D' '-DHAVE_CALIB3D' '-DHAVE_PHOTO' '-DHAVE_OBJDETECT' '-DHAVE_ML' '-DHAVE_VIDEO' '-DHAVE_VIDEOIO' '-DHAVE_VIDEOSTAB' '-DHAVE_DNN' '-DHAVE_FACE' '-DHAVE_TEXT' '-DHAVE_TRACKING' '-DHAVE_XFEATURES2D' '-DHAVE_XIMGPROC' '-DBUILDING_NODE_EXTENSION' -I/Users/jakobschindegger/.node-gyp/9.7.1/include/node -I/Users/jakobschindegger/.node-gyp/9.7.1/src -I/Users/jakobschindegger/.node-gyp/9.7.1/deps/uv/include -I/Users/jakobschindegger/.node-gyp/9.7.1/deps/v8/include -I/Users/jakobschindegger/Documents/Electron/MoviePrint_v004/app/node_modules/opencv-build/opencv/build/include -I../cc -I../cc/core -I../cc/modules -I../../nan -I/Users/jakobschindegger/Documents/Electron/MoviePrint_v004/app/node_modules/macro-inferno/src  -Os -gdwarf-2 -mmacosx-version-min=10.7 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=gnu++0x -stdlib=libc++ -fno-rtti -fno-threadsafe-statics -fno-strict-aliasing -std=c++11 -stdlib=libc++ -MMD -MF ./Release/.deps/Release/obj.target/opencv4nodejs/cc/core/core.o.d.raw   -c -o Release/obj.target/opencv4nodejs/cc/core/core.o ../cc/core/core.cc
In file included from ../cc/core/core.cc:1:
In file included from ../cc/core/core.h:1:
../cc/macros.h:136:21: warning: comparison of integers of different signs: 'int' and 'uint32_t' (aka 'unsigned int') [-Wsign-compare]
                for (int i = 0; i < jsArray->Length(); i++) {
                                ~ ^ ~~~~~~~~~~~~~~~~~
In file included from ../cc/core/core.cc:2:
In file included from ../cc/core/Mat.h:5:
../cc/core/Vec.h:44:21: warning: comparison of integers of different signs: 'int' and 'uint32_t' (aka 'unsigned int') [-Wsign-compare]
                for (int i = 0; i < jsVecs->Length(); i++) {
                                ~ ^ ~~~~~~~~~~~~~~~~
In file included from ../cc/core/core.cc:2:
In file included from ../cc/core/Mat.h:8:
In file included from ../cc/core/RotatedRect.h:3:
../cc/core/Point.h:42:21: warning: comparison of integers of different signs: 'int' and 'uint32_t' (aka 'unsigned int') [-Wsign-compare]
                for (int i = 0; i < jsPts->Length(); i++) {
                                ~ ^ ~~~~~~~~~~~~~~~
../cc/core/core.cc:80:11: warning: variable 'numLabels' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
        else if (FF_IS_INSTANCE(Mat::constructor, data0)) {
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/jakobschindegger/Documents/Electron/MoviePrint_v004/app/node_modules/macro-inferno/src/ff.h:32:35: note: expanded from macro 'FF_IS_INSTANCE'
#define FF_IS_INSTANCE(ctor, obj) Nan::New(ctor)->HasInstance(obj)
                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../cc/core/core.cc:90:53: note: uninitialized use occurs here
        Nan::Set(ret, FF_NEW_STRING("numLabels"), Nan::New(numLabels));
                                                           ^~~~~~~~~
../cc/core/core.cc:80:7: note: remove the 'if' if its condition is always true
        else if (FF_IS_INSTANCE(Mat::constructor, data0)) {
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../cc/core/core.cc:59:15: note: initialize the variable 'numLabels' to silence this warning
        int numLabels;
                     ^
                      = 0
../cc/core/core.cc:112:2: warning: comparison of integers of different signs: 'int' and 'size_type' (aka 'unsigned long') [-Wsign-compare]
        FF_PACK_ARRAY(jsLabels, labels);
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/jakobschindegger/Documents/Electron/MoviePrint_v004/app/node_modules/macro-inferno/src/ff_marshalling.h:65:39: note: expanded from macro 'FF_PACK_ARRAY'
#define FF_PACK_ARRAY(ff_var, ff_vec) FF_PACK_ARRAY_(ff_var, ff_vec, Nan::New)
                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/jakobschindegger/Documents/Electron/MoviePrint_v004/app/node_modules/macro-inferno/src/ff_marshalling.h:48:20: note: expanded from macro 'FF_PACK_ARRAY_'
        for (int i = 0; i < ff_vec.size(); i++) {                       \
                        ~ ^ ~~~~~~~~~~~~~
In file included from ../cc/core/core.cc:2:
In file included from ../cc/core/Mat.h:1:
In file included from ../cc/Converters.h:2:
../cc/ArrayConverters.h:41:21: warning: comparison of integers of different signs: 'int' and 'uint32_t' (aka 'unsigned int') [-Wsign-compare]
                for (int i = 0; i < jsArr->Length(); i++) {
                                ~ ^ ~~~~~~~~~~~~~~~
../cc/AbstractConverter.h:60:25: note: in instantiation of member function 'ArrayConverterType<IntTypeConverter, int, int>::wrap' requested here
                return ConverterType::wrap(val);
                                      ^
../cc/core/Mat.h:43:48: note: in instantiation of member function 'AbstractConverter<ArrayConverterType<IntTypeConverter, int, int>, std::__1::vector<int, std::__1::allocator<int> > >::wrap' requested here
                info.GetReturnValue().Set(IntArrayConverter::wrap(sizes));
                                                             ^
In file included from ../cc/core/core.cc:1:
In file included from ../cc/core/core.h:1:
../cc/macros.h:136:21: warning: comparison of integers of different signs: 'int' and 'uint32_t' (aka 'unsigned int') [-Wsign-compare]
                for (int i = 0; i < jsArray->Length(); i++) {
                                ~ ^ ~~~~~~~~~~~~~~~~~
../cc/core/core.cc:89:45: note: in instantiation of function template specialization 'FF::stdVecToJSArray<int, int>' requested here
        Nan::Set(ret, FF_NEW_STRING("labels"), FF::stdVecToJSArray<int>(labels));
                                                   ^
In file included from ../cc/core/core.cc:2:
In file included from ../cc/core/Mat.h:8:
In file included from ../cc/core/RotatedRect.h:3:
../cc/core/Point.h:42:21: warning: comparison of integers of different signs: 'int' and 'uint32_t' (aka 'unsigned int') [-Wsign-compare]
                for (int i = 0; i < jsPts->Length(); i++) {
                                ~ ^ ~~~~~~~~~~~~~~~
../cc/core/core.cc:119:49: note: in instantiation of function template specialization 'Point::packJSPoint2Array<float>' requested here
        Nan::Set(ret, FF_NEW_STRING("centers"), Point::packJSPoint2Array<float>(centers));
                                                       ^
8 warnings generated.
  c++ '-DNODE_GYP_MODULE_NAME=opencv4nodejs' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DHAVE_CORE' '-DHAVE_HIGHGUI' '-DHAVE_IMGCODECS' '-DHAVE_IMGPROC' '-DHAVE_FEATURES2D' '-DHAVE_CALIB3D' '-DHAVE_PHOTO' '-DHAVE_OBJDETECT' '-DHAVE_ML' '-DHAVE_VIDEO' '-DHAVE_VIDEOIO' '-DHAVE_VIDEOSTAB' '-DHAVE_DNN' '-DHAVE_FACE' '-DHAVE_TEXT' '-DHAVE_TRACKING' '-DHAVE_XFEATURES2D' '-DHAVE_XIMGPROC' '-DBUILDING_NODE_EXTENSION' -I/Users/jakobschindegger/.node-gyp/9.7.1/include/node -I/Users/jakobschindegger/.node-gyp/9.7.1/src -I/Users/jakobschindegger/.node-gyp/9.7.1/deps/uv/include -I/Users/jakobschindegger/.node-gyp/9.7.1/deps/v8/include -I/Users/jakobschindegger/Documents/Electron/MoviePrint_v004/app/node_modules/opencv-build/opencv/build/include -I../cc -I../cc/core -I../cc/modules -I../../nan -I/Users/jakobschindegger/Documents/Electron/MoviePrint_v004/app/node_modules/macro-inferno/src  -Os -gdwarf-2 -mmacosx-version-min=10.7 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=gnu++0x -stdlib=libc++ -fno-rtti -fno-threadsafe-statics -fno-strict-aliasing -std=c++11 -stdlib=libc++ -MMD -MF ./Release/.deps/Release/obj.target/opencv4nodejs/cc/core/Mat.o.d.raw   -c -o Release/obj.target/opencv4nodejs/cc/core/Mat.o ../cc/core/Mat.cc
In file included from ../cc/core/Mat.cc:1:
In file included from ../cc/core/Mat.h:1:
In file included from ../cc/Converters.h:1:
In file included from ../cc/TypeConverters.h:1:
In file included from ../cc/AbstractConverter.h:1:
../cc/macros.h:136:21: warning: comparison of integers of different signs: 'int' and 'uint32_t' (aka 'unsigned int') [-Wsign-compare]
                for (int i = 0; i < jsArray->Length(); i++) {
                                ~ ^ ~~~~~~~~~~~~~~~~~
In file included from ../cc/core/Mat.cc:1:
In file included from ../cc/core/Mat.h:5:
../cc/core/Vec.h:44:21: warning: comparison of integers of different signs: 'int' and 'uint32_t' (aka 'unsigned int') [-Wsign-compare]
                for (int i = 0; i < jsVecs->Length(); i++) {
                                ~ ^ ~~~~~~~~~~~~~~~~
In file included from ../cc/core/Mat.cc:1:
In file included from ../cc/core/Mat.h:8:
In file included from ../cc/core/RotatedRect.h:3:
../cc/core/Point.h:42:21: warning: comparison of integers of different signs: 'int' and 'uint32_t' (aka 'unsigned int') [-Wsign-compare]
                for (int i = 0; i < jsPts->Length(); i++) {
                                ~ ^ ~~~~~~~~~~~~~~~
../cc/core/Mat.cc:93:21: warning: comparison of integers of different signs: 'int' and 'uint32_t' (aka 'unsigned int') [-Wsign-compare]
                for (int i = 0; i < jsChannelMats->Length(); i++) {
                                ~ ^ ~~~~~~~~~~~~~~~~~~~~~~~
../cc/core/Mat.cc:119:33: warning: comparison of integers of different signs: 'int' and 'uint32_t' (aka 'unsigned int') [-Wsign-compare]
                        if (numCols != -1 && numCols != colArray->Length()) {
                                             ~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~
../cc/core/Mat.cc:137:23: warning: comparison of integers of different signs: 'int' and 'uint32_t' (aka 'unsigned int') [-Wsign-compare]
                        if (mat.channels() != vec->Length()) {
                            ~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~
../cc/core/Mat.cc:235:3: warning: comparison of integers of different signs: 'int' and 'uint32_t' (aka 'unsigned int') [-Wsign-compare]
                FF_ASSERT_CHANNELS(cn, vec->Length(), "Mat::Set");
                ^                  ~~  ~~~~~~~~~~~~~
../cc/core/matUtils.h:130:9: note: expanded from macro 'FF_ASSERT_CHANNELS'
        if (cn != have) ...
            ~~ ^  ~~~~
../cc/core/Mat.cc:448:23: warning: comparison of integers of different signs: 'uint' (aka 'unsigned int') and 'int' [-Wsign-compare]
        bool hasOptArgsObj = FF_HAS_ARG(i) && info[i]->IsObject();
                             ^~~~~~~~~~~~~
/Users/jakobschindegger/Documents/Electron/MoviePrint_v004/app/node_modules/macro-inferno/src/ff_args.h:8:39: note: expanded from macro 'FF_HAS_ARG'
#define FF_HAS_ARG(ff_argN) ( ff_argN < info.Length() )
                              ~~~~~~~ ^ ~~~~~~~~~~~~~
../cc/core/Mat.cc:453:3: warning: comparison of integers of different signs: 'uint' (aka 'unsigned int') and 'int' [-Wsign-compare]
                FF_ARG_UINT_IFDEF(i, normType, normType);
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/jakobschindegger/Documents/Electron/MoviePrint_v004/app/node_modules/macro-inferno/src/ff_args.h:43:61: note: expanded from macro 'FF_ARG_UINT_IFDEF'
#define FF_ARG_UINT_IFDEF(ff_argN, ff_var, ff_defaultValue) FF_ARG_IFDEF(ff_argN, ff_var, ff_uint, ff_defaultValue)
                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/jakobschindegger/Documents/Electron/MoviePrint_v004/app/node_modules/macro-inferno/src/ff_args.h:20:6: note: expanded from macro 'FF_ARG_IFDEF'
  if(FF_HAS_ARG(ff_argN)) { FF_REQUIRE_ARG_TYPE(ff_argN, ff_type, false) }      \
     ^~~~~~~~~~~~~~~~~~~
/Users/jakobschindegger/Documents/Electron/MoviePrint_v004/app/node_modules/macro-inferno/src/ff_args.h:8:39: note: expanded from macro 'FF_HAS_ARG'
#define FF_HAS_ARG(ff_argN) ( ff_argN < info.Length() )
                              ~~~~~~~ ^ ~~~~~~~~~~~~~
../cc/core/Mat.cc:453:3: warning: comparison of integers of different signs: 'uint' (aka 'unsigned int') and 'int' [-Wsign-compare]
                FF_ARG_UINT_IFDEF(i, normType, normType);
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/jakobschindegger/Documents/Electron/MoviePrint_v004/app/node_modules/macro-inferno/src/ff_args.h:43:61: note: expanded from macro 'FF_ARG_UINT_IFDEF'
#define FF_ARG_UINT_IFDEF(ff_argN, ff_var, ff_defaultValue) FF_ARG_IFDEF(ff_argN, ff_var, ff_uint, ff_defaultValue)
                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/jakobschindegger/Documents/Electron/MoviePrint_v004/app/node_modules/macro-inferno/src/ff_args.h:21:14: note: expanded from macro 'FF_ARG_IFDEF'
  ff_var = (!FF_HAS_ARG(ff_argN) ? ff_defaultValue : ff_type.cast(info[ff_argN]));
             ^~~~~~~~~~~~~~~~~~~
/Users/jakobschindegger/Documents/Electron/MoviePrint_v004/app/node_modules/macro-inferno/src/ff_args.h:8:39: note: expanded from macro 'FF_HAS_ARG'
#define FF_HAS_ARG(ff_argN) ( ff_argN < info.Length() )
                              ~~~~~~~ ^ ~~~~~~~~~~~~~
../cc/core/Mat.cc:454:3: warning: comparison of integers of different signs: 'unsigned int' and 'int' [-Wsign-compare]
                FF_ARG_INSTANCE_IFDEF(i + 1, mask, Mat::constructor, FF_UNWRAP_MAT_AND_GET, mask);
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/jakobschindegger/Documents/Electron/MoviePrint_v004/app/node_modules/macro-inferno/src/ff_args.h:30:14: note: expanded from macro 'FF_ARG_INSTANCE_IFDEF'
  ff_var = (!FF_HAS_ARG(ff_argN) || !FF_IS_INSTANCE(ctor, info[ff_argN]) ? ff_defaultValue : unwrapper(info[ff_argN]->ToObject()));
             ^~~~~~~~~~~~~~~~~~~
/Users/jakobschindegger/Documents/Electron/MoviePrint_v004/app/node_modules/macro-inferno/src/ff_args.h:8:39: note: expanded from macro 'FF_HAS_ARG'
#define FF_HAS_ARG(ff_argN) ( ff_argN < info.Length() )
                              ~~~~~~~ ^ ~~~~~~~~~~~~~
../cc/core/Mat.cc:1160:73: warning: adding 'int' to a string does not append to the string [-Wstring-plus-int]
      return Nan::ThrowError(Nan::New("not implemented yet - mat type:" + mat.type()).ToLocalChecked());
                                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
../cc/core/Mat.cc:1160:73: note: use array indexing to silence this warning
      return Nan::ThrowError(Nan::New("not implemented yet - mat type:" + mat.type()).ToLocalChecked());
                                                                        ^
                                      &                                 [           ]
In file included from ../cc/core/Mat.cc:1:
In file included from ../cc/core/Mat.h:1:
In file included from ../cc/Converters.h:2:
../cc/ArrayConverters.h:41:21: warning: comparison of integers of different signs: 'int' and 'uint32_t' (aka 'unsigned int') [-Wsign-compare]
                for (int i = 0; i < jsArr->Length(); i++) {
                                ~ ^ ~~~~~~~~~~~~~~~
../cc/AbstractConverter.h:60:25: note: in instantiation of member function 'ArrayConverterType<IntTypeConverter, int, int>::wrap' requested here
                return ConverterType::wrap(val);
                                      ^
../cc/core/Mat.h:43:48: note: in instantiation of member function 'AbstractConverter<ArrayConverterType<IntTypeConverter, int, int>, std::__1::vector<int, std::__1::allocator<int> > >::wrap' requested here
                info.GetReturnValue().Set(IntArrayConverter::wrap(sizes));
                                                             ^
In file included from ../cc/core/Mat.cc:1:
In file included from ../cc/core/Mat.h:1:
In file included from ../cc/Converters.h:2:
../cc/ArrayConverters.h:41:21: warning: comparison of integers of different signs: 'int' and 'uint32_t' (aka 'unsigned int') [-Wsign-compare]
                for (int i = 0; i < jsArr->Length(); i++) {
                                ~ ^ ~~~~~~~~~~~~~~~
../cc/AbstractConverter.h:60:25: note: in instantiation of member function 'ArrayConverterType<InstanceConverterType<Mat, cv::Mat>, cv::Mat, cv::Mat>::wrap' requested here
                return ConverterType::wrap(val);
                                      ^
../cc/core/Mat.cc:507:47: note: in instantiation of member function 'AbstractConverter<ArrayConverterType<InstanceConverterType<Mat, cv::Mat>, cv::Mat, cv::Mat>, std::__1::vector<cv::Mat,
      std::__1::allocator<cv::Mat> > >::wrap' requested here
                return ObjectArrayConverter<Mat, cv::Mat> ::wrap(mv);
                                                            ^
In file included from ../cc/core/Mat.cc:1:
In file included from ../cc/core/Mat.h:1:
In file included from ../cc/Converters.h:2:
../cc/ArrayConverters.h:41:21: warning: comparison of integers of different signs: 'int' and 'uint32_t' (aka 'unsigned int') [-Wsign-compare]
                for (int i = 0; i < jsArr->Length(); i++) {
                                ~ ^ ~~~~~~~~~~~~~~~
../cc/AbstractConverter.h:60:25: note: in instantiation of member function 'ArrayConverterType<InstanceConverterType<Point2, cv::Point_<int> >, cv::Point_<double>, cv::Point_<int> >::wrap' requested here
                return ConverterType::wrap(val);
                                      ^
../cc/core/Mat.cc:630:64: note: in instantiation of member function 'AbstractConverter<ArrayConverterType<InstanceConverterType<Point2, cv::Point_<int> >, cv::Point_<double>, cv::Point_<int> >,
      std::__1::vector<cv::Point_<int>, std::__1::allocator<cv::Point_<int> > > >::wrap' requested here
                return ObjectArrayConverter<Point2, cv::Point2d, cv::Point>::wrap(idx);
                                                                             ^
15 warnings generated.

[cut out the large middle part]

  c++ -bundle -undefined dynamic_lookup -Wl,-no_pie -Wl,-search_paths_first -mmacosx-version-min=10.7 -arch x86_64 -L./Release -stdlib=libc++  -o Release/opencv4nodejs.node Release/obj.target/opencv4nodejs/cc/opencv4nodejs.o Release/obj.target/opencv4nodejs/cc/cvTypes/cvTypes.o Release/obj.target/opencv4nodejs/cc/cvTypes/imgprocConstants.o Release/obj.target/opencv4nodejs/cc/cvTypes/videoCaptureProps.o Release/obj.target/opencv4nodejs/cc/core/core.o Release/obj.target/opencv4nodejs/cc/core/Mat.o Release/obj.target/opencv4nodejs/cc/core/MatImgproc.o Release/obj.target/opencv4nodejs/cc/core/MatCalib3d.o Release/obj.target/opencv4nodejs/cc/core/Point.o Release/obj.target/opencv4nodejs/cc/core/Vec.o Release/obj.target/opencv4nodejs/cc/core/Size.o Release/obj.target/opencv4nodejs/cc/core/Rect.o Release/obj.target/opencv4nodejs/cc/core/RotatedRect.o Release/obj.target/opencv4nodejs/cc/core/TermCriteria.o Release/obj.target/opencv4nodejs/cc/modules/io/io.o Release/obj.target/opencv4nodejs/cc/modules/io/VideoCapture.o Release/obj.target/opencv4nodejs/cc/modules/io/VideoWriter.o Release/obj.target/opencv4nodejs/cc/modules/photo.o Release/obj.target/opencv4nodejs/cc/modules/video/video.o Release/obj.target/opencv4nodejs/cc/modules/video/BackgroundSubtractor.o Release/obj.target/opencv4nodejs/cc/modules/video/BackgroundSubtractorMOG2.o Release/obj.target/opencv4nodejs/cc/modules/video/BackgroundSubtractorKNN.o Release/obj.target/opencv4nodejs/cc/modules/calib3d/calib3d.o Release/obj.target/opencv4nodejs/cc/modules/imgproc/imgproc.o Release/obj.target/opencv4nodejs/cc/modules/imgproc/Contour.o Release/obj.target/opencv4nodejs/cc/modules/imgproc/Moments.o Release/obj.target/opencv4nodejs/cc/modules/ximgproc/ximgproc.o Release/obj.target/opencv4nodejs/cc/modules/ximgproc/SuperpixelSEEDS.o Release/obj.target/opencv4nodejs/cc/modules/ximgproc/SuperpixelSLIC.o Release/obj.target/opencv4nodejs/cc/modules/ximgproc/SuperpixelLSC.o Release/obj.target/opencv4nodejs/cc/modules/objdetect/objdetect.o Release/obj.target/opencv4nodejs/cc/modules/objdetect/CascadeClassifier.o Release/obj.target/opencv4nodejs/cc/modules/objdetect/HOGDescriptor.o Release/obj.target/opencv4nodejs/cc/modules/objdetect/DetectionROI.o Release/obj.target/opencv4nodejs/cc/modules/machinelearning/machinelearning.o Release/obj.target/opencv4nodejs/cc/modules/machinelearning/ParamGrid.o Release/obj.target/opencv4nodejs/cc/modules/machinelearning/StatModel.o Release/obj.target/opencv4nodejs/cc/modules/machinelearning/SVM.o Release/obj.target/opencv4nodejs/cc/modules/machinelearning/TrainData.o Release/obj.target/opencv4nodejs/cc/modules/dnn/dnn.o Release/obj.target/opencv4nodejs/cc/modules/dnn/Net.o Release/obj.target/opencv4nodejs/cc/modules/face/face.o Release/obj.target/opencv4nodejs/cc/modules/face/FaceRecognizer.o Release/obj.target/opencv4nodejs/cc/modules/face/EigenFaceRecognizer.o Release/obj.target/opencv4nodejs/cc/modules/face/FisherFaceRecognizer.o Release/obj.target/opencv4nodejs/cc/modules/face/LBPHFaceRecognizer.o Release/obj.target/opencv4nodejs/cc/modules/text/text.o Release/obj.target/opencv4nodejs/cc/modules/text/OCRHMMClassifier.o Release/obj.target/opencv4nodejs/cc/modules/text/OCRHMMDecoder.o Release/obj.target/opencv4nodejs/cc/modules/tracking/tracking.o Release/obj.target/opencv4nodejs/cc/modules/tracking/Tracker.o Release/obj.target/opencv4nodejs/cc/modules/tracking/MultiTracker.o Release/obj.target/opencv4nodejs/cc/modules/tracking/Trackers/TrackerBoosting.o Release/obj.target/opencv4nodejs/cc/modules/tracking/Trackers/TrackerBoostingParams.o Release/obj.target/opencv4nodejs/cc/modules/tracking/Trackers/TrackerKCF.o Release/obj.target/opencv4nodejs/cc/modules/tracking/Trackers/TrackerKCFParams.o Release/obj.target/opencv4nodejs/cc/modules/tracking/Trackers/TrackerMIL.o Release/obj.target/opencv4nodejs/cc/modules/tracking/Trackers/TrackerMILParams.o Release/obj.target/opencv4nodejs/cc/modules/tracking/Trackers/TrackerMedianFlow.o Release/obj.target/opencv4nodejs/cc/modules/tracking/Trackers/TrackerTLD.o Release/obj.target/opencv4nodejs/cc/modules/tracking/Trackers/TrackerGOTURN.o Release/obj.target/opencv4nodejs/cc/modules/features2d/features2d.o Release/obj.target/opencv4nodejs/cc/modules/features2d/KeyPoint.o Release/obj.target/opencv4nodejs/cc/modules/features2d/KeyPointMatch.o Release/obj.target/opencv4nodejs/cc/modules/features2d/DescriptorMatch.o Release/obj.target/opencv4nodejs/cc/modules/features2d/FeatureDetector.o Release/obj.target/opencv4nodejs/cc/modules/features2d/descriptorMatching.o Release/obj.target/opencv4nodejs/cc/modules/features2d/descriptorMatchingKnn.o Release/obj.target/opencv4nodejs/cc/modules/features2d/detectors/AGASTDetector.o Release/obj.target/opencv4nodejs/cc/modules/features2d/detectors/AKAZEDetector.o Release/obj.target/opencv4nodejs/cc/modules/features2d/detectors/BRISKDetector.o Release/obj.target/opencv4nodejs/cc/modules/features2d/detectors/FASTDetector.o Release/obj.target/opencv4nodejs/cc/modules/features2d/detectors/GFTTDetector.o Release/obj.target/opencv4nodejs/cc/modules/features2d/detectors/KAZEDetector.o Release/obj.target/opencv4nodejs/cc/modules/features2d/detectors/MSERDetector.o Release/obj.target/opencv4nodejs/cc/modules/features2d/detectors/ORBDetector.o Release/obj.target/opencv4nodejs/cc/modules/features2d/detectors/SimpleBlobDetector.o Release/obj.target/opencv4nodejs/cc/modules/features2d/detectors/SimpleBlobDetectorParams.o Release/obj.target/opencv4nodejs/cc/modules/xfeatures2d/xfeatures2d.o Release/obj.target/opencv4nodejs/cc/modules/xfeatures2d/SIFTDetector.o Release/obj.target/opencv4nodejs/cc/modules/xfeatures2d/SURFDetector.o -L/Users/jakobschindegger/Documents/Electron/MoviePrint_v004/app/node_modules/opencv-build/opencv/build/lib -lopencv_core -lopencv_highgui -lopencv_imgcodecs -lopencv_imgproc -lopencv_features2d -lopencv_calib3d -lopencv_photo -lopencv_objdetect -lopencv_ml -lopencv_video -lopencv_videoio -lopencv_videostab -lopencv_dnn -lopencv_face -lopencv_text -lopencv_tracking -lopencv_xfeatures2d -lopencv_ximgproc -Wl,-rpath,/Users/jakobschindegger/Documents/Electron/MoviePrint_v004/app/node_modules/opencv-build/opencv/build/lib -Wl,-rpath,$ORIGIN/MoviePrint_v004.app/Contents/Resources/app.asar.unpacked/node_modules/opencv-build/opencv/build/lib -Wl,-rpath,$ORIGIN/../Resources/app.asar.unpacked/node_modules/opencv-build/opencv/build/lib -Wl,-rpath,$ORIGIN/../../../opencv-build/opencv/build/lib -Wl,-rpath,@executable_path/MoviePrint_v004.app/Contents/Resources/app.asar.unpacked/node_modules/opencv-build/opencv/build/lib -Wl,-rpath,@executable_path/../Resources/app.asar.unpacked/node_modules/opencv-build/opencv/build/lib -Wl,-rpath,@executable_path/../../../opencv-build/opencv/build/lib -Wl,-rpath,$ORIGIN/../../opencv-build/opencv/build/lib -Wl,-rpath,MoviePrint_v004.app/Contents/Resources/app.asar.unpacked/node_modules/opencv-build/opencv/build/lib -Wl,-rpath,../Resources/app.asar.unpacked/node_modules/opencv-build/opencv/build/lib -Wl,-rpath,../../../opencv-build/opencv/build/lib -Wl,-rpath,../../opencv-build/opencv/build/lib -Wl,-rpath,/MoviePrint_v004.app/Contents/Resources/app.asar.unpacked/node_modules/opencv-build/opencv/build/lib -Wl,-rpath,/../Resources/app.asar.unpacked/node_modules/opencv-build/opencv/build/lib -Wl,-rpath,/../../../opencv-build/opencv/build/lib -Wl,-rpath,/../../opencv-build/opencv/build/lib -Wl,-rpath,/MoviePrint_v004.app/Contents/Resources/app.asar.unpacked/node_modules/opencv-build/opencv/build/lib/ -Wl,-rpath,/../Resources/app.asar.unpacked/node_modules/opencv-build/opencv/build/lib/ -Wl,-rpath,/../../../opencv-build/opencv/build/lib/ -Wl,-rpath,/../../opencv-build/opencv/build/lib/
gyp info ok
@bnoordhuis
Copy link
Member

You probably want @loader_path rather than @executable_path.

Remove the $ORIGIN stanzas, they're not a thing on macos and will most likely stop it from working.

@fakob
Copy link
Author

fakob commented Mar 26, 2018

Thanks @bnoordhuis. I will give it a try. @loader_path I had previously tested, but as you said $ORIGIN could have prevented it from working properly. Will look at it next week when I am back.

@fakob
Copy link
Author

fakob commented Apr 3, 2018

@bnoordhuis, I have tried your suggestion of using @loader_path and removing $ORIGIN, but it did not work. The error is still the same as mentioned in my first post.

This is now the link settings part of my binding.gyp file:

		"link_settings": {
			"libraries": [
				"-Wl,-rpath,@loader_path/../Resources/app.asar.unpacked/node_modules/opencv-build/opencv/build/lib",
				"-Wl,-rpath,@loader_path/../../../opencv-build/opencv/build/lib"
			],
		},

and this is the LC_RPATH part when I run otool -l on the generated node file.

Load command 28
          cmd LC_RPATH
      cmdsize 136
         path /Users/jakob/Documents/Development/Electron/MoviePrint_v004/app/node_modules/opencv-build/opencv/build/lib (offset 12)
Load command 29
          cmd LC_RPATH
      cmdsize 104
         path @loader_path/../Resources/app.asar.unpacked/node_modules/opencv-build/opencv/build/lib (offset 12)
Load command 30
          cmd LC_RPATH
      cmdsize 64
         path @loader_path/../../../opencv-build/opencv/build/lib (offset 12)

It seems that it only picks up on the first LC_RPATH. Is there a way to explicitly say that also the others should be considered for @rpath?

@fakob
Copy link
Author

fakob commented Apr 3, 2018

I have now tried to add other absolute paths and that seemed to work just fine. So the problem might be that @loader_path does not get interpreted right or at all.

@fakob
Copy link
Author

fakob commented Apr 3, 2018

I was a too fast regarding absolute paths working. When I now tried to run the same app file on another machine the original error came up again.

dlopen(/Applications/MoviePrint_v004.app/Contents/Resources/app.asar.unpacked/node_modules/opencv4nodejs/build/Release/opencv4nodejs.node, 1): Library not loaded: @rpath/libopencv_core.3.4.dylib
  Referenced from: /Applications/MoviePrint_v004.app/Contents/Resources/app.asar.unpacked/node_modules/opencv4nodejs/build/Release/opencv4nodejs.node
  Reason: image not found

Even though the absolute path was exactly the same on both machines:

"-Wl,-rpath,/Applications/MoviePrint_v004.app/Contents/Resources/app.asar.unpacked/node_modules/opencv-build/opencv/build/lib",

@fakob
Copy link
Author

fakob commented Apr 4, 2018

Here an update to my issue.
It seems that my problem was not only with the linking. The link settings for binding.gyp which seem to work fine are

		"link_settings": {
			"libraries": [
				"-Wl,-rpath,@loader_path/../../../opencv-build/opencv/build/lib"
			],
		},

However, it still does not work. electron-builder which I use for packaging, wraps everything in an asar file which is a tar like archive. For native stuff I am using the option to leave the opencv4nodejs and the opencv-build modules unpacked. However it appears that only the actual dylib files are unpacked and not the symlinks.
The file libopencv_core.3.4.dylib for example, referenced from opencv4nodejs.node, can be found in the app.asar file, but not in the app.asar.unpacked folder.

Resources
--app.asar
    |--node_modules
        |--opencv-build
            |--opencv
                |--build
                    |--lib
                        |--libopencv_core.3.4.0.dylib
                        |--libopencv_core.3.4.dylib
                        |--libopencv_core.dylib
--app.asar.unpacked
    |--node_modules
        |--opencv-build
            |--opencv
                |--build
                    |--lib
                        |--libopencv_core.3.4.0.dylib

Now I just have to get the symlink stuff right :-)

@fakob
Copy link
Author

fakob commented Apr 5, 2018

Finally I made it work.
The problem was two fold, therefore I thought that the linking did not work.
First I set a relative path in binding.gyp for opencv4nodejs.node

"link_settings": {
	"libraries": [
		"-Wl,-rpath,@loader_path/../../../opencv-build/opencv/build/lib"
	],
},

And in electron-builder I had to prevent packing the app folder into an asar file with

"asar": false

This keeps everything in a folder. More details about the electron-builder problem can be found here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants