lwip icon indicating copy to clipboard operation
lwip copied to clipboard

Make sure the module compiles and works on major platforms

Open EyalAr opened this issue 11 years ago • 23 comments

EyalAr avatar Jul 01 '14 16:07 EyalAr

v0.0.1 successfully tested on:

  • OS X 10.9.3 (clang-503.0.40)
  • Ubuntu 14.04 (gcc 4.8.2)
  • Windows XP (Visual C++ 2010 Express)
  • Windows 8.1 (Visual C++ 2010 Express)

EyalAr avatar Jul 02 '14 04:07 EyalAr

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'.

efwe avatar Aug 21 '14 19:08 efwe

@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?

  • You said it fails with npm install, but a manual build works. Only with this module? can you check if other native modules also exhibit this problem on your machine?
  • Can you provide the output for the failed npm install, and npm-debug.log?
  • What versions of node and npm are you using?
  • Which C++ compiler do you have installed and what version?
  • How much RAM do you have on your machine?

Thanks, Eyal.

EyalAr avatar Aug 22 '14 07:08 EyalAr

v0.0.2 successfully tested on:

  • OS X 10.9.3 (clang-503.0.40)
  • Ubuntu 14.04 (gcc 4.8.2)
  • Windows XP (Visual C++ 2010 Express)
  • Windows 8.1 (Visual C++ 2010 Express)

EyalAr avatar Sep 04 '14 11:09 EyalAr

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

  • OS X 10.9.3 (clang-503.0.40)
  • Ubuntu 14.04 (gcc 4.8.2)
  • Windows XP (Visual C++ 2010 Express)

EyalAr avatar Sep 15 '14 03:09 EyalAr

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

  • OS X 10.9.3 (clang-503.0.40)
  • Ubuntu 14.04 (gcc 4.8.2)
  • Windows XP (Visual C++ 2010 Express)

EyalAr avatar Sep 17 '14 05:09 EyalAr

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

> [email protected] 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! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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

ghost avatar Sep 24 '14 19:09 ghost

@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.

EyalAr avatar Sep 25 '14 01:09 EyalAr

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.

ghost avatar Sep 25 '14 14:09 ghost

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

EyalAr avatar Sep 25 '14 14:09 EyalAr

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

  • OS X 10.9.3 (clang-503.0.40)
  • Ubuntu 14.04 (gcc 4.8.2)
  • Windows XP (Visual C++ 2010 Express)

EyalAr avatar Oct 02 '14 09:10 EyalAr

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! [email protected] install: node-gyp rebuild npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] 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

HugoCornu avatar Oct 20 '14 13:10 HugoCornu

@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.

EyalAr avatar Oct 20 '14 13:10 EyalAr

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

HugoCornu avatar Oct 20 '14 13:10 HugoCornu

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

  • OS X 10.10.1 (clang-600.0.56)
  • Ubuntu 14.04 (gcc 4.8.2)
  • Windows 7 (Visual Studio 2013 Express)

EyalAr avatar Dec 24 '14 05:12 EyalAr

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?

cbratschi avatar Jan 23 '15 18:01 cbratschi

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.

frzsombor avatar Feb 28 '15 10:02 frzsombor

Same problem on Windows 8.1, Visual Studio 2013 Professional

FreeSlave avatar Apr 09 '15 14:04 FreeSlave

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.

ddaeschler avatar May 31 '15 18:05 ddaeschler

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

cbratschi avatar Jun 01 '15 08:06 cbratschi

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!

toolness avatar Jun 15 '15 14:06 toolness

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! [email protected] install: node-gyp rebuild npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] 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

sasnfbi1234 avatar Nov 06 '15 06:11 sasnfbi1234

@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

carterbancroft avatar Feb 29 '16 19:02 carterbancroft