Open thisconnect opened 11 years ago
With newest node-libpd, node.js and installing v8 through homebrew sh build-macos.sh
returns:
ld: warning: in /usr/local/lib/libv8.dylib, file was built for i386 which is not the architecture being linked (x86_64)
Undefined symbols:
"v8::String::New(char const*, int)", referenced from:
run(v8::Arguments const&) in ccmiwcRJ.o
pdprint(char const*)in ccmiwcRJ.o
"_ev_verify", referenced from:
_ev_loop_verify in ccmiwcRJ.o
"v8::Value::NumberValue() const", referenced from:
add_float(v8::Arguments const&) in ccmiwcRJ.o
"_ev_loop_destroy", referenced from:
_ev_default_destroy in ccmiwcRJ.o
"v8::Undefined()", referenced from:
v8::Arguments::operator[](int) constin ccmiwcRJ.o
"v8::Value::ToString() const", referenced from:
openfile(v8::Arguments const&) in ccmiwcRJ.o
finish_message(v8::Arguments const&) in ccmiwcRJ.o
finish_message(v8::Arguments const&) in ccmiwcRJ.o
"_ev_depth", referenced from:
_ev_loop_depth in ccmiwcRJ.o
"_ev_default_loop", referenced from:
_ev_default_fork in ccmiwcRJ.o
_ev_default_destroy in ccmiwcRJ.o
"_ev_break", referenced from:
_ev_unloop in ccmiwcRJ.o
"_ev_default_loop_ptr", referenced from:
_ev_default_loop_uc_ in ccmiwcRJ.o
"v8::FunctionTemplate::GetFunction()", referenced from:
void node::SetMethod<v8::Handle<v8::Object> >(v8::Handle<v8::Object>, char const*, v8::Handle<v8::Value> (*)(v8::Arguments const&))in ccmiwcRJ.o
"v8::FunctionTemplate::New(v8::Handle<v8::Value> (*)(v8::Arguments const&), v8::Handle<v8::Value>, v8::Handle<v8::Signature>)", referenced from:
void node::SetMethod<v8::Handle<v8::Object> >(v8::Handle<v8::Object>, char const*, v8::Handle<v8::Value> (*)(v8::Arguments const&))in ccmiwcRJ.o
"v8::String::AsciiValue::AsciiValue(v8::Handle<v8::Value>)", referenced from:
openfile(v8::Arguments const&) in ccmiwcRJ.o
finish_message(v8::Arguments const&) in ccmiwcRJ.o
finish_message(v8::Arguments const&) in ccmiwcRJ.o
"_ev_run", referenced from:
_ev_loop in ccmiwcRJ.o
"_ev_iteration", referenced from:
_ev_loop_count in ccmiwcRJ.o
"v8::String::AsciiValue::~AsciiValue()", referenced from:
openfile(v8::Arguments const&) in ccmiwcRJ.o
openfile(v8::Arguments const&) in ccmiwcRJ.o
finish_message(v8::Arguments const&) in ccmiwcRJ.o
finish_message(v8::Arguments const&) in ccmiwcRJ.o
finish_message(v8::Arguments const&) in ccmiwcRJ.o
finish_message(v8::Arguments const&) in ccmiwcRJ.o
"v8::String::NewSymbol(char const*, int)", referenced from:
void node::SetMethod<v8::Handle<v8::Object> >(v8::Handle<v8::Object>, char const*, v8::Handle<v8::Value> (*)(v8::Arguments const&))in ccmiwcRJ.o
"v8::Object::Set(v8::Handle<v8::Value>, v8::Handle<v8::Value>, v8::PropertyAttribute)", referenced from:
void node::SetMethod<v8::Handle<v8::Object> >(v8::Handle<v8::Object>, char const*, v8::Handle<v8::Value> (*)(v8::Arguments const&))in ccmiwcRJ.o
"_ev_loop_fork", referenced from:
_ev_default_fork in ccmiwcRJ.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
This probably means I should compile libpd myself for i386, could you give me any pointers did you just do make
?
I got some help of a friend, to recap this is my setup nodejs v0.8.20 and v8 installed with homebrew. libpd from upstream https://github.com/libpd/libpd compiled with make
.
Could this be the conflict?
file /usr/local/lib/libv8.dylib
/usr/local/lib/libv8.dylib: Mach-O dynamically linked shared library i386
file libpd/libs/libpd.dylib
libs/libpd.dylib: Mach-O universal binary with 2 architectures
libs/libpd.dylib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64
libs/libpd.dylib (for architecture i386): Mach-O dynamically linked shared library i386
Note my self compiled libpd is a universal binary with x86_64 and i386
Yeah having a 32 bit version of libv8 will be a problem. I have a similar configuration to you where I installed libv8 and node using homebrew and built libpd from source.
$ file /usr/local/lib/libv8.dylib
/usr/local/lib/libv8.dylib: Mach-O 64-bit dynamically linked shared library x86_64
$ v8
V8 version 3.15.11 [sample shell]
$ node -v
v0.8.16
You could try reinstalling libv8 using --universal to see if there is a universal binary for v8.
$ brew uninstall v8
$ brew install v8 --universal
I must warn you that node-libpd builds on osx but segfaults running the simplest test. I haven't had time to figure out what I'm doing wrong with respect to string handling in v8. Either something changed or I relied on some behavior that wasn't 100% correct to start with. This project definitely needs some love to be very useful.
I just did the following, and ended up with the same x86_64 version of v8
$ brew uninstall v8
Uninstalling /usr/local/Cellar/v8/3.9.24...
$ brew install v8 --universal
==> Downloading https://github.com/v8/v8/archive/3.15.11.tar.gz
######################################################################## 100.0%
==> make dependencies
==> make native -j4 library=shared snapshot=on console=readline
/usr/local/Cellar/v8/3.15.11: 21 files, 19M, built in 119 seconds
$ file /usr/local/lib/libv8.dylib
/usr/local/lib/libv8.dylib: Mach-O 64-bit dynamically linked shared library x86_64
Hope this helps you.