Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not compile on linux (?) #3

Open
Garfield100 opened this issue Dec 22, 2023 · 4 comments
Open

Does not compile on linux (?) #3

Garfield100 opened this issue Dec 22, 2023 · 4 comments

Comments

@Garfield100
Copy link

Garfield100 commented Dec 22, 2023

Hello,

if I cargo init a fresh Rust repo, cargo add lsl, and then cargo build, I get the following error both on my fedora machine and on my debian server (works great on windows though):

Error
garfield@lasagne:~/projects/rust/lsltest$ cargo build
   Compiling lsl-sys v0.1.1
error: failed to run custom build command for `lsl-sys v0.1.1`
note: To improve backtraces for build dependencies, set the CARGO_PROFILE_DEV_BUILD_OVERRIDE_DEBUG=true environment variable to enable debug information generation.

Caused by:
  process didn't exit successfully: `/home/garfield/projects/rust/lsltest/target/debug/build/lsl-sys-d2a6095d1609182d/build-script-build` (exit status: 101)
  --- stdout
  CMAKE_TOOLCHAIN_FILE_x86_64-unknown-linux-gnu = None
  CMAKE_TOOLCHAIN_FILE_x86_64_unknown_linux_gnu = None
  HOST_CMAKE_TOOLCHAIN_FILE = None
  CMAKE_TOOLCHAIN_FILE = None
  CMAKE_GENERATOR_x86_64-unknown-linux-gnu = None
  CMAKE_GENERATOR_x86_64_unknown_linux_gnu = None
  HOST_CMAKE_GENERATOR = None
  CMAKE_GENERATOR = None
  CMAKE_PREFIX_PATH_x86_64-unknown-linux-gnu = None
  CMAKE_PREFIX_PATH_x86_64_unknown_linux_gnu = None
  HOST_CMAKE_PREFIX_PATH = None
  CMAKE_PREFIX_PATH = None
  CMAKE_x86_64-unknown-linux-gnu = None
  CMAKE_x86_64_unknown_linux_gnu = None
  HOST_CMAKE = None
  CMAKE = None
  running: cd "/home/garfield/projects/rust/lsltest/target/debug/build/lsl-sys-7990ee826447bbba/out/build" && CMAKE_PREFIX_PATH="" "cmake" "/home/garfield/.cargo/registry/src/index.crates.io-6f17d22bba15001f/lsl-sys-0.1.1/liblsl" "-DLSL_NO_FANCY_LIBNAME=ON" "-DLSL_BUILD_STATIC=ON" "-DCMAKE_INSTALL_PREFIX=/home/garfield/projects/rust/lsltest/target/debug/build/lsl-sys-7990ee826447bbba/out" "-DCMAKE_C_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64" "-DCMAKE_C_COMPILER=/usr/bin/cc" "-DCMAKE_CXX_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64" "-DCMAKE_CXX_COMPILER=/usr/bin/c++" "-DCMAKE_ASM_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64" "-DCMAKE_ASM_COMPILER=/usr/bin/cc" "-DCMAKE_BUILD_TYPE=Debug"
  -- Git version information: /
  -- Included LSL CMake helpers, rev. 12, /home/garfield/.cargo/registry/src/index.crates.io-6f17d22bba15001f/lsl-sys-0.1.1/liblsl/cmake
  -- Installing Components: liblsl
  -- Configuring done
  -- Generating done
  -- Build files have been written to: /home/garfield/projects/rust/lsltest/target/debug/build/lsl-sys-7990ee826447bbba/out/build
  running: cd "/home/garfield/projects/rust/lsltest/target/debug/build/lsl-sys-7990ee826447bbba/out/build" && MAKEFLAGS="-j --jobserver-fds=7,8 --jobserver-auth=7,8" "cmake" "--build" "." "--target" "install" "--config" "Debug"
  [  2%] Building CXX object CMakeFiles/lslboost.dir/lslboost/libs/thread/src/pthread/thread.cpp.o

  --- stderr
  fatal: not a git repository (or any of the parent directories): .git
  fatal: not a git repository (or any of the parent directories): .git
  In file included from /usr/include/pthread.h:33,
                   from /usr/include/x86_64-linux-gnu/c++/12/bits/gthr-default.h:35,
                   from /usr/include/x86_64-linux-gnu/c++/12/bits/gthr.h:148,
                   from /usr/include/c++/12/ext/atomicity.h:35,
                   from /usr/include/c++/12/bits/ios_base.h:39,
                   from /usr/include/c++/12/ios:42,
                   from /usr/include/c++/12/ostream:38,
                   from /home/garfield/.cargo/registry/src/index.crates.io-6f17d22bba15001f/lsl-sys-0.1.1/liblsl/lslboost/boost/system/error_code.hpp:17,
                   from /home/garfield/.cargo/registry/src/index.crates.io-6f17d22bba15001f/lsl-sys-0.1.1/liblsl/lslboost/boost/system/system_error.hpp:11,
                   from /home/garfield/.cargo/registry/src/index.crates.io-6f17d22bba15001f/lsl-sys-0.1.1/liblsl/lslboost/boost/thread/exceptions.hpp:22,
                   from /home/garfield/.cargo/registry/src/index.crates.io-6f17d22bba15001f/lsl-sys-0.1.1/liblsl/lslboost/boost/thread/pthread/thread_data.hpp:10,
                   from /home/garfield/.cargo/registry/src/index.crates.io-6f17d22bba15001f/lsl-sys-0.1.1/liblsl/lslboost/boost/thread/thread_only.hpp:17,
                   from /home/garfield/.cargo/registry/src/index.crates.io-6f17d22bba15001f/lsl-sys-0.1.1/liblsl/lslboost/libs/thread/src/pthread/thread.cpp:11:
  /home/garfield/.cargo/registry/src/index.crates.io-6f17d22bba15001f/lsl-sys-0.1.1/liblsl/lslboost/boost/thread/pthread/thread_data.hpp:60:5: error: missing binary operator before token "("
     60 | #if PTHREAD_STACK_MIN > 0
        |     ^~~~~~~~~~~~~~~~~
  In file included from /home/garfield/.cargo/registry/src/index.crates.io-6f17d22bba15001f/lsl-sys-0.1.1/liblsl/lslboost/boost/functional/hash.hpp:6,
                   from /home/garfield/.cargo/registry/src/index.crates.io-6f17d22bba15001f/lsl-sys-0.1.1/liblsl/lslboost/boost/thread/detail/thread.hpp:38,
                   from /home/garfield/.cargo/registry/src/index.crates.io-6f17d22bba15001f/lsl-sys-0.1.1/liblsl/lslboost/boost/thread/thread_only.hpp:22:
  /home/garfield/.cargo/registry/src/index.crates.io-6f17d22bba15001f/lsl-sys-0.1.1/liblsl/lslboost/boost/container_hash/hash.hpp:130:33: warning: ‘template<class _Arg, class _Result> struct std::unary_function’ is deprecated [-Wdeprecated-declarations]
    130 |         struct hash_base : std::unary_function<T, std::size_t> {};
        |                                 ^~~~~~~~~~~~~~
  In file included from /usr/include/c++/12/string:48,
                   from /home/garfield/.cargo/registry/src/index.crates.io-6f17d22bba15001f/lsl-sys-0.1.1/liblsl/lslboost/boost/thread/exceptions.hpp:20:
  /usr/include/c++/12/bits/stl_function.h:117:12: note: declared here
    117 |     struct unary_function
        |            ^~~~~~~~~~~~~~
  gmake[2]: *** [CMakeFiles/lslboost.dir/build.make:272: CMakeFiles/lslboost.dir/lslboost/libs/thread/src/pthread/thread.cpp.o] Error 1
  gmake[1]: *** [CMakeFiles/Makefile2:119: CMakeFiles/lslboost.dir/all] Error 2
  gmake: *** [Makefile:156: all] Error 2
  thread 'main' panicked at /home/garfield/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cmake-0.1.50/src/lib.rs:1098:5:

  command did not execute successfully, got: exit status: 2

  build script failed, must exit now
  stack backtrace:
     0: rust_begin_unwind
               at /rustc/a28077b28a02b92985b3a3faecf92813155f1ea1/library/std/src/panicking.rs:597:5
     1: core::panicking::panic_fmt
               at /rustc/a28077b28a02b92985b3a3faecf92813155f1ea1/library/core/src/panicking.rs:72:14
     2: cmake::fail
     3: cmake::run
     4: cmake::Config::build
     5: build_script_build::build_liblsl
     6: build_script_build::main
     7: core::ops::function::FnOnce::call_once
  note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Here some versions and other system details:

Debian 12 server

cmake version 3.25.1
gcc (Debian 12.2.0-14) 12.2.0
Kernel: 6.1.0-16-amd64
Package: build-essential Version: 12.9

Fedora 39 machine

cmake version 3.28.1
gcc (GCC) 13.2.1 20231205 (Red Hat 13.2.1-6)
Kernel: 6.6.6-200.fc39.x86_64

What I've tried:

  • setting the GIT_DISCOVERY_ACROSS_FILESYSTEM environment variable. Yielded a slightly different error. If you believe this to be relevant I can post it.
  • cloning andn building liblsl itself to see if that works on its own, it does.

Am I doing something wrong or is this an issue with the lsl/lsl-sys crates? I unfortunately do not understand much of the error, and there are several weird parts (fatal: not a git repository? missing operator when it works on windows?).
I've also installed the liblsl shared library but judging by lsl-sys' build.rs this makes no difference (yet?).
Ideas?

@gabrielpgagne
Copy link

Hi, in my project, I had the same issue. So instead I did: cargo add --git https://github.com/labstreaminglayer/liblsl-rust lsl and now it builds fine. Haven't tested the library yet, though.

@Kaszanas
Copy link

Kaszanas commented Nov 26, 2024

I have similar issue.

This was the solution for me:

Hi, in my project, I had the same issue. So instead I did: cargo add --git https://github.com/labstreaminglayer/liblsl-rust lsl and now it builds fine. Haven't tested the library yet, though.

But I think this is some very unfortunate behavior from this dependency.

@Garfield100
Copy link
Author

Garfield100 commented Nov 27, 2024

PR #2 fixed this issue a while ago but it appears this new change was never published to the crates.io registry. The last update there was 4 years ago (versions on crates.io) while #2 was merged 9 months ago.
@chkothe would you mind bumping the version as necessary and publishing it to crates.io?

@Kaszanas
Copy link

PR #2 fixed this issue a while ago but it appears this new change was never published to the crates.io registry. The last update there was 4 years ago (versions on crates.io) while #2 was merged 9 months ago.
@chkothe would you mind bumping the version as necessary and publishing it?

Yeah version bump would be great 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants