Skip to content
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

Build Error on OS X 10.9.3 #17

Closed
gushiapi opened this issue Jun 19, 2014 · 27 comments · Fixed by #31
Closed

Build Error on OS X 10.9.3 #17

gushiapi opened this issue Jun 19, 2014 · 27 comments · Fixed by #31

Comments

@gushiapi
Copy link

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

[email protected] install /private/tmp/luarocks_gfx.js-scm-0-1414/gfx.js/node_modules/pty.js
node-gyp rebuild

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 ok

[email protected] install /private/tmp/luarocks_gfx.js-scm-0-1414/gfx.js/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws
(node-gyp rebuild 2> builderror.log) || (exit 0)

CXX(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! [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 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!

@lelayf
Copy link

lelayf commented Jun 27, 2014

Hi Clément, same here for me. Any idea if we should report it to the owner of pty.js as suggested?

@capecodcid
Copy link

I have the same problem as well.

@soumith
Copy link
Contributor

soumith commented Jun 28, 2014

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
atom-archive/terminal#28 (comment)

@capecodcid
Copy link

I have command line tools and still have problems with pty.js

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 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 [email protected]
wrote:

Hey, apparently OSX doesn't ship with the relevant headers, and none of us
noticed because we have XCode Commandline Tools installed.
atom-archive/terminal#28 (comment)
atom-archive/terminal#28 (comment)


Reply to this email directly or view it on GitHub
#17 (comment)
.

Andrew Hartnett
Couzin Lab
508-566-2206
[email protected]

@lelayf
Copy link

lelayf commented Jun 30, 2014

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!

@soumith
Copy link
Contributor

soumith commented Jun 30, 2014

@lelayf thanks a lot for the investigation, I am going to make this more permanent by sending in a PR that uses your tricks.

@soumith
Copy link
Contributor

soumith commented Jun 30, 2014

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.

@capecodcid
Copy link

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 [email protected]
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 <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.

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
#17 (comment)
.

Andrew Hartnett
Couzin Lab
508-566-2206
[email protected]

@clementfarabet
Copy link
Owner

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.

@royalstream
Copy link

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

@jaidevd
Copy link

jaidevd commented Jul 18, 2014

Thanks, @lelayf. I was having the exact same issue and your fix worked.

@renaud
Copy link

renaud commented Aug 15, 2014

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

@ghost
Copy link

ghost commented Aug 16, 2014

dear god thank you all for this!
screen shot 2014-08-15 at 8 13 14 pm

@ronanmoynihan
Copy link

Hi,

I've tried all the workarounds in this thread and in atom-archive/terminal#28 (comment) 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

@vzhong
Copy link

vzhong commented Aug 19, 2014

@ronanmoynihan what error are you seeing?

can you try the solution in #22?

export DYLD_FALLBACK_LIBRARY_PATH=/usr/local/lib/

@ronanmoynihan
Copy link

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

@ronanmoynihan
Copy link

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. (/Users/ronanmoynihan/.gfx.js/node_modules/pty.js/lib/pty.js:10:11)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)

@ronanmoynihan
Copy link

@vzhong Sorry I got it working now. I went over the steps again from @royalstream and @lelayf

Thanks.

@jakezhaojb
Copy link

Thank you for this wonderful solution! @lelayf

@soumith
Copy link
Contributor

soumith commented Oct 13, 2014

@lelayf thanks for the fix again, I made a PR to gfx.js that would not need people to manually hack this patch up.

@synchro--
Copy link

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. (/home/synchro/.gfx.js/node_modules/pty.js/lib/pty.js:10:11)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)

@synchro--
Copy link

@ronanmoynihan How did you do? I've got your same error.
Nor make neither npm install works in pty.js for me.

@soumith
Copy link
Contributor

soumith commented Oct 13, 2014

Can you just try installing gfx again? I fixed it. Just do luarocks install gfx.js

@vishalchandra
Copy link

Still not working. (on Mac OSX)

@synchro--
Copy link

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

@vishalchandra
Copy link

The issue for me was whether command line tools for Xcode are installed or not. Resolved once I did that.

@cbasavaraj
Copy link

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 [email protected] 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'

define _NAN_ERROR(fun, errmsg) fun(v8::String::New(errmsg))

                                 ~~~~~~~~~~~~^

../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 [email protected]

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! [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 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

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

Successfully merging a pull request may close this issue.