Rantanen / node-opus

Opus bindings for Node.js
MIT License
79 stars 32 forks source link

Installation error on OSX #62

Closed thijstriemstra closed 6 years ago

thijstriemstra commented 6 years ago
npm install node-opus

Results in:

[...]

  CC(target) Release/obj.target/libopus/deps/opus/silk/float/solve_LS_FLP.o
  CC(target) Release/obj.target/libopus/deps/opus/silk/float/warped_autocorrelation_FLP.o
  CC(target) Release/obj.target/libopus/deps/opus/silk/float/wrappers_FLP.o
  CC(target) Release/obj.target/libopus/deps/opus/silk/float/autocorrelation_FLP.o
  CC(target) Release/obj.target/libopus/deps/opus/silk/float/burg_modified_FLP.o
  CC(target) Release/obj.target/libopus/deps/opus/silk/float/bwexpander_FLP.o
  CC(target) Release/obj.target/libopus/deps/opus/silk/float/energy_FLP.o
  CC(target) Release/obj.target/libopus/deps/opus/silk/float/inner_product_FLP.o
  CC(target) Release/obj.target/libopus/deps/opus/silk/float/k2a_FLP.o
  CC(target) Release/obj.target/libopus/deps/opus/silk/float/levinsondurbin_FLP.o
  CC(target) Release/obj.target/libopus/deps/opus/silk/float/LPC_inv_pred_gain_FLP.o
  CC(target) Release/obj.target/libopus/deps/opus/silk/float/pitch_analysis_core_FLP.o
  CC(target) Release/obj.target/libopus/deps/opus/silk/float/scale_copy_vector_FLP.o
  CC(target) Release/obj.target/libopus/deps/opus/silk/float/scale_vector_FLP.o
  CC(target) Release/obj.target/libopus/deps/opus/silk/float/schur_FLP.o
  CC(target) Release/obj.target/libopus/deps/opus/silk/float/sort_FLP.o
  LIBTOOL-STATIC Release/opus.a
Usage: /usr/local/bin/libtool [OPTION]... [MODE-ARG]...
Try 'libtool --help' for more information.
libtool:   error: unrecognised option: '-static'
make: *** [Release/opus.a] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at emitTwo (events.js:126:13)
gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Darwin 15.6.0

System info reported by libtool:

When reporting a bug, please describe a test case to reproduce it and
include the following information:

       host-triplet:   x86_64-apple-darwin15.6.0
       shell:          /bin/sh
       compiler:       gcc
       compiler flags: -g -O2
       linker:         /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld (gnu? no)
       version:        libtool (GNU libtool) 2.4.6
       automake:       automake (GNU automake) 1.15.1
       autoconf:       autoconf (GNU Autoconf) 2.69
Rantanen commented 6 years ago

Nothing node-opus can fix here.

You need a working libtool to compile Node.js native components. I don't know where that comes from on OSX. You might want to google for libtool unrecognized option static.

thijstriemstra commented 6 years ago

Thanks for the feedback. Looking into that now..

$ ls -l /usr/local/bin/libtool
-rwxr-xr-x  1 root  wheel  365786 Dec 14  2017 /usr/local/bin/libtool
$ ls -l /usr/bin/libtool
-rwxr-xr-x  1 root  wheel  18176 Jul  9  2016 /usr/bin/libtool
thijstriemstra commented 6 years ago

As long as you use the /usr/bin/libtool it'll install fine. So this workaround fixed it for me:

$ export PATH=/usr/bin/:$PATH
$ npm install node-opus -D