RustAudio / rust-portaudio

PortAudio bindings and wrappers for Rust.
MIT License
374 stars 89 forks source link

Failing build on osx with no prior portaudio installation (rust 1.5 nightly) #100

Open yupferris opened 9 years ago

yupferris commented 9 years ago

My understanding is if I don't have a prior portaudio installation on my system, this build should download it and we're good to go. That doesn't seem to be the case, however. This is my full terminal log from download to build:

macferris:projects yupferris$ git clone git@github.com:jeremyletang/rust-portaudio.git
Cloning into 'rust-portaudio'...
remote: Counting objects: 1174, done.
remote: Total 1174 (delta 0), reused 0 (delta 0), pack-reused 1174
Receiving objects: 100% (1174/1174), 1010.41 KiB | 1.01 MiB/s, done.
Resolving deltas: 100% (691/691), done.
Checking connectivity... done.
macferris:projects yupferris$ cd rust-portaudio/
macferris:rust-portaudio yupferris$ cargo build
    Updating registry `https://github.com/rust-lang/crates.io-index`
   Compiling libc v0.1.10
   Compiling bitflags v0.3.2
   Compiling pkg-config v0.3.6
   Compiling num v0.1.27
   Compiling portaudio v0.4.17 (file:///Users/yupferris/dev/projects/rust-portaudio)
src/pa/mod.rs:368:64: 368:88 warning: the parameter type `O` may not live long enough [E0310]
src/pa/mod.rs:368                 let user_callback = Box::new(UserCallback { f: user_callback_fn_wrapper });
                                                                                 ^~~~~~~~~~~~~~~~~~~~~~~~
src/pa/mod.rs:368:64: 368:88 help: run `rustc --explain E0310` to see a detailed explanation
src/pa/mod.rs:368:64: 368:88 help: consider adding an explicit lifetime bound `O: 'static`...
src/pa/mod.rs:368:64: 368:88 note: this warning results from recent bug fixes and clarifications; it will become a HARD ERROR in the next release. See RFC 1214 for details.
src/pa/mod.rs:368                 let user_callback = Box::new(UserCallback { f: user_callback_fn_wrapper });
                                                                                 ^~~~~~~~~~~~~~~~~~~~~~~~
src/pa/mod.rs:368:64: 368:88 note: ...so that the type `[closure@src/pa/mod.rs:346:57: 367:18 num_input_channels:u32, num_output_channels:u32, callback:Box<for<'r, 'r, 'r> core::ops::FnMut(&'r [I], &'r mut [O], u32, &'r pa::types::StreamCallbackTimeInfo, pa::types::stream_callback_flags::StreamCallbackFlags) -> pa::types::StreamCallbackResult>]` will meet its required lifetime bounds
src/pa/mod.rs:368                 let user_callback = Box::new(UserCallback { f: user_callback_fn_wrapper });
                                                                                 ^~~~~~~~~~~~~~~~~~~~~~~~
src/pa/mod.rs:368:64: 368:88 warning: the parameter type `I` may not live long enough [E0310]
src/pa/mod.rs:368                 let user_callback = Box::new(UserCallback { f: user_callback_fn_wrapper });
                                                                                 ^~~~~~~~~~~~~~~~~~~~~~~~
src/pa/mod.rs:368:64: 368:88 help: run `rustc --explain E0310` to see a detailed explanation
src/pa/mod.rs:368:64: 368:88 help: consider adding an explicit lifetime bound `I: 'static`...
src/pa/mod.rs:368:64: 368:88 note: this warning results from recent bug fixes and clarifications; it will become a HARD ERROR in the next release. See RFC 1214 for details.
src/pa/mod.rs:368                 let user_callback = Box::new(UserCallback { f: user_callback_fn_wrapper });
                                                                                 ^~~~~~~~~~~~~~~~~~~~~~~~
src/pa/mod.rs:368:64: 368:88 note: ...so that the type `[closure@src/pa/mod.rs:346:57: 367:18 num_input_channels:u32, num_output_channels:u32, callback:Box<for<'r, 'r, 'r> core::ops::FnMut(&'r [I], &'r mut [O], u32, &'r pa::types::StreamCallbackTimeInfo, pa::types::stream_callback_flags::StreamCallbackFlags) -> pa::types::StreamCallbackResult>]` will meet its required lifetime bounds
src/pa/mod.rs:368                 let user_callback = Box::new(UserCallback { f: user_callback_fn_wrapper });
                                                                                 ^~~~~~~~~~~~~~~~~~~~~~~~
src/pa/mod.rs:482:64: 482:88 warning: the parameter type `O` may not live long enough [E0310]
src/pa/mod.rs:482                 let user_callback = Box::new(UserCallback { f: user_callback_fn_wrapper });
                                                                                 ^~~~~~~~~~~~~~~~~~~~~~~~
src/pa/mod.rs:482:64: 482:88 help: run `rustc --explain E0310` to see a detailed explanation
src/pa/mod.rs:482:64: 482:88 help: consider adding an explicit lifetime bound `O: 'static`...
src/pa/mod.rs:482:64: 482:88 note: this warning results from recent bug fixes and clarifications; it will become a HARD ERROR in the next release. See RFC 1214 for details.
src/pa/mod.rs:482                 let user_callback = Box::new(UserCallback { f: user_callback_fn_wrapper });
                                                                                 ^~~~~~~~~~~~~~~~~~~~~~~~
src/pa/mod.rs:482:64: 482:88 note: ...so that the type `[closure@src/pa/mod.rs:461:57: 481:18 num_input_channels:i32, num_output_channels:i32, callback:Box<for<'r, 'r, 'r> core::ops::FnMut(&'r [I], &'r mut [O], u32, &'r pa::types::StreamCallbackTimeInfo, pa::types::stream_callback_flags::StreamCallbackFlags) -> pa::types::StreamCallbackResult>]` will meet its required lifetime bounds
src/pa/mod.rs:482                 let user_callback = Box::new(UserCallback { f: user_callback_fn_wrapper });
                                                                                 ^~~~~~~~~~~~~~~~~~~~~~~~
src/pa/mod.rs:482:64: 482:88 warning: the parameter type `I` may not live long enough [E0310]
src/pa/mod.rs:482                 let user_callback = Box::new(UserCallback { f: user_callback_fn_wrapper });
                                                                                 ^~~~~~~~~~~~~~~~~~~~~~~~
src/pa/mod.rs:482:64: 482:88 help: run `rustc --explain E0310` to see a detailed explanation
src/pa/mod.rs:482:64: 482:88 help: consider adding an explicit lifetime bound `I: 'static`...
src/pa/mod.rs:482:64: 482:88 note: this warning results from recent bug fixes and clarifications; it will become a HARD ERROR in the next release. See RFC 1214 for details.
src/pa/mod.rs:482                 let user_callback = Box::new(UserCallback { f: user_callback_fn_wrapper });
                                                                                 ^~~~~~~~~~~~~~~~~~~~~~~~
src/pa/mod.rs:482:64: 482:88 note: ...so that the type `[closure@src/pa/mod.rs:461:57: 481:18 num_input_channels:i32, num_output_channels:i32, callback:Box<for<'r, 'r, 'r> core::ops::FnMut(&'r [I], &'r mut [O], u32, &'r pa::types::StreamCallbackTimeInfo, pa::types::stream_callback_flags::StreamCallbackFlags) -> pa::types::StreamCallbackResult>]` will meet its required lifetime bounds
src/pa/mod.rs:482                 let user_callback = Box::new(UserCallback { f: user_callback_fn_wrapper });
                                                                                 ^~~~~~~~~~~~~~~~~~~~~~~~
<bitflags macros>:7:27: 8:19 warning: missing documentation for a constant
<bitflags macros>:7 $ ( # [ $ Flag_attr ] ) * pub const $ Flag : $ BitFlags = $ BitFlags {
<bitflags macros>:8 bits : $ value } ; ) + impl :: std:: fmt:: Debug for $ BitFlags {
<bitflags macros>:90:1: 92:63 note: in this expansion of bitflags! (defined in <bitflags macros>)
src/pa/types.rs:84:5: 108:6 note: in this expansion of bitflags! (defined in <bitflags macros>)
src/lib.rs:54:9: 54:21 note: lint level defined here
src/lib.rs:54 #![warn(missing_docs)]
                      ^~~~~~~~~~~~
<bitflags macros>:7:27: 8:19 warning: missing documentation for a constant
<bitflags macros>:7 $ ( # [ $ Flag_attr ] ) * pub const $ Flag : $ BitFlags = $ BitFlags {
<bitflags macros>:8 bits : $ value } ; ) + impl :: std:: fmt:: Debug for $ BitFlags {
<bitflags macros>:90:1: 92:63 note: in this expansion of bitflags! (defined in <bitflags macros>)
src/pa/types.rs:84:5: 108:6 note: in this expansion of bitflags! (defined in <bitflags macros>)
src/lib.rs:54:9: 54:21 note: lint level defined here
src/lib.rs:54 #![warn(missing_docs)]
                      ^~~~~~~~~~~~
<bitflags macros>:7:27: 8:19 warning: missing documentation for a constant
<bitflags macros>:7 $ ( # [ $ Flag_attr ] ) * pub const $ Flag : $ BitFlags = $ BitFlags {
<bitflags macros>:8 bits : $ value } ; ) + impl :: std:: fmt:: Debug for $ BitFlags {
<bitflags macros>:90:1: 92:63 note: in this expansion of bitflags! (defined in <bitflags macros>)
src/pa/types.rs:84:5: 108:6 note: in this expansion of bitflags! (defined in <bitflags macros>)
src/lib.rs:54:9: 54:21 note: lint level defined here
src/lib.rs:54 #![warn(missing_docs)]
                      ^~~~~~~~~~~~
<bitflags macros>:7:27: 8:19 warning: missing documentation for a constant
<bitflags macros>:7 $ ( # [ $ Flag_attr ] ) * pub const $ Flag : $ BitFlags = $ BitFlags {
<bitflags macros>:8 bits : $ value } ; ) + impl :: std:: fmt:: Debug for $ BitFlags {
<bitflags macros>:90:1: 92:63 note: in this expansion of bitflags! (defined in <bitflags macros>)
src/pa/types.rs:84:5: 108:6 note: in this expansion of bitflags! (defined in <bitflags macros>)
src/lib.rs:54:9: 54:21 note: lint level defined here
src/lib.rs:54 #![warn(missing_docs)]
                      ^~~~~~~~~~~~
<bitflags macros>:7:27: 8:19 warning: missing documentation for a constant
<bitflags macros>:7 $ ( # [ $ Flag_attr ] ) * pub const $ Flag : $ BitFlags = $ BitFlags {
<bitflags macros>:8 bits : $ value } ; ) + impl :: std:: fmt:: Debug for $ BitFlags {
<bitflags macros>:90:1: 92:63 note: in this expansion of bitflags! (defined in <bitflags macros>)
src/pa/types.rs:84:5: 108:6 note: in this expansion of bitflags! (defined in <bitflags macros>)
src/lib.rs:54:9: 54:21 note: lint level defined here
src/lib.rs:54 #![warn(missing_docs)]
                      ^~~~~~~~~~~~
<bitflags macros>:7:27: 8:19 warning: missing documentation for a constant
<bitflags macros>:7 $ ( # [ $ Flag_attr ] ) * pub const $ Flag : $ BitFlags = $ BitFlags {
<bitflags macros>:8 bits : $ value } ; ) + impl :: std:: fmt:: Debug for $ BitFlags {
<bitflags macros>:90:1: 92:63 note: in this expansion of bitflags! (defined in <bitflags macros>)
src/pa/types.rs:84:5: 108:6 note: in this expansion of bitflags! (defined in <bitflags macros>)
src/lib.rs:54:9: 54:21 note: lint level defined here
src/lib.rs:54 #![warn(missing_docs)]
                      ^~~~~~~~~~~~
<bitflags macros>:7:27: 8:19 warning: missing documentation for a constant
<bitflags macros>:7 $ ( # [ $ Flag_attr ] ) * pub const $ Flag : $ BitFlags = $ BitFlags {
<bitflags macros>:8 bits : $ value } ; ) + impl :: std:: fmt:: Debug for $ BitFlags {
<bitflags macros>:90:1: 92:63 note: in this expansion of bitflags! (defined in <bitflags macros>)
src/pa/types.rs:140:5: 173:6 note: in this expansion of bitflags! (defined in <bitflags macros>)
src/lib.rs:54:9: 54:21 note: lint level defined here
src/lib.rs:54 #![warn(missing_docs)]
                      ^~~~~~~~~~~~
<bitflags macros>:7:27: 8:19 warning: missing documentation for a constant
<bitflags macros>:7 $ ( # [ $ Flag_attr ] ) * pub const $ Flag : $ BitFlags = $ BitFlags {
<bitflags macros>:8 bits : $ value } ; ) + impl :: std:: fmt:: Debug for $ BitFlags {
<bitflags macros>:90:1: 92:63 note: in this expansion of bitflags! (defined in <bitflags macros>)
src/pa/types.rs:140:5: 173:6 note: in this expansion of bitflags! (defined in <bitflags macros>)
src/lib.rs:54:9: 54:21 note: lint level defined here
src/lib.rs:54 #![warn(missing_docs)]
                      ^~~~~~~~~~~~
<bitflags macros>:7:27: 8:19 warning: missing documentation for a constant
<bitflags macros>:7 $ ( # [ $ Flag_attr ] ) * pub const $ Flag : $ BitFlags = $ BitFlags {
<bitflags macros>:8 bits : $ value } ; ) + impl :: std:: fmt:: Debug for $ BitFlags {
<bitflags macros>:90:1: 92:63 note: in this expansion of bitflags! (defined in <bitflags macros>)
src/pa/types.rs:140:5: 173:6 note: in this expansion of bitflags! (defined in <bitflags macros>)
src/lib.rs:54:9: 54:21 note: lint level defined here
src/lib.rs:54 #![warn(missing_docs)]
                      ^~~~~~~~~~~~
<bitflags macros>:7:27: 8:19 warning: missing documentation for a constant
<bitflags macros>:7 $ ( # [ $ Flag_attr ] ) * pub const $ Flag : $ BitFlags = $ BitFlags {
<bitflags macros>:8 bits : $ value } ; ) + impl :: std:: fmt:: Debug for $ BitFlags {
<bitflags macros>:90:1: 92:63 note: in this expansion of bitflags! (defined in <bitflags macros>)
src/pa/types.rs:140:5: 173:6 note: in this expansion of bitflags! (defined in <bitflags macros>)
src/lib.rs:54:9: 54:21 note: lint level defined here
src/lib.rs:54 #![warn(missing_docs)]
                      ^~~~~~~~~~~~
<bitflags macros>:7:27: 8:19 warning: missing documentation for a constant
<bitflags macros>:7 $ ( # [ $ Flag_attr ] ) * pub const $ Flag : $ BitFlags = $ BitFlags {
<bitflags macros>:8 bits : $ value } ; ) + impl :: std:: fmt:: Debug for $ BitFlags {
<bitflags macros>:90:1: 92:63 note: in this expansion of bitflags! (defined in <bitflags macros>)
src/pa/types.rs:140:5: 173:6 note: in this expansion of bitflags! (defined in <bitflags macros>)
src/lib.rs:54:9: 54:21 note: lint level defined here
src/lib.rs:54 #![warn(missing_docs)]
                      ^~~~~~~~~~~~
<bitflags macros>:7:27: 8:19 warning: missing documentation for a constant
<bitflags macros>:7 $ ( # [ $ Flag_attr ] ) * pub const $ Flag : $ BitFlags = $ BitFlags {
<bitflags macros>:8 bits : $ value } ; ) + impl :: std:: fmt:: Debug for $ BitFlags {
<bitflags macros>:90:1: 92:63 note: in this expansion of bitflags! (defined in <bitflags macros>)
src/pa/types.rs:140:5: 173:6 note: in this expansion of bitflags! (defined in <bitflags macros>)
src/lib.rs:54:9: 54:21 note: lint level defined here
src/lib.rs:54 #![warn(missing_docs)]
                      ^~~~~~~~~~~~
error: could not find native static library `portaudio`, perhaps an -L flag is missing?
Could not compile `portaudio`.

To learn more, run the command again with --verbose.
jlmitch5 commented 8 years ago

+1, on osx as well.

mitchmindtree commented 8 years ago

Hrrmmm interestingly, travis passes on both osx and linux on my sound_stream crate (that depends on portaudio) using this install script - maybe it could be adapted to our build.rs file in order to fix this?

ghost commented 8 years ago

I tried the install script but had the same error.

yupferris commented 8 years ago

I tried the script, and got this error:

configure: error: Couldn't find 10.5, 10.6, 10.7, 10.8 or 10.9 SDK
theovosse commented 8 years ago

~~I'm getting a bunch of warnings and then this:

error: could not find native static library portaudio, perhaps an -L flag is missing? Could not compile portaudio.

I used brew to install portaudio, but the error stays.~~

Forget that. I did a cargo clean, then another build, and it works (with portaudio installed using brew).

zkirill commented 8 years ago

@FLWrd Thank you very much! $ cargo clean, $ brew install portaudio, $ cargo build fixed it.

yupferris commented 8 years ago

Thanks @FLWrd , good to know it will work with portaudio installed! The problem still exists however when it's not preinstalled, which the library advertises should also work.

sm1215 commented 3 years ago

Ran into this issue on OSX today. Tried to naively cargo build without portaudio previously installed. Installed through brew and tried a second cargo build only to see the same error previously listed: could not find native static library portaudio, perhaps an -L flag is missing?.

In any case, running cargo clean after installing portaudio followed by a final cargo build resolved the issue.