node-portaudio icon indicating copy to clipboard operation
node-portaudio copied to clipboard

Failed to compile

Open sebpiq opened this issue 12 years ago • 7 comments

The library failed to compile on my ubuntu 12.10. I got the following message : http://pastebin.com/dqH7W8ZL

I don't think I miss any of the portaudio packages needed (I've installed pretty much everything, dev library and so on ...)

sebpiq avatar Jan 18 '13 17:01 sebpiq

I've updated the README with some troubleshooting tips https://github.com/joeferner/node-portaudio/commit/413e7a836401418335f1d642ad7011ad51755da3 Let me know if those help.

joeferner avatar Jan 18 '13 19:01 joeferner

Thanks, building portaudio from source did the trick, however when trying to run your example I get : http://pastebin.com/KzjUwKji

So looks like something didn't work after all... any idea ?

sebpiq avatar Jan 18 '13 23:01 sebpiq

Try running

sudo ldconfig

If that doesn't help try

sudo updatedb
locate libportaudio.so

Should be in /usr/lib/x86_64-linux-gnu/ or something like that. Then run...

nm -D /usr/lib/x86_64-linux-gnu/libportaudio.so | grep Pa_

This should list the functions available in the libportaudio.so file. You should see Pa_GetDefaultOutputDevice.

joeferner avatar Jan 22 '13 14:01 joeferner

No ... that didn't help. I have portaudio installed in several places, but all of them contain Pa_GetDefaultOutputDevice. Is there a way to check-out which shared object the node library is trying to use ?

sebpiq avatar Jan 22 '13 17:01 sebpiq

You can try running

ldd ./build/Release/portAudio.node

and see if anything is unresolved.

joeferner avatar Jan 22 '13 17:01 joeferner

this gives me this :

linux-gate.so.1 =>  (0xb76f1000)
libstdc++.so.6 => /usr/lib/i386-linux-gnu/libstdc++.so.6 (0xb75e6000)
libpthread.so.0 => /lib/i386-linux-gnu/libpthread.so.0 (0xb75cb000)
libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xb7420000)
libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0xb73f4000)
/lib/ld-linux.so.2 (0xb76f2000)
libgcc_s.so.1 => /lib/i386-linux-gnu/libgcc_s.so.1 (0xb73d6000)

Which I don't really understand ... anything unresolved ?

sebpiq avatar Jan 30 '13 16:01 sebpiq

If one of the .so files could not be found it would show as unresolved instead of a path.

This is what I get...

linux-vdso.so.1 =>  (0x00007fffa21ff000)                                                                                                             
libportaudio.so.2 => /usr/lib/x86_64-linux-gnu/libportaudio.so.2 (0x00007f06ac4a6000)                                                                
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f06ac1a3000)                                                                      
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f06abde3000)
libasound.so.2 => /usr/lib/x86_64-linux-gnu/libasound.so.2 (0x00007f06abaf9000)
libjack.so.0 => /usr/lib/x86_64-linux-gnu/libjack.so.0 (0x00007f06ab8a0000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f06ab697000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f06ab39b000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f06ab17e000)
/lib64/ld-linux-x86-64.so.2 (0x00007f06ac8ff000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f06aaf67000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f06aad63000)

The key difference being that I don't see libportaudio in your list.

I'm running out of ideas.

You can see if you can get any portaudio files compiling. Toss this in a .cpp file...

#include <portaudio.h>
#include <stdio.h>

int main() {
  int i = Pa_GetVersion();
  printf("%d\n", i);
}

Then run

gcc test.cpp -lportaudio

What's interesting is that if I run

gcc -lportaudio test.cpp

I get a similar error. undefined reference to `Pa_GetVersion'.

I'm curious if your node-gyp is doing something similar.

If I go to my node-portaudio/build directory and run

make -n

I get the following

printf '%s\n' '  SOLINK_MODULE(target) Release/obj.target/portAudio.node'
mkdir -p "Release/obj.target/" "./Release/.deps/Release/obj.target/"
flock ./Release/linker.lock g++ -shared -pthread -rdynamic -m64  -Wl,-soname=portAudio.node -o Release/obj.target/portAudio.node -Wl,--start-group Release/obj.target/portAudio/src/binding.o Release/obj.target/portAudio/src/nodePortAudio.o -Wl,--end-group -lportaudio
echo "  SOLINK_MODULE(target) Release/obj.target/portAudio.node: Finished"
printf '%s\n' 'cmd_Release/obj.target/portAudio.node := flock ./Release/linker.lock g++ -shared -pthread -rdynamic -m64  -Wl,-soname=portAudio.node -o Release/obj.target/portAudio.node -Wl,--start-group Release/obj.target/portAudio/src/binding.o Release/obj.target/portAudio/src/nodePortAudio.o -Wl,--end-group -lportaudio' > ./Release/.deps/Release/obj.target/portAudio.node.d
printf '%s\n' '  COPY Release/portAudio.node'
mkdir -p "Release/" "./Release/.deps/Release/"
ln -f "Release/obj.target/portAudio.node" "Release/portAudio.node" 2>/dev/null || (rm -rf "Release/portAudio.node" && cp -af "Release/obj.target/portAudio.node" "Release/portAudio.node")
printf '%s\n' 'cmd_Release/portAudio.node := ln -f "Release/obj.target/portAudio.node" "Release/portAudio.node" 2>/dev/null || (rm -rf "Release/portAudio.node" && cp -af "Release/obj.target/portAudio.node" "Release/portAudio.node")' > ./Release/.deps/Release/portAudio.node.d

which works.

I guess you could also try installing the latest node-gyp (sudo npm install node-gyp -g) then run

node-gyp configure build

from the node-portaudio directory.

joeferner avatar Jan 31 '13 20:01 joeferner