Kitt-AI / snowboy

Future versions with model training module will be maintained through a forked version here: https://github.com/seasalt-ai/snowboy
Other
3.08k stars 997 forks source link

NodeJS Module fails to initialize: undefined symbol: cblas_sdot #54

Closed arilotter closed 8 years ago

arilotter commented 8 years ago

Hi, I can't get the current version of snowboy (as published on npm) working. Running examples/node/microphone.js crashes with node: symbol lookup error: .../node_modules/snowboy/lib/node/binding/Release/node-v48-linux-x64/snowboy.node: undefined symbol: cblas_sdot

I've made sure I have libatlas-base-dev installed, but I thought I wouldn't need it because of the precompiled binaries.

Also, manually compiling by running node-pre-gyp --build-from-source doesn't resolve the issue.

I can reproduce this with the following example on Ubuntu 16.04.

const record = require('node-record-lpcm16');
const snowboy = require('snowboy');

const models = new snowboy.Models();
models.add({
  file: 'resources/snowboy.umdl',
  hotwords: 'snowboy'
});

const detector = new snowboy.Detector({
  resource: 'resources/common.res',
  models
});
record.start().pipe(detector);
chenguoguo commented 8 years ago

I just started playing with this module. @nekuz0r and @evancohen might have a better clue.

nekuz0r commented 8 years ago

@arilotter I am looking into it.

arilotter commented 8 years ago

@nekuz0r if you need help reproducing or anything, I can reliably cause the issue to happen!

nekuz0r commented 8 years ago

@arilotter I can reproduce, but i cannot figure out why the cblas library is not linked. ldd on snowboy.node will show the cblas library is not linked, which is not the case on osx. also nm on snowboy.node will reveal the symbol are not statically linked. So clearly there is an issue at link time, still investigating when i have time to.

Flowr-es commented 8 years ago

Had the same issue on my pi, I fixed it with installing these packages:

sudo apt-get install libatlas-base-dev libatlas3gf-base

now it's working like a charm, again thanks to @evancohen and @nekuz0r !