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

Failed to compile #2

Open
sebpiq opened this issue Jan 18, 2013 · 7 comments
Open

Failed to compile #2

sebpiq opened this issue Jan 18, 2013 · 7 comments

Comments

@sebpiq
Copy link

sebpiq commented Jan 18, 2013

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 ...)

@joeferner
Copy link
Owner

I've updated the README with some troubleshooting tips 413e7a8 Let me know if those help.

@sebpiq
Copy link
Author

sebpiq commented Jan 18, 2013

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 ?

@joeferner
Copy link
Owner

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.

@sebpiq
Copy link
Author

sebpiq commented Jan 22, 2013

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 ?

@joeferner
Copy link
Owner

You can try running

ldd ./build/Release/portAudio.node

and see if anything is unresolved.

@sebpiq
Copy link
Author

sebpiq commented Jan 30, 2013

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 ?

@joeferner
Copy link
Owner

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.

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