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

i386 architecture #32

Closed
Martin-Luther opened this issue Feb 2, 2013 · 6 comments
Closed

i386 architecture #32

Martin-Luther opened this issue Feb 2, 2013 · 6 comments

Comments

@Martin-Luther
Copy link

Hello,

I can't run this module.

The installation went fine ('install' finished successfully (1.542s)).

This is what i get while trying to launch my node app.js

node_modules/node-threads/build/release/threads_a_gogo.node: mach-o, but wrong architecture.

I'm running nodejs v0.8.18 on a Mac Os X (Mountain Lion)

Regards.

@Martin-Luther
Copy link
Author

Ok... now it's working...
I've commented 5 lines in : /usr/local/lib/node/wafadmin/Tools/node_addon.py


 if Options.platform == 'darwin':
    #if 'i386' in Utils.cmd_output(['file', nodebin]):
      #conf.env.append_value('CPPFLAGS_NODE', ['-arch', 'i386'])
      #conf.env.append_value('CXXFLAGS_NODE', ['-arch', 'i386'])
      #conf.env.append_value('LINKFLAGS', ['-arch', 'i386'])
      #conf.env['DEST_CPU'] = 'i386'
    conf.check_tool('osx')

Is it bad ?

@Martin-Luther Martin-Luther reopened this Feb 2, 2013
@xk
Copy link
Owner

xk commented Feb 5, 2013

It works fine on my Mac:

$ uname -a
Darwin unibodyPuma.local 12.2.0 Darwin Kernel Version 12.2.0: Sat Aug 25 00:48:52 PDT 2012; root:xnu-2050.18.24~1/RELEASE_X86_64 x86_64

$ node -v
v0.8.18

$ npm install threads_a_gogo
...
'install' finished successfully (0.717s)
threads_a_gogo@0.1.5 node_modules/threads_a_gogo

$ node node_modules/threads_a_gogo/test/test00_run_once_and_destroy.js
Using 1 threads
[0] -> 0.15345639153383672
THREADS PER SECOND -> 250.0
BYE !

?

@Martin-Luther
Copy link
Author

Not on mine unless i remove a few lines in "node_addon.py"
$ uname -a
Darwin MacBook-Air-de-Martin.local 12.2.0 Darwin Kernel Version 12.2.0: Sat Aug 25 00:48:52 PDT 2012; root:xnu-2050.18.24~1/RELEASE_X86_64 x86_64

$ node -v
v0.8.18

Then after install

$ npm install threads_a_gogo
...
Waf: Leaving directory `/Workflow/www/geena-project.com/framework.geena-project.com/gna-server/node_modules/threads_a_gogo/build'
'install' finished successfully (1.128s)
threads_a_gogo@0.1.5 node_modules/threads_a_gogo

$ node_modules/threads_a_gogo/test/test00_run_once_and_destroy.js

node_modules/threads_a_gogo/test/test00_run_once_and_destroy.js: line 3: syntax error near unexpected token (' node_modules/threads_a_gogo/test/test00_run_once_and_destroy.js: line 3:var Threads= require('threads_a_gogo');'

$ node node_modules/threads_a_gogo/test/test00_run_once_and_destroy.js

module.js:485
process.dlopen(filename, module.exports);
^
Error: dlopen(/Workflow/www/geena-project.com/framework.geena-project.com/gna-server/node_modules/threads_a_gogo/build/release/threads_a_gogo.node, 1): no suitable image found. Did find:
/Workflow/www/geena-project.com/framework.geena-project.com/gna-server/node_modules/threads_a_gogo/build/release/threads_a_gogo.node: mach-o, but wrong architecture
at Object.Module._extensions..node (module.js:485:11)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:362:17)
at require (module.js:378:17)
at Object. (/Workflow/www/geena-project.com/framework.geena-project.com/gna-server/node_modules/threads_a_gogo/test/test00_run_once_and_destroy.js:3:14)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)

BYE !
?

@xk
Copy link
Owner

xk commented Feb 5, 2013

Different architectures? See what does this give you:

$ file which node
/Users/jorge/JAVASCRIPT/binarios/bin/node: Mach-O 64-bit executable x86_64

$ file /Users/jorge/.node_libraries/threads_a_gogo.node
/Users/jorge/.node_libraries/threads_a_gogo.node: Mach-O 64-bit bundle x86_64

How did you install node?

@xk
Copy link
Owner

xk commented Feb 6, 2013

There's no sane way to fix this in my wscript. The node core guys won't fix node-waf. So what you did is fine, or, you have to build node as a flat binary (not universal) so that node-waf will then choose the right architecture instead of blindly defaulting to i386.

Cheers,

@xk xk closed this as completed Feb 6, 2013
@xk
Copy link
Owner

xk commented Feb 6, 2013

Related issue nodejs/node-v0.x-archive#3633

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

No branches or pull requests

2 participants