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

OS X Lion installation #9

Open
vladignatyev opened this issue Aug 31, 2012 · 2 comments
Open

OS X Lion installation #9

vladignatyev opened this issue Aug 31, 2012 · 2 comments

Comments

@vladignatyev
Copy link

Problem description

After installing ArcusNode on Mac OS X Lion system, it won't run and raise following error:

$ node service.js 
module.js:485
  process.dlopen(filename, module.exports);
          ^
Error: dlopen(/Users/ignatev/Documents/Coding/OpenSource/ArcusNode/ArcusNode/build/Release/rtmfp.node, 1): no suitable image found.  Did find:
    /Users/ignatev/Documents/Coding/OpenSource/ArcusNode/ArcusNode/build/Release/rtmfp.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.<anonymous> (/Users/ignatev/Documents/Coding/OpenSource/ArcusNode/ArcusNode/lib/packet.js:20:13)
    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)

How to reproduce

  1. Install nodejs 0.8.8 from sources (configure --prefix=/usr/local/bin to prevent "Checking for node prefix: not found" during building of ArcusNode).
  2. Install node-waf 1.5.16 from sources too.
  3. Download ArcusNode and run node-waf configure build:
$ node-waf configure build
Checking for program g++ or c++          : /usr/bin/g++ 
Checking for program cpp                 : /usr/bin/cpp 
Checking for program ar                  : /usr/bin/ar 
Checking for program ranlib              : /usr/bin/ranlib 
Checking for g++                         : ok  
Checking for node path                   : ok /usr/local/bin 
Checking for node prefix                 : ok /usr/local 
'configure' finished successfully (0.048s)
Waf: Entering directory `/Users/ignatev/Documents/Coding/OpenSource/ArcusNode/ArcusNode/build'
Waf: Leaving directory `/Users/ignatev/Documents/Coding/OpenSource/ArcusNode/ArcusNode/build'
'build' finished successfully (0.015s)
@vladignatyev
Copy link
Author

$ lipo -info build/Release/rtmfp.node 
Non-fat file: build/Release/rtmfp.node is architecture: i386

Sure, an architecture is wrong. Then, I'm tried to change CXXFLAGS in wscript like this: rtmfp.cxxflags = ["-m64", "-g", "-D_FILE_OFFSET_BITS=64", "-D_LARGEFILE_SOURCE", "-Wall", "-L/usr/lib", "-lssl"]

and got:

i686-apple-darwin11-llvm-g++-4.2: -lssl: linker input file unused because linking not done
i686-apple-darwin11-llvm-g++-4.2: -lssl: linker input file unused because linking not done
[3/4] cxx_link: build/Release/src/rtmfp_1.o -> build/Release/rtmfp.node
[4/4] cxx_link: build/Release/src/keyexchange_2.o -> build/Release/keyexchange.node
ld: warning: ignoring file Release/src/rtmfp_1.o, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: ignoring file Release/src/keyexchange_2.o, file was built for unsupported file format which is not the architecture being linked (i386)

@skozin
Copy link

skozin commented Nov 18, 2012

The problem is in node-waf wrapper: nodejs/node-v0.x-archive#3633. I think the simpliest solution for now is to build the extension manually. I've written this simple makefile and it worked for me under OSX Lion:

CC=g++
CFLAGS=-g -fPIC -DPIC -D_LARGEFILE_SOURCE -m64 -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -DEV_MULTIPLICITY=0 -I/usr/local/include/node -c
LFLAGS=-flat_namespace -undefined suppress -bundle -L/usr/local/lib

all: init rtmfp.node keyexchange.node after

init:
    mkdir -p build/Release

rtmfp.o: src/rtmfp.cc
    $(CC) $(CFLAGS) src/rtmfp.cc -o build/rtmfp.o

keyexchange.o: src/keyexchange.cc
    $(CC) $(CFLAGS) src/keyexchange.cc -o build/keyexchange.o

rtmfp.node: rtmfp.o
    $(CC) $(LFLAGS) build/rtmfp.o -o build/Release/rtmfp.node

keyexchange.node: keyexchange.o
    $(CC) $(LFLAGS) build/keyexchange.o -o build/Release/keyexchange.node

after:
    rm build/rtmfp.o
    rm build/keyexchange.o

clean:
    rm -rf build

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