Open Pitbi opened 8 years ago
I'm having the same problem. Tried to downgrade to node 0.10.0 but still have the error.
Same problem here also using Node 5.1.
Chiming in to note I have the same problems as Pitb also on node v4.2.1.
CXX(target) Release/obj.target/libopencv/deps/opencv/modules/core/src/arithm1.o
../deps/opencv/modules/core/src/arithm1.cpp:444:51: error: constant expression evaluates to 4294967295 which cannot be narrowed to type 'int' [-Wc++11-narrowing]
static int CV_DECL_ALIGNED(16) v64f_absmask[] = { 0xffffffff, 0x7fffffff, 0xffffffff, 0x7fffffff };
^~~~~~
../deps/opencv/modules/core/src/arithm1.cpp:444:51: note: insert an explicit cast to silence this issue
static int CV_DECL_ALIGNED(16) v64f_absmask[] = { 0xffffffff, 0x7fffffff, 0xffffffff, 0x7fffffff };
^~~~~~
static_cast~~~~~
../deps/opencv/modules/core/src/arithm1.cpp:444:75: note: insert an explicit cast to silence this issue
static int CV_DECL_ALIGNED(16) v64f_absmask[] = { 0xffffffff, 0x7fffffff, 0xffffffff, 0x7fffffff };
^~~~~~
static_cast
I just forced dv to build with clang on my (Linux) machine and could reproduce the error, I'll be back with a solution.
I added the compiler flag "-Wno-c++11-narrowing" which fixes the problem on linux with my forced clang. Can anyone of you with OSX/xcode verify the fix in the newest commit on master (xcode needs a different configuration for the flag)?
After many tries i could able to run dv version 1.9.3 in node version 0.10.39.it is running now
osx, node v4.2.1, npm install https://github.com/creatale/node-dv.git
this happens:
In file included from ../deps/tesseract/ccmain/equationdetect.cpp:38:
In file included from ../deps/tesseract/textord/bbgrid.h:26:
../deps/tesseract/ccutil/hashfn.h:25:10: fatal error: 'unordered_map' file not found
#include <unordered_map>
^
49 warnings and 1 error generated.
make: *** [Release/obj.target/libtesseract/deps/tesseract/ccmain/equationdetect.o] Error 1
Still fails to build on Mac OS X after the latest commit on master.
In file included from ../deps/tesseract/ccmain/equationdetect.cpp:38:
In file included from ../deps/tesseract/textord/bbgrid.h:26:
../deps/tesseract/ccutil/hashfn.h:25:10: fatal error: 'unordered_map' file not found
#include <unordered_map>
^
49 warnings and 1 error generated.
make: *** [Release/obj.target/libtesseract/deps/tesseract/ccmain/equationdetect.o] Error 1
Downgraded dv
to 1.9.2, here is the error.
CXX(target) Release/obj.target/libopencv/deps/opencv/modules/core/src/algorithm.o
CXX(target) Release/obj.target/libopencv/deps/opencv/modules/core/src/alloc.o
CXX(target) Release/obj.target/libopencv/deps/opencv/modules/core/src/arithm1.o
../deps/opencv/modules/core/src/arithm1.cpp:444:51: error: constant expression evaluates to 4294967295 which cannot be narrowed to type 'int' [-Wc++11-narrowing]
static int CV_DECL_ALIGNED(16) v64f_absmask[] = { 0xffffffff, 0x7fffffff, 0xffffffff, 0x7fffffff };
^~~~~~~~~~
../deps/opencv/modules/core/src/arithm1.cpp:444:51: note: insert an explicit cast to silence this issue
static int CV_DECL_ALIGNED(16) v64f_absmask[] = { 0xffffffff, 0x7fffffff, 0xffffffff, 0x7fffffff };
^~~~~~~~~~
static_cast<int>( )
../deps/opencv/modules/core/src/arithm1.cpp:444:75: error: constant expression evaluates to 4294967295 which cannot be narrowed to type 'int' [-Wc++11-narrowing]
static int CV_DECL_ALIGNED(16) v64f_absmask[] = { 0xffffffff, 0x7fffffff, 0xffffffff, 0x7fffffff };
^~~~~~~~~~
../deps/opencv/modules/core/src/arithm1.cpp:444:75: note: insert an explicit cast to silence this issue
static int CV_DECL_ALIGNED(16) v64f_absmask[] = { 0xffffffff, 0x7fffffff, 0xffffffff, 0x7fffffff };
^~~~~~~~~~
static_cast<int>( )
2 errors generated.
make: *** [Release/obj.target/libopencv/deps/opencv/modules/core/src/arithm1.o] Error 1
The problem is definitely some missing compiler flags for OSX/clang, but diagnosing and finding a solution is quite difficult without a Mac. It probably needs something like that in xcode_settings
in the commons.gyp:
'OTHER_CPLUSPLUSFLAGS' : ['-std=c++11','-stdlib=libc++'],
'OTHER_LDFLAGS': ['-stdlib=libc++'],
I'm on to it. Can I npm test
after I applied the patch?
I changed OS X specific lines in commons.pyp
with this:
['OS=="mac"',
{
'xcode_settings': {
'GCC_ENABLE_CPP_EXCEPTIONS': 'YES',
'OTHER_CFLAGS': [ '-O3', '-march=native', '-w' ],
'OTHER_CPLUSPLUSFLAGS' : ['-Wno-c++11-narrowing', '-std=c++11', '-stdlib=libc++'],
'OTHER_LDFLAGS': ['-stdlib=libc++'],
}
}
],
I get an error at the beginning of the build:
> dv@1.10.1 install /Users/diego/node_modules/dv
> node-gyp rebuild
CXX(target) Release/obj.target/jpg/deps/jpg/jpgd.o
clang: error: invalid deployment target for -stdlib=libc++ (requires OS X 10.7 or later)
make: *** [Release/obj.target/jpg/deps/jpg/jpgd.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
Managed to surpass the error by adding an additional -mmacosx-version-min=10.7
clang flag and removing OTHER_LDFLAGS
entirely. I will send a pull request once I finish testing. Mac OS X versions that are older than Lion will not be supported though.
Build succeeded. Tests failed at some point. Here is the test result:
> dv@1.10.1 test /Users/diego/Projects/diego/node-dv
> mocha test
Image
✓ should construct from raw data (grayscale)
✓ should construct from raw data (rgb)
✓ should construct from raw data (rgba)
✓ should save using #toBuffer() (573ms)
✓ should return raw image data using #toBuffer()
✓ should #invert() (144ms)
✓ should #or(), #and(), #xor(), #add() and #subtract() (337ms)
✓ should #add() and #subtract() arithmetically for grayscale
✓ should #add() and #subtract() arithmetically for rgb
✓ should #convolve()
✓ should #unsharp() (132ms)
✓ should #rotate() (339ms)
✓ should #scale() (454ms)
✓ should #crop()
✓ should #inRange()
✓ should #rankFilter() (149ms)
✓ should #toGray() (224ms)
✓ should #toHSV() and #toRGB() (153ms)
✓ should #erode() (148ms)
✓ should #dilate()
✓ should #open() (152ms)
✓ should #close() (129ms)
✓ should #thin()
✓ should #otsuAdaptiveThreshold(), #findSkew()
✓ should #lineSegments(), #drawLine() (315ms)
✓ should throw error on too large precision
✓ should #connectedComponents() (628ms)
✓ should #distanceFunction() and #maxDynamicRange()
✓ should #fillBox() (362ms)
✓ should #drawBox() (388ms)
✓ should #drawImage()
✓ should #octreeColorQuant()
✓ should #medianCutQuant()
✓ should #threshold()
✓ should #histogram()
✓ should #projection()
✓ should #applyCurve() and #setMasked() (187ms)
Tesseract
✓ should #clear()
✓ should #clearAdaptiveClassifier()
✓ should set #image to null
✓ should set #image
✓ should set/get variables
✓ should set/get a whitelist
✓ should #findRegions() (4471ms)
✓ should #findRegions(false) (1352ms)
✓ should #findTextLines() (4248ms)
✓ should #findTextLines(false) (1396ms)
✓ should #findParagraphs() (4432ms)
✓ should #findParagraphs(false) (1343ms)
✓ should #findWords() (3984ms)
✓ should #findWords(false) (1362ms)
✓ should #findSymbols() (4101ms)
✓ should #findSymbols(false) (1352ms)
✓ should #findText('plain') (3480ms)
✓ should #findText('plain', true) (3512ms)
✓ should #findText('unlv') (3818ms)
✓ should #findText('unlv', true) (3544ms)
✓ should #findText('hocr', 0) (3503ms)
✓ should #findText('box', 0) (3541ms)
✓ should generate hOCR without recognition (527ms)
ZXing
✓ should have no #image set
✓ should set #image to null
✓ should have #formats set
✓ should have #tryHarder
#findCode()
✓ should find nothing
node(58866,0x7fff7266f000) malloc: *** error for object 0x7fff50983a99: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
Abort trap: 6
any luck here???? i still cannot install dv with node versions later than 0.10.39......while i want to use it with node version 4.but i am getting this error
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\concrt.h(4774): error C3861: '__uncaught_exception': identifier not found (..\..\..\deps\opencv\modules\core\src\parallel.cpp)
i am using visual studio 2013.
Please see #31 to report your platform and version, so we can set up automated testing for your platform.
Seen it, hope I could help.
Any updates on this since then?
In my case npm install
didn't work for any version.
LIBTOOL-STATIC Release/tesseract.a make: *** No rule to make target
Release/obj.target/libzxing/deps/zxing/core/src/bigint/BigInteger.o', needed by Release/zxing.a'. Stop. gyp ERR! build error
Will a patch be out for this issue? Or if not how can I build this locally and npm install?
@onlinegeek101: use npm link when you compile the code directly.
npm link
in the cloned node-dv repositorynpm link dv
in your projectAlternatively, per direct git reference (https://docs.npmjs.com/cli/install (g)).
I had the same issues on my Mac, took a while to figure it out but after checking this link
https://travis-ci.org/creatale/node-dv/jobs/101310954 I found that typing:
export CXX="g++-4.8" CC="gcc-4.8"
into your command prompt before you type npm install dv
would solve the problem
Having same issue. Tried the tweak @hilaby did, to no avail. Reinstalled node, no change. node 6.9.5 npm 3.10.10 gcc Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/c++/4.2.1 Apple LLVM version 8.0.0 (clang-800.0.42.1) Target: x86_64-apple-darwin16.4.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
CXX(target) Release/obj.target/libopencv/deps/opencv/modules/core/src/arithm1.o
../deps/opencv/modules/core/src/arithm1.cpp:444:51: error: constant expression evaluates to 4294967295 which cannot be narrowed to type 'int' [-Wc++11-narrowing]
static int CV_DECL_ALIGNED(16) v64f_absmask[] = { 0xffffffff, 0x7fffffff, 0xffffffff, 0x7fffffff };
^~~~~~~~~~
../deps/opencv/modules/core/src/arithm1.cpp:444:51: note: insert an explicit cast to silence this issue
static int CV_DECL_ALIGNED(16) v64f_absmask[] = { 0xffffffff, 0x7fffffff, 0xffffffff, 0x7fffffff };
^~~~~~~~~~
static_cast<int>( )
../deps/opencv/modules/core/src/arithm1.cpp:444:75: error: constant expression evaluates to 4294967295 which cannot be narrowed to type 'int' [-Wc++11-narrowing]
static int CV_DECL_ALIGNED(16) v64f_absmask[] = { 0xffffffff, 0x7fffffff, 0xffffffff, 0x7fffffff };
^~~~~~~~~~
../deps/opencv/modules/core/src/arithm1.cpp:444:75: note: insert an explicit cast to silence this issue
static int CV_DECL_ALIGNED(16) v64f_absmask[] = { 0xffffffff, 0x7fffffff, 0xffffffff, 0x7fffffff };
^~~~~~~~~~
static_cast<int>( )
2 errors generated.
make: *** [Release/obj.target/libopencv/deps/opencv/modules/core/src/arithm1.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:276:23)
gyp ERR! stack at emitTwo (events.js:106:13)
gyp ERR! stack at ChildProcess.emit (events.js:191:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Darwin 16.4.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/CASABRASIL/node_modules/dv
gyp ERR! node -v v6.9.5
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
npm ERR! Darwin 16.4.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "dv"
npm ERR! node v6.9.5
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! dv@1.10.1 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the dv@1.10.1 install script 'node-gyp rebuild'.
^ having the same issue and the tweaks suggested did not fix it. Any udpate here?
node 7.6.0 npm 4.1.2 error log: npm-debug.log
Anything on this error? I am still facing it. OS:Mac OS X
Hey,
I would try node-dv (1.10.1). But I have some problems when installing via npm.
Do you have any idea?
Thx
With node 4.2.1:
With node 0.12.7: