EyalAr / lwip

Light Weight Image Processor for NodeJS
MIT License
2.36k stars 230 forks source link

Make sure the module compiles and works on major platforms #18

Open EyalAr opened 10 years ago

EyalAr commented 10 years ago

v0.0.1 successfully tested on:

efwe commented 10 years ago

Hi there, i tried to compile it (npm install actually) on my raspberry pi (Archlinux) and failed. Actually it just fails to finish due to a lack of resources (I even was not able to log in via ssh another time). I don't know how i could investigate this issue any further - so I just let you know. If you have an idea or another test i can run - just let me know. ~fw update: an `make' call in 'node_modules/lwip/build' passes. It takes a while, but it works. So I can only reproduce it with 'npm install'.

EyalAr commented 10 years ago

@efwe currently I don't have access to a Raspberry Pi machine, but it can actually be a good use case for this module, so I'll keep it in mind.

In the meantime, can you provide more information please?

Thanks, Eyal.

EyalAr commented 10 years ago

v0.0.2 successfully tested on:

EyalAr commented 10 years ago

v0.0.3 successfully tested with Node 0.10 and 0.11 on the following platforms:

EyalAr commented 10 years ago

v0.0.4 successfully tested with Node 0.10 and 0.11 on the following platforms:

ghost commented 10 years ago

Fails on SunOS 5.11 (Joyent SmartOS which is really SunOS which is really Solaris which is really eroding my sanity)…

> lwip@0.0.4 install /home/admin/sites/blvd/site/node_modules/lwip
> node-gyp rebuild

make: Entering directory '/home/admin/sites/blvd/site/node_modules/lwip/build'
  CXX(target) Release/obj.target/lwip_decoder/src/decoder/init.o
In file included from ../src/decoder/decoder.h:18:0,
                 from ../src/decoder/init.cpp:1:
../lib/cimg/CImg.h: In constructor 'cimg_library::CImgException::CImgException(const char*, ...)':
../lib/cimg/CImg.h:2155:52: error: exception handling disabled, use -fexceptions to enable
../lib/cimg/CImg.h: In instantiation of 'int cimg_library::cimg::dialog(const char*, const char*, const char*, const char*, const char*, const char*, const char*, const char*, const cimg_library::CImg<T>&, bool) [with t = unsigned char]':
../lib/cimg/CImg.h:47575:64:   required from here
../lib/cimg/CImg.h:47567:3: warning: no return statement in function returning non-void [-Wreturn-type]
lwip_decoder.target.mk:155: recipe for target 'Release/obj.target/lwip_decoder/src/decoder/init.o' failed
make: *** [Release/obj.target/lwip_decoder/src/decoder/init.o] Error 1
make: Leaving directory '/home/admin/sites/blvd/site/node_modules/lwip/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/opt/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack     at ChildProcess.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:810:12)
gyp ERR! System SunOS 5.11
gyp ERR! command "node" "/opt/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/admin/sites/blvd/site/node_modules/lwip
gyp ERR! node -v v0.10.31
gyp ERR! node-gyp -v v1.0.1
gyp ERR! not ok
npm ERR! lwip@0.0.4 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the lwip@0.0.4 install script.
npm ERR! This is most likely a problem with the lwip package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls lwip
npm ERR! There is likely additional logging output above.

npm ERR! System SunOS 5.11
npm ERR! command "node" "/opt/local/bin/npm" "install"
npm ERR! cwd /home/admin/sites/blvd/site
npm ERR! node -v v0.10.31
npm ERR! npm -v 1.4.24
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /home/admin/sites/blvd/site/npm-debug.log
npm ERR! not ok code 0
EyalAr commented 10 years ago

@zachizi The problem is that your compiler disables C++ exceptions by default. This can probably be fixed with a compiler flag to enable exceptions.

I don't have access to Solaris, so I can't currently verify, but try adding the following to binding.gyp (in the directory of the module):

['OS=="solaris"', {
    'cflags!': ['-fno-exceptions'],
    'cflags_cc!': ['-fno-exceptions'],
}],

Add it to each of the 3 'conditions' arrays (line 79, 172 and 215)

Then run node-gyp rebuild in the directory of the module.

Let me know if it works. Thanks.

ghost commented 10 years ago

That worked, thanks! Had a feeling it had something to do with the flags but I'm pretty lost when it comes to compiler issues. Forked & submitted PR w/ the changes.

EyalAr commented 10 years ago

@zachizi Awesome, thanks for the PR! Merged, and will be included in v0.0.5.

EyalAr commented 10 years ago

v0.0.5 successfully tested with Node 0.10 and 0.11 on the following platforms:

HugoCornu commented 10 years ago

Its failing on my windows 8.1 I didnt find any binding.gyp file. Any clue?

C:\Users\Hugo\Dropbox\AppNodeJS\YouniLP\node_modules\lwip>node "C:\Program Files \nodejs\node_modules\npm\bin\node-gyp-bin....\node_modules\node-gyp\bin\node- gyp.js" rebuild gyp ERR! configure error gyp ERR! stack Error: Can't find Python executable "python", you can set the PYT HON env variable. gyp ERR! stack at failNoPython (C:\Program Files\nodejs\node_modules\npm\nod e_modules\node-gyp\lib\configure.js:103:14) gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node -gyp\lib\configure.js:64:11 gyp ERR! stack at Object.oncomplete (fs.js:107:15) gyp ERR! System Windows_NT 6.2.9200 gyp ERR! command "node" "C:\Program Files\nodejs\node_modules\npm\node_modu les\node-gyp\bin\node-gyp.js" "rebuild" gyp ERR! cwd C:\Users\Hugo\Dropbox\AppNodeJS\YouniLP\node_modules\lwip gyp ERR! node -v v0.10.28 gyp ERR! node-gyp -v v0.13.0 gyp ERR! not ok npm ERR! lwip@0.0.5 install: node-gyp rebuild npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the lwip@0.0.5 install script. npm ERR! This is most likely a problem with the lwip package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node-gyp rebuild npm ERR! You can get their info via: npm ERR! npm owner ls lwip npm ERR! There is likely additional logging output above.

npm ERR! System Windows_NT 6.2.9200 npm ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nod ejs\node_modules\npm\bin\npm-cli.js" "install" "lwip" npm ERR! cwd C:\Users\Hugo\Dropbox\AppNodeJS\YouniLP npm ERR! node -v v0.10.28 npm ERR! npm -v 1.4.9 npm ERR! code ELIFECYCLE npm ERR! npm ERR! Additional logging details can be found in: npm ERR! C:\Users\Hugo\Dropbox\AppNodeJS\YouniLP\npm-debug.log npm ERR! not ok code 0

EyalAr commented 10 years ago

@HugoCornu

gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.

Seems like you need to add python to your PATH, and / or install Python.

See here and here for some pointers.

HugoCornu commented 10 years ago

Hi, thx so much for your reactivity and for Lwip !

EyalAr commented 9 years ago

v0.0.6 successfully tested with Node 0.10 and 0.11 on the following platforms:

cbratschi commented 9 years ago

Visual Studio 2013 Ultimate Update 4 fails on Windows 8.1:

jpeg_decoder.cpp ...\node_modules\lwip\src\lib\gif\gif_lib.h(22): fatal error C1083: Cannot open include file: 'stdbool.h': No such file or directory [...\node_modules\lwip\build\lwip_decoder.vcxproj]

This is a C99 specific error. stdbool.h should be supported by VS 2013. Anyone else getting this error?

frzsombor commented 9 years ago

I'm getting this error too, and can't find any solution Windows 7 x64, VS 2013 Express Update 4 Please check the images below: image1 image2 image3

Edit: I've found this stackoverflow answer, but it hasn't solved the problem for me.

FreeSlave commented 9 years ago

Same problem on Windows 8.1, Visual Studio 2013 Professional

ddaeschler commented 9 years ago

Just FYI for anyone having build issues on windows.

VS2012 is also missing stdbool.h, so I was able to get a build to complete under by making a small change to src/lib/gif/gif_lib.h.

Remove #include stdbool.h

replace it with:

ifndef __cplusplus

typedef int bool;

define true 1

define false 0

endif

I'm curious if this is still an issue with VS2015.

cbratschi commented 9 years ago

@ddaeschler at least it is still in VS 2013. Didn't try VS 2015 RC yet.

toolness commented 9 years ago

It seems odd that VS 2013 won't compile, since the dependency on C99/bool was documented in the description for #77 and @EyalAr even mentioned that 0.0.6 (which has the same dependencies on stdbool.h) compiled on VS 2013. Microsoft's own C99 library support in Visual Studio 2013 blog post seems to corroborate this.

In any case, as a workaround--I'm still on VS 2010 and want it to be easy for others to easily build my project--I've just downgrated to lwip 0.5, as it has what I need and builds fine. That said, I'm looking forward to having pre-built binaries available for this excellent library!

sasnfbi1234 commented 9 years ago

I am unable to install lwip on ubuntu

gyp ERR! build error gyp ERR! stack Error: make failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/root/.nvm/v5.0.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:270:23) gyp ERR! stack at emitTwo (events.js:87:13) gyp ERR! stack at ChildProcess.emit (events.js:172:7) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12) gyp ERR! System Linux 3.13.0-32-generic gyp ERR! command "/root/.nvm/v5.0.0/bin/node" "/root/.nvm/v5.0.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /root/node_modules/lwip gyp ERR! node -v v5.0.0 gyp ERR! node-gyp -v v3.0.3 gyp ERR! not ok npm WARN ENOENT ENOENT: no such file or directory, open '/root/package.json' npm WARN EPACKAGEJSON /root No description npm WARN EPACKAGEJSON /root No repository field. npm WARN EPACKAGEJSON /root No README data npm WARN EPACKAGEJSON /root No license field. npm ERR! Linux 3.13.0-32-generic npm ERR! argv "/root/.nvm/v5.0.0/bin/node" "/root/.nvm/v5.0.0/bin/npm" "install" "lwip" npm ERR! node v5.0.0 npm ERR! npm v3.3.6 npm ERR! code ELIFECYCLE

npm ERR! lwip@0.0.8 install: node-gyp rebuild npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the lwip@0.0.8 install script 'node-gyp rebuild'. npm ERR! This is most likely a problem with the lwip package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node-gyp rebuild npm ERR! You can get their info via: npm ERR! npm owner ls lwip npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request: npm ERR! /root/npm-debug.log

carterbancroft commented 8 years ago

@EyalAr would it be possible to get a check on Ubuntu 12.04 with gcc 4.8 and Node 5.x? This won't install there for us even after upgrading from gcc 4.6 to 4.8.1. It's the same thing on Debian 8. Perhaps it could be a thing with latest versions of V8? I've attached the stack trace for the error. It'd be great to be able to use this library. Thank you!

stacktrace.txt