macOS big sur electron-rebuild error
notbucai opened this issue · 3 comments
Error Message
> electron-rebuild -w opencv4nodejs
⠏ Building module: opencv4nodejs, Completed: 0gyp info find Python using Python version 3.9.6 found at "/usr/local/opt/python@3.9/bin/python3.9"
⠋ Building module: opencv4nodejs, Completed: 0gyp info spawn /usr/local/opt/python@3.9/bin/python3.9
gyp info spawn args [
gyp info spawn args '/Users/bucai/ME/wwwroot/ai-electron/node_modules/electron-rebuild/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/bucai/ME/wwwroot/ai-electron/node_modules/opencv4nodejs/build/config.gypi',
gyp info spawn args '-I',
gyp info spawn args '/Users/bucai/ME/wwwroot/ai-electron/node_modules/electron-rebuild/node_modules/node-gyp/addon.gypi',
gyp info spawn args '-I',
gyp info spawn args '/Users/bucai/.electron-gyp/12.0.6/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/bucai/.electron-gyp/12.0.6',
gyp info spawn args '-Dnode_gyp_dir=/Users/bucai/ME/wwwroot/ai-electron/node_modules/electron-rebuild/node_modules/node-gyp',
gyp info spawn args '-Dnode_lib_file=/Users/bucai/.electron-gyp/12.0.6/<(target_arch)/node.lib',
gyp info spawn args '-Dmodule_root_dir=/Users/bucai/ME/wwwroot/ai-electron/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=.'
gyp info spawn args ]
⠧ Building module: opencv4nodejs, Completed: 0gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
CXX(target) Release/obj.target/opencv4nodejs/cc/opencv4nodejs.o
⠹ Building module: opencv4nodejs, Completed: 0In file included from ../cc/opencv4nodejs.cc:1:
In file included from /Users/bucai/.electron-gyp/12.0.6/include/node/node.h:67:
In file included from /Users/bucai/.electron-gyp/12.0.6/include/node/v8.h:30:
/Users/bucai/.electron-gyp/12.0.6/include/node/v8-internal.h:452:38: error: no template named 'remove_cv_t' in namespace 'std';
did you mean 'remove_cv'?
!std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
~~~~~^~~~~~~~~~~
remove_cv
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits:697:50: note:
'remove_cv' declared here
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_cv
^
⠹ Building module: opencv4nodejs, Completed: 0In file included from ../cc/opencv4nodejs.cc:1:
In file included from /Users/bucai/.electron-gyp/12.0.6/include/node/node.h:67:
In file included from /Users/bucai/.electron-gyp/12.0.6/include/node/v8.h:23:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:3607:5: warning:
destructor called on non-final 'FF::Arg<FF::ObjectWrapTemplate<Point2, cv::Point_<double>
>::ArrayWithCastConverter<cv::Point_<float> > >' that has virtual functions but non-virtual destructor
[-Wdelete-non-abstract-non-virtual-dtor]
__data_.second().~_Tp();
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:3566:5: note:
in instantiation of member function 'std::__1::__shared_ptr_emplace<FF::Arg<FF::ObjectWrapTemplate<Point2,
cv::Point_<double> >::ArrayWithCastConverter<cv::Point_<float> > >,
std::__1::allocator<FF::Arg<FF::ObjectWrapTemplate<Point2, cv::Point_<double> >::ArrayWithCastConverter<cv::Point_<float>
> > > >::__on_zero_shared' requested here
__shared_ptr_emplace(_Alloc __a)
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:4405:26: note:
in instantiation of member function 'std::__1::__shared_ptr_emplace<FF::Arg<FF::ObjectWrapTemplate<Point2,
cv::Point_<double> >::ArrayWithCastConverter<cv::Point_<float> > >,
std::__1::allocator<FF::Arg<FF::ObjectWrapTemplate<Point2, cv::Point_<double> >::ArrayWithCastConverter<cv::Point_<float>
> > > >::__shared_ptr_emplace' requested here
::new(__hold2.get()) _CntrlBlk(__a2, _VSTD::forward<_Args>(__args)...);
^
/Users/bucai/ME/wwwroot/ai-electron/node_modules/native-node-utils/src/BindingBase.h:98:47: note: in instantiation of function
template specialization 'std::__1::make_shared<FF::Arg<FF::ObjectWrapTemplate<Point2, cv::Point_<double>
>::ArrayWithCastConverter<cv::Point_<float> > >>' requested here
std::shared_ptr<Arg<Converter>> val = std::make_shared<Arg<Converter>>();
^
../cc/calib3d/calib3dBindings.h:892:22: note: in instantiation of function template specialization
'FF::BindingBase::req<FF::ObjectWrapTemplate<Point2, cv::Point_<double> >::ArrayWithCastConverter<cv::Point_<float> > >'
requested here
auto srcPoints = req<Point2::ArrayWithCastConverter<cv::Point2f>>();
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:3607:23: note:
qualify call to silence this warning
__data_.second().~_Tp();
^
⠸ Building module: opencv4nodejs, Completed: 0/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:3607:5: warning:
destructor called on non-final 'FF::Arg<FF::AbstractConverter<FF::InstanceConverterImpl<Mat, cv::Mat> > >' that has
virtual functions but non-virtual destructor [-Wdelete-non-abstract-non-virtual-dtor]
__data_.second().~_Tp();
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:3566:5: note:
in instantiation of member function
'std::__1::__shared_ptr_emplace<FF::Arg<FF::AbstractConverter<FF::InstanceConverterImpl<Mat, cv::Mat> > >,
std::__1::allocator<FF::Arg<FF::AbstractConverter<FF::InstanceConverterImpl<Mat, cv::Mat> > > > >::__on_zero_shared'
requested here
__shared_ptr_emplace(_Alloc __a)
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:4405:26: note:
in instantiation of member function
'std::__1::__shared_ptr_emplace<FF::Arg<FF::AbstractConverter<FF::InstanceConverterImpl<Mat, cv::Mat> > >,
std::__1::allocator<FF::Arg<FF::AbstractConverter<FF::InstanceConverterImpl<Mat, cv::Mat> > > > >::__shared_ptr_emplace'
requested here
::new(__hold2.get()) _CntrlBlk(__a2, _VSTD::forward<_Args>(__args)...);
^
/Users/bucai/ME/wwwroot/ai-electron/node_modules/native-node-utils/src/BindingBase.h:98:47: note: in instantiation of function
template specialization
'std::__1::make_shared<FF::Arg<FF::AbstractConverter<FF::InstanceConverterImpl<Mat, cv::Mat> > >>' requested here
std::shared_ptr<Arg<Converter>> val = std::make_shared<Arg<Converter>>();
^
../cc/calib3d/calib3dBindings.h:893:25: note: in instantiation of function template specialization
'FF::BindingBase::req<FF::AbstractConverter<FF::InstanceConverterImpl<Mat, cv::Mat> > >' requested here
auto cameraMatrix = req<Mat::Converter>();
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:3607:23: note:
qualify call to silence this warning
__data_.second().~_Tp();
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:3607:5: warning:
destructor called on non-final 'FF::NamedValue<FF::ObjectWrapTemplate<Point2, cv::Point_<double>
>::ArrayWithCastConverter<cv::Point_<float> > >' that has virtual functions but non-virtual destructor
[-Wdelete-non-abstract-non-virtual-dtor]
__data_.second().~_Tp();
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:3573:9: note:
in instantiation of member function 'std::__1::__shared_ptr_emplace<FF::NamedValue<FF::ObjectWrapTemplate<Point2,
cv::Point_<double> >::ArrayWithCastConverter<cv::Point_<float> > >,
std::__1::allocator<FF::NamedValue<FF::ObjectWrapTemplate<Point2, cv::Point_<double>
>::ArrayWithCastConverter<cv::Point_<float> > > > >::__on_zero_shared' requested here
__shared_ptr_emplace(_Alloc __a, _Args&& ...__args)
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:4405:26: note:
in instantiation of function template specialization
'std::__1::__shared_ptr_emplace<FF::NamedValue<FF::ObjectWrapTemplate<Point2, cv::Point_<double>
>::ArrayWithCastConverter<cv::Point_<float> > >, std::__1::allocator<FF::NamedValue<FF::ObjectWrapTemplate<Point2,
cv::Point_<double> >::ArrayWithCastConverter<cv::Point_<float> > > > >::__shared_ptr_emplace<std::__1::basic_string<char>
&>' requested here
::new(__hold2.get()) _CntrlBlk(__a2, _VSTD::forward<_Args>(__args)...);
^
/Users/bucai/ME/wwwroot/ai-electron/node_modules/native-node-utils/src/BindingBase.h:112:54: note: in instantiation of function
template specialization 'std::__1::make_shared<FF::NamedValue<FF::ObjectWrapTemplate<Point2, cv::Point_<double>
>::ArrayWithCastConverter<cv::Point_<float> > >, std::__1::basic_string<char> &>' requested here
std::shared_ptr<NamedValue<Converter>> val = std::make_shared<NamedValue<Converter>>(name);
^
../cc/calib3d/calib3dBindings.h:895:23: note: in instantiation of function template specialization
'FF::BindingBase::ret<FF::ObjectWrapTemplate<Point2, cv::Point_<double> >::ArrayWithCastConverter<cv::Point_<float> > >'
requested here
auto destPoints = ret<Point2::ArrayWithCastConverter<cv::Point2f>>("destPoints");
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:3607:23: note:
qualify call to silence this warning
__data_.second().~_Tp();
^
⠴ Building module: opencv4nodejs, Completed: 03 warnings and 1 error generated.
make: *** [Release/obj.target/opencv4nodejs/cc/opencv4nodejs.o] Error 1
✖ Rebuild Failed
An unhandled error occurred inside electron-rebuild
node-gyp failed to rebuild '/Users/bucai/ME/wwwroot/ai-electron/node_modules/opencv4nodejs'.
Error: `make` failed with exit code: 2
Error: node-gyp failed to rebuild '/Users/bucai/ME/wwwroot/ai-electron/node_modules/opencv4nodejs'.
Error: `make` failed with exit code: 2
at ModuleRebuilder.rebuildNodeGypModule (/Users/bucai/ME/wwwroot/ai-electron/node_modules/electron-rebuild/lib/src/module-rebuilder.js:193:19)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
Manual Build - Environment Information
*OpenCV version :
With OpenCV-contrib? (extra modules): I don't know
OS: MacOSX 11.2.3 (20D91)
*g++ --version:
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 12.0.0 (clang-1200.0.32.27)
Target: x86_64-apple-darwin20.3.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bi
install process
- brew install opencv@4
- brew link --force opencv@4
- export OPENCV4NODEJS_DISABLE_AUTOBUILD=1
- npm install opencv4nodejs
npm run electron-rebuild
--- gg
M1 Mac Mini
node --version v16.4.2
npm --version 7.18.1
Terminal output from step 4 above
npm install opencv4nodejs
npm ERR! code 1
npm ERR! path /Users/user/node_modules/opencv4nodejs
npm ERR! command failed
npm ERR! command sh -c node ./install/install.js
npm ERR! info install OPENCV_LIB_DIR is not set, looking for default lib dir
npm ERR! info install using lib dir: /usr/local/lib
npm ERR! /Users/user/node_modules/opencv4nodejs/install/install.js:45
npm ERR! throw new Error('no OpenCV libraries found in lib dir: ' + libDir)
npm ERR! ^
npm ERR!
npm ERR! Error: no OpenCV libraries found in lib dir: /usr/local/lib
npm ERR! at Object. (/Users/user/node_modules/opencv4nodejs/install/install.js:45:9)
npm ERR! at Module._compile (internal/modules/cjs/loader.js:1063:30)
npm ERR! at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
npm ERR! at Module.load (internal/modules/cjs/loader.js:928:32)
npm ERR! at Function.Module._load (internal/modules/cjs/loader.js:769:14)
npm ERR! at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
npm ERR! at internal/main/run_main_module.js:17:47
M1 Mac Mini
node --version v16.4.2
npm --version 7.18.1Terminal output from step 4 above
npm install opencv4nodejs
npm ERR! code 1
npm ERR! path /Users/user/node_modules/opencv4nodejs
npm ERR! command failed
npm ERR! command sh -c node ./install/install.js
npm ERR! info install OPENCV_LIB_DIR is not set, looking for default lib dir
npm ERR! info install using lib dir: /usr/local/lib
npm ERR! /Users/user/node_modules/opencv4nodejs/install/install.js:45
npm ERR! throw new Error('no OpenCV libraries found in lib dir: ' + libDir)
npm ERR! ^
npm ERR!
npm ERR! Error: no OpenCV libraries found in lib dir: /usr/local/lib
npm ERR! at Object. (/Users/user/node_modules/opencv4nodejs/install/install.js:45:9)
npm ERR! at Module._compile (internal/modules/cjs/loader.js:1063:30)
npm ERR! at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
npm ERR! at Module.load (internal/modules/cjs/loader.js:928:32)
npm ERR! at Function.Module._load (internal/modules/cjs/loader.js:769:14)
npm ERR! at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
npm ERR! at internal/main/run_main_module.js:17:47
The reason for your error message is that OpenCV cannot be found