conundrumer / audioscope

audio visualizers true to the sound
GNU General Public License v3.0
257 stars 19 forks source link

build failure on debian #18

Closed khimaros closed 1 year ago

khimaros commented 3 years ago

this is an incredible project!

i'm having some difficulty with the initial build on debian bullseye and debian buster with the rust stable toolchain.

i've manually installed the latest stable of libportaudio system wide as suggested:

Package: libportaudio2
Version: 19.6.0-1.1

Package: libportaudiocpp0
Version: 19.6.0-1.1

I am able to build rust-portaudio from Git (which appears to be 0.7.0):

$ git clone https://github.com/RustAudio/rust-portaudio
$ cd rust-portaudio
$ cargo build --release
[...]
    Finished release [optimized] target(s) in 26.70s

however, while building (linking) audioscope, i receive the following error:

          /usr/bin/ld: /home/user/src/audioscope/target/debug/deps/libportaudio-779a6df6781f5d0f.rlib(pa_jack.o): in function `PaJack_Initialize':
          /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/portaudio-0.7.0/portaudio/src/hostapi/jack/pa_jack.c:800: undefined reference to `jack_client_close'
          /usr/bin/ld: /home/user/src/audioscope/target/debug/deps/libportaudio-779a6df6781f5d0f.rlib(pa_jack.o): in function `BuildDeviceList':
          /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/portaudio-0.7.0/portaudio/src/hostapi/jack/pa_jack.c:617: undefined reference to `jack_port_by_name'
          /usr/bin/ld: /home/user/cargo/registry/src/github.com-1ecc6299db9ec823/portaudio-0.7.0/portaudio/src/hostapi/jack/pa_jack.c:619: undefined reference to `jack_port_get_latency'
          /usr/bin/ld: /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/portaudio-0.7.0/portaudio/src/hostapi/jack/pa_jack.c:596: undefined reference to `jack_port_by_name'
          /usr/bin/ld: /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/portaudio-0.7.0/portaudio/src/hostapi/jack/pa_jack.c:598: undefined reference to `jack_port_get_latency'
[...]

happy to provide any other information you need. thanks for releasing this!

khimaros commented 3 years ago

on debian buster, where libportaudio0=18.1 is available, i'm seeing a different issue which seems related to backtrace-rs:

  = note: /usr/bin/ld: /home/user/audioscope/target/release/deps/libbacktrace-79a7a90134906214.rlib(backtrace-79a7a90134906214.backtrace.buo4lypt-cgu.2.rcgu.o): in function `backtrace::symbolize::libbacktrace::resolve':
          backtrace.buo4lypt-cgu.2:(.text._ZN9backtrace9symbolize12libbacktrace7resolve17hb68923a7654d7c7aE+0x90): undefined reference to `backtrace_pcinfo'
          /usr/bin/ld: backtrace.buo4lypt-cgu.2:(.text._ZN9backtrace9symbolize12libbacktrace7resolve17hb68923a7654d7c7aE+0xb8): undefined reference to `backtrace_syminfo'
          /usr/bin/ld: /home/user/audioscope/target/release/deps/libbacktrace-79a7a90134906214.rlib(backtrace-79a7a90134906214.backtrace.buo4lypt-cgu.7.rcgu.o): in function `std::sync::once::Once::call_once::{{closure}}':
          backtrace.buo4lypt-cgu.7:(.text._ZN3std4sync4once4Once9call_once28_$u7b$$u7b$closure$u7d$$u7d$17h652b61bd3729ac62E+0x30): undefined reference to `backtrace_create_state'
          /usr/bin/ld: /home/user/audioscope/target/release/deps/libbacktrace-79a7a90134906214.rlib(backtrace-79a7a90134906214.backtrace.buo4lypt-cgu.7.rcgu.o): in function `core::ops::function::FnOnce::call_once{{vtable-shim}}':
          backtrace.buo4lypt-cgu.7:(.text._ZN4core3ops8function6FnOnce40call_once$u7b$$u7b$vtable.shim$u7d$$u7d$17hc3c4372b057320e7E+0x30): undefined reference to `backtrace_create_state'
          collect2: error: ld returned 1 exit status

i've tested with a few versions of the rust stable toolchain including:

stable-2020-11-16-armv7-unknown-linux-gnueabihf stable-2018-09-25-armv7-unknown-linux-gnueabihf stable-2020-02-27-armv7-unknown-linux-gnueabihf

khimaros commented 3 years ago

https://github.com/conundrumer/audioscope/pull/19 fixes the build on debian/raspbian buster and possibly others by pulling in the latest version of backtrace-rs and some other transitive deps. the jack linker errors seem to be the same as https://github.com/RustAudio/rust-portaudio/issues/136 which has a workaround in https://github.com/RustAudio/rust-portaudio/issues/153

khimaros commented 1 year ago

i believe this can now be closed since #19 was merged