Skip to content

npm install/gyp fails: "cannot use typeid with -fno-rtti" #7

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

Open
mrluc opened this issue Jan 31, 2013 · 4 comments
Open

npm install/gyp fails: "cannot use typeid with -fno-rtti" #7

mrluc opened this issue Jan 31, 2013 · 4 comments

Comments

@mrluc
Copy link

mrluc commented Jan 31, 2013

node 0.8.14
npm 1.1.65
osx 10.7.4

Running npm install opencv-node fails as follows.

> [email protected] install /Users/mrluc/projects/scratch/cv2/node_modules/opencv-node
> node-gyp configure build

  CXX(target) Release/obj.target/addon/src/addon.o
In file included from /usr/local/include/opencv2/flann/params.h:33,
                 from /usr/local/include/opencv2/flann/flann_base.hpp:41,
                 from /usr/local/include/opencv2/flann/flann.hpp:50,
                 from /usr/local/include/opencv/cv.h:69,
                 from /usr/local/include/opencv/cv.hpp:50,
                 from ../src/opencvjs.h:5,
                 from ../src/addon.cpp:4:
/usr/local/include/opencv2/flann/any.h: In member function 'virtual const std::type_info& cvflann::anyimpl::typed_base_any_policy<T>::type()':
/usr/local/include/opencv2/flann/any.h:60: error: cannot use typeid with -fno-rtti
/usr/local/include/opencv2/flann/any.h: In member function 'T& cvflann::any::cast()':
/usr/local/include/opencv2/flann/any.h:248: error: cannot use typeid with -fno-rtti
/usr/local/include/opencv2/flann/any.h: In member function 'const T& cvflann::any::cast() const':
/usr/local/include/opencv2/flann/any.h:257: error: cannot use typeid with -fno-rtti
/usr/local/include/opencv2/flann/any.h: In member function 'bool cvflann::any::empty() const':
/usr/local/include/opencv2/flann/any.h:266: error: cannot use typeid with -fno-rtti
/usr/local/include/opencv2/flann/any.h: In member function 'bool cvflann::any::has_type()':
/usr/local/include/opencv2/flann/any.h:286: error: cannot use typeid with -fno-rtti
../src/bea.h: In static member function 'static bool bea::ExposedClass<T>::Is(v8::Handle<v8::Value>) [with T = cv::Mat]':
../src/opencvjs.h:258:   instantiated from here
../src/bea.h:639: warning: unused variable 'nField'
../src/bea.h:640: warning: unused variable 'isExt'
../src/bea.h:645: warning: unused variable 'p'
../src/bea.h: In static member function 'static bool bea::ExposedClass<T>::Is(v8::Handle<v8::Value>) [with T = cv::VideoCapture]':
../src/opencvjs.h:273:   instantiated from here
../src/bea.h:639: warning: unused variable 'nField'
../src/bea.h:640: warning: unused variable 'isExt'
../src/bea.h:645: warning: unused variable 'p'
../src/bea.h: In static member function 'static bool bea::ExposedClass<T>::Is(v8::Handle<v8::Value>) [with T = cv::VideoWriter]':
../src/opencvjs.h:288:   instantiated from here
../src/bea.h:639: warning: unused variable 'nField'
../src/bea.h:640: warning: unused variable 'isExt'
../src/bea.h:645: warning: unused variable 'p'
../src/bea.h: In static member function 'static bool bea::ExposedClass<T>::Is(v8::Handle<v8::Value>) [with T = cv::SparseMat]':
../src/opencvjs.h:303:   instantiated from here
../src/bea.h:639: warning: unused variable 'nField'
../src/bea.h:640: warning: unused variable 'isExt'
../src/bea.h:645: warning: unused variable 'p'
../src/bea.h: In static member function 'static bool bea::ExposedClass<T>::Is(v8::Handle<v8::Value>) [with T = cv::CascadeClassifier]':
../src/opencvjs.h:318:   instantiated from here
../src/bea.h:639: warning: unused variable 'nField'
../src/bea.h:640: warning: unused variable 'isExt'
../src/bea.h:645: warning: unused variable 'p'
../src/opencvjs.h: At global scope:
../src/opencvjs.h:606: warning: 'void opencvjs::ExposeConstants(v8::Handle<v8::Object>)' declared 'static' but never defined
make: *** [Release/obj.target/addon/src/addon.o] Error 1
gyp ERR! build error 

@pdpotter
Copy link

pdpotter commented Feb 5, 2013

Is this related to this pull request (for installation under linux)?

@codeboost
Copy link
Owner

I'm sorry I don't have an up-to-date linux system available here, but try editing binding.gyp and remove the lines where rtti is disabled:
'cflags_cc!': ['-fno-rtti'],
'cflags_cc+': ['-frtti']

See if that helps ?

@johnnagro
Copy link

i am experiencing the same issue on osx 10.8.2 with brew installed opencv 2.4.4. removing those two lines from the binding.gyp does not appear to work. here is my npm-debug.log

0 info it worked if it ends with ok
1 verbose cli [ 'node', '/usr/local/bin/npm', 'install' ]
2 info using [email protected]
3 info using [email protected]
4 verbose node symlink /usr/local/bin/node
5 verbose config file /Users/jnagro/.npmrc
6 verbose config file /usr/local/etc/npmrc
7 verbose config file /usr/local/lib/node_modules/npm/npmrc
8 verbose read json /Users/jnagro/Documents/src/gh/codeboost-opencv-node/package.json
9 verbose readDependencies using package.json deps
10 verbose install where, deps [ '/Users/jnagro/Documents/src/gh/codeboost-opencv-node',
10 verbose install   [ 'coffee-script', 'underscore', 'keypress' ] ]
11 verbose from cache /Users/jnagro/Documents/src/gh/codeboost-opencv-node/package.json
12 info preinstall [email protected]
13 verbose read json /Users/jnagro/Documents/src/gh/codeboost-opencv-node/node_modules/coffee-script/package.json
14 verbose read json /Users/jnagro/Documents/src/gh/codeboost-opencv-node/node_modules/keypress/package.json
15 verbose read json /Users/jnagro/Documents/src/gh/codeboost-opencv-node/node_modules/underscore/package.json
16 verbose from cache /Users/jnagro/Documents/src/gh/codeboost-opencv-node/package.json
17 verbose readDependencies using package.json deps
18 verbose read json /Users/jnagro/Documents/src/gh/codeboost-opencv-node/node_modules/.bin/package.json
19 verbose from cache /Users/jnagro/Documents/src/gh/codeboost-opencv-node/node_modules/coffee-script/package.json
20 verbose from cache /Users/jnagro/Documents/src/gh/codeboost-opencv-node/node_modules/keypress/package.json
21 verbose from cache /Users/jnagro/Documents/src/gh/codeboost-opencv-node/node_modules/underscore/package.json
22 verbose already installed skipping coffee-script@>=1.3.3 /Users/jnagro/Documents/src/gh/codeboost-opencv-node
23 verbose already installed skipping underscore@>=1.3.3 /Users/jnagro/Documents/src/gh/codeboost-opencv-node
24 verbose already installed skipping keypress@* /Users/jnagro/Documents/src/gh/codeboost-opencv-node
25 silly resolved []
26 info build /Users/jnagro/Documents/src/gh/codeboost-opencv-node
27 verbose from cache /Users/jnagro/Documents/src/gh/codeboost-opencv-node/package.json
28 verbose linkStuff [ false, false, false, '/Users/jnagro/Documents/src/gh' ]
29 info linkStuff [email protected]
30 verbose linkBins [email protected]
31 verbose linkMans [email protected]
32 verbose rebuildBundles [email protected]
33 verbose rebuildBundles [ '.bin', 'coffee-script', 'keypress', 'underscore' ]
34 info install [email protected]
35 verbose unsafe-perm in lifecycle true
36 silly exec sh "-c" "node-gyp configure build"
37 silly sh,-c,node-gyp configure build,/Users/jnagro/Documents/src/gh/codeboost-opencv-node spawning
38 info [email protected] Failed to exec install script
39 error [email protected] install: `node-gyp configure build`
39 error `sh "-c" "node-gyp configure build"` failed with 1
40 error Failed at the [email protected] install script.
40 error This is most likely a problem with the opencv-node package,
40 error not with npm itself.
40 error Tell the author that this fails on your system:
40 error     node-gyp configure build
40 error You can get their info via:
40 error     npm owner ls opencv-node
40 error There is likely additional logging output above.
41 error System Darwin 12.2.1
42 error command "node" "/usr/local/bin/npm" "install"
43 error cwd /Users/jnagro/Documents/src/gh/codeboost-opencv-node
44 error node -v v0.8.5
45 error npm -v 1.1.48
46 error code ELIFECYCLE
47 verbose exit [ 1, true ]

@johnnagro
Copy link

console output of npm install

➜  codeboost-opencv-node git:(master) ✗ npm install

> [email protected] install /Users/jnagro/Documents/src/gh/codeboost-opencv-node
> node-gyp configure build

  CXX(target) Release/obj.target/addon/src/addon.o
In file included from ../src/addon.cpp:3:
../src/bea.h:639:8: warning: unused variable 'nField' [-Wunused-variable]
                        int nField = o->InternalFieldCount();
                            ^
../src/bea.h:640:9: warning: unused variable 'isExt' [-Wunused-variable]
                        bool isExt = v->IsExternal();
                             ^
../src/bea.h:645:10: warning: unused variable 'p' [-Wunused-variable]
                        void* p = o->GetPointerFromInternalField(1);
                              ^
In file included from ../src/addon.cpp:4:
In file included from ../src/opencvjs.h:5:
In file included from /usr/local/include/opencv/cv.hpp:50:
In file included from /usr/local/include/opencv/cv.h:69:
In file included from /usr/local/include/opencv2/flann/flann.hpp:50:
In file included from /usr/local/include/opencv2/flann/flann_base.hpp:41:
In file included from /usr/local/include/opencv2/flann/params.h:33:
/usr/local/include/opencv2/flann/any.h:60:51: error: cannot use typeid with -fno-rtti
    virtual const std::type_info& type() { return typeid(T); }
                                                  ^
/usr/local/include/opencv2/flann/any.h:248:31: error: cannot use typeid with -fno-rtti
        if (policy->type() != typeid(T)) throw anyimpl::bad_any_cast();
                              ^
/usr/local/include/opencv2/flann/any.h:257:31: error: cannot use typeid with -fno-rtti
        if (policy->type() != typeid(T)) throw anyimpl::bad_any_cast();
                              ^
/usr/local/include/opencv2/flann/any.h:266:34: error: cannot use typeid with -fno-rtti
        return policy->type() == typeid(anyimpl::empty_any);
                                 ^
/usr/local/include/opencv2/flann/any.h:286:34: error: cannot use typeid with -fno-rtti
        return policy->type() == typeid(T);
                                 ^
In file included from ../src/addon.cpp:4:
In file included from ../src/opencvjs.h:8:
../src/customTypes.h:160:27: warning: no newline at end of file [-Wnewline-eof]
#endif //__CUSTOMTYPES_H__
                          ^
In file included from ../src/addon.cpp:4:
../src/opencvjs.h:617:28: warning: no newline at end of file [-Wnewline-eof]
#endif //#ifndef OPENCVJS_H
                           ^
5 warnings and 5 errors generated.
make: *** [Release/obj.target/addon/src/addon.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:215:23)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:91:17)
gyp ERR! stack     at Process._handle.onexit (child_process.js:674:10)
gyp ERR! System Darwin 12.2.1
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "build"
gyp ERR! cwd /Users/jnagro/Documents/src/gh/codeboost-opencv-node
gyp ERR! node -v v0.8.5
gyp ERR! node-gyp -v v0.6.3
gyp ERR! not ok 
npm ERR! [email protected] install: `node-gyp configure build`
npm ERR! `sh "-c" "node-gyp configure build"` failed with 1
npm ERR! 
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the opencv-node package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp configure build
npm ERR! You can get their info via:
npm ERR!     npm owner ls opencv-node
npm ERR! There is likely additional logging output above.

npm ERR! System Darwin 12.2.1
npm ERR! command "node" "/usr/local/bin/npm" "install"
npm ERR! cwd /Users/jnagro/Documents/src/gh/codeboost-opencv-node
npm ERR! node -v v0.8.5
npm ERR! npm -v 1.1.48
npm ERR! code ELIFECYCLE
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/jnagro/Documents/src/gh/codeboost-opencv-node/npm-debug.log
npm ERR! not ok code 0

johnnagro pushed a commit to johnnagro/opencv-node that referenced this issue Mar 4, 2013
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

4 participants