Closed swestrich closed 8 years ago
You can use 'ldd' binary to debug dynamic library loading. Most likely you do not export LD_LIBRARY_PATH properly.
I'm confused, my LD_LIBRARY_PATH looks fine when I echo it, how could I not be exporting it properly?
In pocketsphinx.target.mk I have this:
# This file is generated by gyp; do not edit.
TOOLSET := target
TARGET := PocketSphinx
### Rules for action "swig_ps":
quiet_cmd_binding_gyp_PocketSphinx_target_swig_ps = ACTION Creating pocketsphinx wrapper $@
cmd_binding_gyp_PocketSphinx_target_swig_ps = LD_LIBRARY_PATH=$(builddir)/lib.host:$(builddir)/lib.target:$$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; cd $(srcdir)/.; swig -I/usr/local/share/sphinxbase/swig -javascript -node "-DV8_VERSION=0x032872" -o ps.cpp /usr/local/share/pocketsphinx/swig/pocketsphinx.i
Does that look good to you?
This is the output of ldd, it looks good to me, can you see anything wrong?
:~/workspace/cms/node_modules/pocketsphinx/build/Release (master) $ ldd PocketSphinx.node
linux-vdso.so.1 => (0x00007ffea30b4000)
libpocketsphinx.so.3 => /usr/local/lib/libpocketsphinx.so.3 (0x00007fba08da3000)
libsphinxbase.so.3 => /usr/local/lib/libsphinxbase.so.3 (0x00007fba08b54000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fba0883f000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fba0847a000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fba08174000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fba07f55000)
/lib64/ld-linux-x86-64.so.2 (0x0000563f9dfed000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fba07d3f000)
Maybe you override it in node somewhere
Instead of using LD_LIBRARY_PATH you can add /usr/local/lib to /etc/ld.so.conf
Tried that, no difference. I just don't understand, and this is very frustrating. When I try running pocketsphinx_continuous from command line it works. Removed the library and pocketsphinx_continuous stopped working as expected reporting the library was missing.
The only thing I can think of now is that my node server doesn't have read or execution permissions on that path. If this is the case I'm sorry I wasted your time. Do you think that could be the case?
Maybe a permission. You can run under strace to debug.
Found out that it must be a cloud9 issue. Running the server directly with 'node app.js' works like a charm. Pressing the run in the ide does not. Strange beyond belief, I wish I had not wasted so long on something so trivial. I'll investigate what they are doing on the run command.
Actually I think it must therefore be a permissions issue between me running it in the console and the ide having less permissions. Just a guess though.
Ok, great
Let me know if you have other issues
yeah :) thanks for your time.
Instead of using LD_LIBRARY_PATH you can add /usr/local/lib to /etc/ld.so.conf
If you take this path, don't forget to reconfigure with sudo ldconfig
I just don't understand why I am getting this error.
When I try to load node-pocketshinx I get the above error on this line:
This is my LD path
And here is what it contains.
Not sure if this is an issue or me just being stupid but I've spent quite a while trying everything I could think of already.