Giter VIP home page Giter VIP logo

sndfile-sys's Introduction

sndfile-sys

Build Status

Rust FFI bindings to libsndfile.

Notes

MSVC toolchain

Starting from version v0.1.2 sndfile-sys can use Vcpkg package manager to search for native libsndfile library (thanks to Vcpkg crate):

  • Install Vcpkg
  • install static libsndfile library (x86|x64): vcpkg install libsndfile:x64-windows-static
  • Add Vcpkg path (e.g. d:\vcpkg) to VCPKG_ROOT environment variable
  • Add -Ctarget-feature=+crt-static to RUSTFLAGS environment variable

This search method affects MSVC toolchain only. You can disable it completely with environment varible VCPKGRS_DISABLE set to 1.

Use can link to dynamic libsndfile (not recommended for MSVC toolchain):

  • Install dynamic libsndfile library with command: vcpkg install libsndfile:x64-windows
  • Delete RUSTFLAGS environment variable
  • Set VCPKGRS_DYNAMIC environment variable to 1

Starting from version v0.2.2 sndfile-sys can use PkgConfig to search for native libsndfile library (thanks to pkg-config-rs crate):

sndfile-sys's People

Contributors

evpobr avatar tuxzz avatar

Stargazers

 avatar t3nzin avatar Tarragon avatar Andrew Prentice avatar

Watchers

James Cloos avatar  avatar

Forkers

ghtyrant tuxzz

sndfile-sys's Issues

Failed to link `sndfile`

error: linking with `cc` failed: exit code: 1
  |
  = note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-L" "/home/tuxzz/.rustup/toolchains/nightly-2020-03-09-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/home/tuxzz/libsndfile-rs/sndfile-sys/target/debug/deps/sndfile_sys-fe0059ee069ecdca.18nu2r13nier77iq.rcgu.o" "/home/tuxzz/libsndfile-rs/sndfile-sys/target/debug/deps/sndfile_sys-fe0059ee069ecdca.1m05ya1fiowi9v65.rcgu.o" "/home/tuxzz/libsndfile-rs/sndfile-sys/target/debug/deps/sndfile_sys-fe0059ee069ecdca.1o66nladdmad7sch.rcgu.o" "/home/tuxzz/libsndfile-rs/sndfile-sys/target/debug/deps/sndfile_sys-fe0059ee069ecdca.1umd185pstbn54sr.rcgu.o" "/home/tuxzz/libsndfile-rs/sndfile-sys/target/debug/deps/sndfile_sys-fe0059ee069ecdca.1ynz6vlik15mtjv.rcgu.o" "/home/tuxzz/libsndfile-rs/sndfile-sys/target/debug/deps/sndfile_sys-fe0059ee069ecdca.27mqb1hm9d5yiflx.rcgu.o" "/home/tuxzz/libsndfile-rs/sndfile-sys/target/debug/deps/sndfile_sys-fe0059ee069ecdca.3vigj5rawlynxr37.rcgu.o" "/home/tuxzz/libsndfile-rs/sndfile-sys/target/debug/deps/sndfile_sys-fe0059ee069ecdca.3xglyjc8zf0zj0bq.rcgu.o" "/home/tuxzz/libsndfile-rs/sndfile-sys/target/debug/deps/sndfile_sys-fe0059ee069ecdca.42jxangwgzsztjlh.rcgu.o" "/home/tuxzz/libsndfile-rs/sndfile-sys/target/debug/deps/sndfile_sys-fe0059ee069ecdca.4egx9mfjaiqo7iw8.rcgu.o" "/home/tuxzz/libsndfile-rs/sndfile-sys/target/debug/deps/sndfile_sys-fe0059ee069ecdca.jfxhqifsm4x2ctr.rcgu.o" "-o" "/home/tuxzz/libsndfile-rs/sndfile-sys/target/debug/deps/sndfile_sys-fe0059ee069ecdca" "/home/tuxzz/libsndfile-rs/sndfile-sys/target/debug/deps/sndfile_sys-fe0059ee069ecdca.2onvywhtyq0r1v8x.rcgu.o" "-Wl,--gc-sections" "-pie" "-Wl,-zrelro" "-Wl,-znow" "-nodefaultlibs" "-L" "/home/tuxzz/libsndfile-rs/sndfile-sys/target/debug/deps" "-L" "/home/tuxzz/.rustup/toolchains/nightly-2020-03-09-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "/home/tuxzz/.rustup/toolchains/nightly-2020-03-09-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libtest-1b57f6c3b53116f9.rlib" "/home/tuxzz/.rustup/toolchains/nightly-2020-03-09-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libterm-86aa0771e8cd9e2a.rlib" "/home/tuxzz/.rustup/toolchains/nightly-2020-03-09-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libgetopts-0d5b4f875fdd83fd.rlib" "/home/tuxzz/.rustup/toolchains/nightly-2020-03-09-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunicode_width-d671b300a5386349.rlib" "/home/tuxzz/.rustup/toolchains/nightly-2020-03-09-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_std-cf1de0060a67e135.rlib" "/home/tuxzz/libsndfile-rs/sndfile-sys/target/debug/deps/liblibc-e31e1d4767bf7785.rlib" "-Wl,--start-group" "/home/tuxzz/.rustup/toolchains/nightly-2020-03-09-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-11511aed690f2c93.rlib" "/home/tuxzz/.rustup/toolchains/nightly-2020-03-09-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-3087937e3435cd36.rlib" "/home/tuxzz/.rustup/toolchains/nightly-2020-03-09-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-4bfc0674f0e6d7c9.rlib" "/home/tuxzz/.rustup/toolchains/nightly-2020-03-09-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-c997dadb52e4a592.rlib" "/home/tuxzz/.rustup/toolchains/nightly-2020-03-09-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libbacktrace-4639ab9d9b7ff1e5.rlib" "/home/tuxzz/.rustup/toolchains/nightly-2020-03-09-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libbacktrace_sys-03a4b2e4d6df8b0f.rlib" "/home/tuxzz/.rustup/toolchains/nightly-2020-03-09-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-4ac9597f7e9c643d.rlib" "/home/tuxzz/.rustup/toolchains/nightly-2020-03-09-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-83a257afa5db78cd.rlib" "/home/tuxzz/.rustup/toolchains/nightly-2020-03-09-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-f2874247c8ce183b.rlib" "/home/tuxzz/.rustup/toolchains/nightly-2020-03-09-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-b5ab644d9db91ae4.rlib" "/home/tuxzz/.rustup/toolchains/nightly-2020-03-09-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-76919a4aea2efc5e.rlib" "/home/tuxzz/.rustup/toolchains/nightly-2020-03-09-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-0cca7c72a501dcdd.rlib" "/home/tuxzz/.rustup/toolchains/nightly-2020-03-09-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-53add92393666e06.rlib" "-Wl,--end-group" "/home/tuxzz/.rustup/toolchains/nightly-2020-03-09-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-8e3a0691bec6d2b2.rlib" "-Wl,-Bdynamic" "-lutil" "-ldl" "-lutil" "-ldl" "-lrt" "-lpthread" "-lgcc_s" "-lc" "-lm" "-lrt" "-lpthread" "-lutil" "-lutil"
  = note: /usr/bin/ld: /home/tuxzz/libsndfile-rs/sndfile-sys/target/debug/deps/sndfile_sys-fe0059ee069ecdca.18nu2r13nier77iq.rcgu.o: in function `sndfile_sys::test::test_link':
          /home/tuxzz/libsndfile-rs/sndfile-sys/src/test.rs:5: undefined reference to `sf_error'
          collect2: Error:ld returns 1
          

error: aborting due to previous error

error: could not compile `sndfile-sys`.

To learn more, run the command again with --verbose.

System: Archlinux
libsndfile: 1.0.28-3
Rust toolchain: nightly-2020-03-09-x86_64-unknown-linux-gnu

PR is coming.

pkg-config changes needed on ARM Macs

Homebrew on ARM Macs now uses /opt/homebrew/ instead of /usr/local as its default installation path. This causes builds with sndfile to fail as libsndfile can't be found outside of /usr/local.

The change to using pkg-config to search for libraries in e46f1a9 allows the library to be found as expected under /opt/homebrew, but I notice that it hasn't been published yet. Any chance of getting a release with this change?

Thanks for the handy library 🙏

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.