Closed gushiapi closed 10 years ago
Hi Clément, same here for me. Any idea if we should report it to the owner of pty.js as suggested?
I have the same problem as well.
Hey, apparently OSX doesn't ship with the relevant headers, and none of us noticed because we have XCode Commandline Tools installed.
Look at the solution below for pty.js https://github.com/atom/terminal/issues/28#issuecomment-39405908
I have command line tools and still have problems with pty.js
npm ERR! pty.js@0.2.4 install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the pty.js@0.2.4 install script.
npm ERR! This is most likely a problem with the pty.js 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 pty.js
npm ERR! There is likely additional logging output above.
npm ERR! System Darwin 13.2.0
npm ERR! command "node" "/usr/local/bin/npm" "install"
npm ERR! cwd /private/tmp/luarocks_gfx.js-scm-0-3979/gfx.js
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.14
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /private/tmp/luarocks_gfx.js-scm-0-3979/gfx.js/npm-debug.log
npm ERR! not ok code 0
Thank you for your help.
-Andrew
On Sat, Jun 28, 2014 at 1:09 PM, Soumith Chintala notifications@github.com wrote:
Hey, apparently OSX doesn't ship with the relevant headers, and none of us noticed because we have XCode Commandline Tools installed. atom/terminal#28 (comment) https://github.com/atom/terminal/issues/28#issuecomment-39405908
— Reply to this email directly or view it on GitHub https://github.com/clementfarabet/gfx.js/issues/17#issuecomment-47433017 .
Andrew Hartnett Couzin Lab 508-566-2206 ahartnet@princeton.edu
I finally managed to run it on Mac OS X 10.9.3 (Mavericks), Node v0.10.29, npm 1.4.16, node-gyp 0.13.1. I have XCode installed but nevertheless downloaded and installed the Command Line Developer Tools from apple dev website.
The compilation error is due to util.h (which declares openpty and forkpty) not being properly included in required pty.js module. So I cloned https://github.com/chjj/pty.js and edited src/unix/pty.cc at line 39 to replace #include <util.h>
by #include "/usr/include/util.h"
in the conditional inclusions header. Then still in pty.js :
npm install nan npm install extend make
then I copied the entire pty.js directory under gfx.js/mode_modules. Then in gfx.js :
sudo luarocks make
At this point the compile error should be gone. When launching luajit -lgxf.go I had a few critical lua dependencies missing, I installed them with luarocks :
sudo luarocks install dok sudo luarocks install lua-cjson
Finally ran luajit -lgfx.go which actually loads the torch repl and launches the server on port 8000. Nice!
@lelayf thanks a lot for the investigation, I am going to make this more permanent by sending in a PR that uses your tricks.
I think it makes more sense to get the pty.js project to fix itself first, but wrt luarocks dependencies, we can do something immediately about it.
Thank you Francois!
Your fix worked for me as well!
Cheers, Andrew
On Mon, Jun 30, 2014 at 10:25 AM, François Le Lay notifications@github.com wrote:
I finally managed to run it on Mac OS X 10.9.3 (Mavericks), Node v0.10.29, npm 1.4.16, node-gyp 0.13.1. I have XCode installed and but nevertheless downloaded and installed the Command Line Developer Tools from apple dev website.
The compilation error is due to util.h (which declares openpty and forkpty) not being properly included in required pty.js module. So I cloned https://github.com/chjj/pty.js and edited src/unix/pty.cc at line 39 to replace #include
by #include "/usr/include/util.h" in the conditional inclusions header. Then still in pty.js : npm install nan npm install extend make
then I copied the entire pty.js directory under gfx.js/mode_modules.
sudo luarocks make
At this point the compile error should be gone. When launching luajit -lgxf.go I had a few critical lua dependencies missing, I installed them with luarocks :
sudo luarocks install dok sudo luarocks install lua-cjson
Finally ran luajit -lgfx.go which actually loads the torch repl and launches the server on port 8000. Nice!
— Reply to this email directly or view it on GitHub https://github.com/clementfarabet/gfx.js/issues/17#issuecomment-47537686 .
Andrew Hartnett Couzin Lab 508-566-2206 ahartnet@princeton.edu
Awesome, thanks for the fix. @soumith , we should patch both our repo and do a pr to them. I'm not tracking their changes actually, it's been a while since I merged from their repo.
I'm new to Torch. This may help others in my position, I followed your instructions almost exactly but I had to change some things:
The make
command inside pty.js/ fails for me with make[1]: node-waf: No such file or directory
so I replaced it with a npm install
then I copied the whole thing to .gfx.js/node_modules and then I continued as you described.
One more thing, I didn't need to manually install dok nor lua-cjson
I'm using Mac OS X 10.9.3
Thanks, @lelayf. I was having the exact same issue and your fix worked.
combining responsed from @lelayf and @royalstream :
cd /tmp
git clone https://github.com/chjj/pty.js.git
cd pty.js
vim src/unix/pty.cc
replace #include <util.h>
by #include "/usr/include/util.h"
on line 39
make
npm install
cp -r pty.js ~/.gfx.js/node_modules/.
cd ~/.gfx.js
luarocks make
luajit -lgfx.go
dear god thank you all for this!
Hi,
I've tried all the workarounds in this thread and in https://github.com/atom/terminal/issues/28#issuecomment-39405908 but cannot get this to work.
Is there going to be an update to the installation to fix these issues instead of trying to hack it to make it work?
Thanks
@ronanmoynihan what error are you seeing?
can you try the solution in clementfarabet/gfx.js#22?
export DYLD_FALLBACK_LIBRARY_PATH=/usr/local/lib/
Hi @vzhong, Yes I tried that. I'm getting the error below when running the command luarocks install https://raw.github.com/clementfarabet/gfx.js/master/gfx.js-scm-0.rockspec
2 errors generated.
make: *\ [Release/obj.target/pty/src/unix/pty.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: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 Darwin 13.3.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /private/tmp/luarocks_gfx.js-scm-0-7549/gfx.js/node_modules/pty.js
gyp ERR! node -v v0.10.30
gyp ERR! node-gyp -v v0.13.1
gyp ERR! not ok
When trying to run luajit -lgfx.go I get the error below.
module.js:340
throw err;
^
Error: Cannot find module '../build/Release/pty.node'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.
@vzhong Sorry I got it working now. I went over the steps again from @royalstream and @lelayf
Thanks.
Thank you for this wonderful solution! @lelayf
@lelayf thanks for the fix again, I made a PR to gfx.js that would not need people to manually hack this patch up.
I still have the same problem. I tried all the workarounds mentioned above but nothing to do :
When trying to run luajit -lgfx.go
module.js:338
throw err;
^
Error: Cannot find module '../build/Release/pty.node'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:278:25)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object.
@ronanmoynihan How did you do? I've got your same error. Nor make neither npm install works in pty.js for me.
Can you just try installing gfx again? I fixed it. Just do luarocks install gfx.js
Still not working. (on Mac OSX)
I guess I had some problem with nodejs maybe. I've just reinstalled everything with this simple script I wrote, putting together all the scripts for torch and gfx installation. http://pastebin.com/X0fuvDbx (for Ubuntu) @vishalchandra It just reinstalls torch deps, luajit, etc and then it does " luarocks install gfx.js" just like soumith said. For me it's ok, it works perfectly. thanks @soumith
The issue for me was whether command line tools for Xcode are installed or not. Resolved once I did that.
Hi, is this still an issue in 2016? I am trying to use the t-SNE visualisation here https://github.com/clementfarabet/manifold, which requires gfx.js
luarocks install gfx.js gives me a bunch of errors (& warnings).
Will I be better off using qlua instead of gfx? Thanks a lot for any suggestions.
firstly, ==> installing Node.js dependencies npm WARN package.json gfx.js@0.2.10 No license field.
secondly,
CXX(target) Release/obj.target/fse/fsevents.o
In file included from ../fsevents.cc:6:
../node_modules/nan/nan.h:339:13: error: no member named 'New' in 'v8::String'
return _NAN_ERROR(v8::Exception::Error, errmsg);
^~~~~~~~~~~~
../node_modules/nan/nan.h:319:50: note: expanded from macro '_NAN_ERROR'
~~~~~~~~~~~~^
../node_modules/nan/nan.h:343:5: error: no member named 'ThrowException' in namespace 'v8' _NAN_THROW_ERROR(v8::Exception::Error, errmsg);
....
ending with
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *\ [Release/obj.target/fse/fsevents.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: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 Darwin 14.5.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 /private/tmp/luarocks_gfx.js-scm-0-9672/gfx.js/node_modules/fsevents
gyp ERR! node -v v4.4.0
gyp ERR! node-gyp -v v3.3.0
gyp ERR! not ok
thirdly,
14 errors generated.
make: *\ [Release/obj.target/pty/src/unix/pty.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: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 Darwin 14.5.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 /private/tmp/luarocks_gfx.js-scm-0-9672/gfx.js/node_modules/pty.js
gyp ERR! node -v v4.4.0
gyp ERR! node-gyp -v v3.3.0
gyp ERR! not ok
npm WARN optional dep failed, continuing fsevents@0.2.0
and finally, CXX(target) Release/obj.target/bufferutil/src/bufferutil.o npm ERR! Darwin 14.5.0 npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" npm ERR! node v4.4.0 npm ERR! npm v2.14.20 npm ERR! code ELIFECYCLE
npm ERR! pty.js@0.2.4 install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the pty.js@0.2.4 install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the pty.js 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 information on how to open an issue for this project with:
npm ERR! npm bugs pty.js
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR! npm owner ls pty.js
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request: npm ERR! /private/tmp/luarocks_gfx.js-scm-0-9672/gfx.js/npm-debug.log
I tried to install gfx.js with the command " sudo luarocks install https://raw.github.com/clementfarabet/gfx.js/master/gfx.js-scm-0.rockspec " but it returns with errors: ==> installing Node.js dependencies
CXX(target) Release/obj.target/pty/src/unix/pty.o ../src/unix/pty.cc:487:10: error: use of undeclared identifier 'openpty' return openpty(amaster, aslave, name, (termios )termp, (winsize )winp); ^ ../src/unix/pty.cc:533:10: error: use of undeclared identifier 'forkpty' return forkpty(amaster, name, (termios )termp, (winsize )winp); ^ 2 errors generated. make: * [Release/obj.target/pty/src/unix/pty.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:267:23) gyp ERR! stack at ChildProcess.emit (events.js:98:17) gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:809:12) gyp ERR! System Darwin 13.2.0 gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /private/tmp/luarocks_gfx.js-scm-0-1414/gfx.js/node_modules/pty.js gyp ERR! node -v v0.10.29 gyp ERR! node-gyp -v v0.13.1 gyp ERR! not okCXX(target) Release/obj.target/bufferutil/src/bufferutil.o SOLINK_MODULE(target) Release/bufferutil.node SOLINK_MODULE(target) Release/bufferutil.node: Finished CXX(target) Release/obj.target/validation/src/validation.o SOLINK_MODULE(target) Release/validation.node SOLINK_MODULE(target) Release/validation.node: Finished npm ERR! pty.js@0.2.4 install:
node-gyp rebuild
npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the pty.js@0.2.4 install script. npm ERR! This is most likely a problem with the pty.js 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 pty.js npm ERR! There is likely additional logging output above. npm ERR! System Darwin 13.2.0 npm ERR! command "node" "/usr/local/bin/npm" "install" npm ERR! cwd /private/tmp/luarocks_gfx.js-scm-0-1414/gfx.js npm ERR! node -v v0.10.29 npm ERR! npm -v 1.4.14 npm ERR! code ELIFECYCLE npm ERR! npm ERR! Additional logging details can be found in: npm ERR! /private/tmp/luarocks_gfx.js-scm-0-1414/gfx.js/npm-debug.log npm ERR! not ok code 0 ==> installing static resources into ~/.gfx.js/ ==> installing torch client into /usr/local/bin/../share/lua/5.1/gfx/It was able to work but today when I tried to reinstalled it, it failed...
Thanks!