Hello everyone!
I am trying to build cryptominisat-rs
for a pet project of mine. I try to use this shell.nix
let
pkgs = import <nixpkgs> {};
in
pkgs.mkShell {
name = "cryptominisat-rs";
propagatedBuildInputs = with pkgs; [
gmp
zlib
boost
python3
rustup
cargo-make
cargo
which gccStdenv
cmake xxd
pkg-config
];
src = null;
shellHook = with pkgs; ''
export LD_LIBRARY_PATH=${boost.out}/lib:${openssl.out}/lib:${gmp}/lib:${zlib}/lib:${ncurses}/lib
'';
}
as you might guess, I just added packages the more desperate I became, since the error just never really changed:
Compiling cryptominisat v5.6.6 (/home/munin/Documents/rust/cryptominisat-rs)
error: failed to run custom build command for `cryptominisat v5.6.6 (/home/munin/Documents/rust/cryptominisat-rs)`
Caused by:
process didn't exit successfully: `/home/munin/Documents/rust/cryptominisat-rs/target/release/build/cryptominisat-a38ea13b46b7e179/build-script-build` (exit code: 101)
--- stdout
running: "cmake" "/home/munin/Documents/rust/cryptominisat-rs/cryptominisat" "-DCMAKE_BUILD_TYPE=Release" "-DSTATICCOMPILE=ON" "-DENABLE_PYTHON_INTERFACE=OFF" "-DONLY_SIMPLE=ON" "-DNOZLIB=ON" "-DNOM4RI=ON" "-DSTATS=OFF" "-DNOVALGRIND=ON" "-DENABLE_TESTING=OFF" "-DCMAKE_INSTALL_PREFIX=/home/munin/Documents/rust/cryptominisat-rs/target/release/build/cryptominisat-605884bbc1bc72de/out" "-DCMAKE_C_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64" "-DCMAKE_C_COMPILER=/nix/store/q289knj5k3j6mgbqq40ajgvlqnd46mi8-gcc-wrapper-9.3.0/bin/gcc" "-DCMAKE_CXX_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64" "-DCMAKE_CXX_COMPILER=/nix/store/q289knj5k3j6mgbqq40ajgvlqnd46mi8-gcc-wrapper-9.3.0/bin/g++" "-DCMAKE_ASM_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64" "-DCMAKE_ASM_COMPILER=/nix/store/q289knj5k3j6mgbqq40ajgvlqnd46mi8-gcc-wrapper-9.3.0/bin/gcc"
-- LIB directory is 'lib'
-- BIN directory is 'bin'
-- Doing a Release build
-- build type is Release
-- Compiling for static library use
-- GIT hash found:
-- PROJECT_VERSION: 5.6.8
-- PROJECT_VERSION_MAJOR: 5
-- PROJECT_VERSION_MINOR: 6
-- PROJECT_VERSION_PATCH: 8
-- Not compiling detailed statistics. The system is faster without them
-- Cannot find help2man, not creating manpage
-- All defines at startup: -DNDEBUG -D_FORTIFY_SOURCE=0
-- In case your Python interpreter is not found, or a wrong one is found, please set it with '-DPYTHON_EXECUTABLE:FILEPATH=your path here'
-- Python 3 -- PYTHON_EXECUTABLE=/nix/store/0yhk4sk4x9s9hsrf3p1skbfy1pwd1rbf-python3-3.8.5/bin/python
-- Python 3 -- PYTHON_LIBRARIES=/nix/store/0yhk4sk4x9s9hsrf3p1skbfy1pwd1rbf-python3-3.8.5/lib/libpython3.8.so
-- Python 3 -- PYTHON_INCLUDE_DIRS=/nix/store/0yhk4sk4x9s9hsrf3p1skbfy1pwd1rbf-python3-3.8.5/include/python3.8
-- Python 3 -- PYTHONLIBS_VERSION_STRING=3.8.5
-- Only building executable with few command-line options because the boost program_options library were not available
-- Performing Test HAVE_FLAG_-Wformat=2
-- Performing Test HAVE_FLAG_-Wformat=2 - Failed
-- Configuring done
-- Generating done
-- Build files have been written to: /home/munin/Documents/rust/cryptominisat-rs/target/release/build/cryptominisat-605884bbc1bc72de/out/build
running: "cmake" "--build" "." "--target" "install" "--config" "Release" "--"
Copying cryptominisat_c.h to /home/munin/Documents/rust/cryptominisat-rs/target/release/build/cryptominisat-605884bbc1bc72de/out/build/include/cryptominisat5
[ 93%] Built target cryptominisat5
Copying cryptominisat.h to /home/munin/Documents/rust/cryptominisat-rs/target/release/build/cryptominisat-605884bbc1bc72de/out/build/include/cryptominisat5
[ 95%] Linking CXX executable ../cryptominisat5_simple
Copying solvertypesmini.h to /home/munin/Documents/rust/cryptominisat-rs/target/release/build/cryptominisat-605884bbc1bc72de/out/build/include/cryptominisat5
Copying dimacsparser.h to /home/munin/Documents/rust/cryptominisat-rs/target/release/build/cryptominisat-605884bbc1bc72de/out/build/include/cryptominisat5
Copying streambuffer.h to /home/munin/Documents/rust/cryptominisat-rs/target/release/build/cryptominisat-605884bbc1bc72de/out/build/include/cryptominisat5
[ 95%] Built target CopyPublicHeaders
--- stderr
CMake Warning at CMakeLists.txt:753 (message):
Testing is disabled
/nix/store/10nmk0mlhy9nf3lfrq8q07k0510bgnnf-binutils-2.31.1/bin/ld: cannot find -ldl
/nix/store/10nmk0mlhy9nf3lfrq8q07k0510bgnnf-binutils-2.31.1/bin/ld: cannot find -lpthread
/nix/store/10nmk0mlhy9nf3lfrq8q07k0510bgnnf-binutils-2.31.1/bin/ld: cannot find -lm
/nix/store/10nmk0mlhy9nf3lfrq8q07k0510bgnnf-binutils-2.31.1/bin/ld: cannot find -lpthread
/nix/store/10nmk0mlhy9nf3lfrq8q07k0510bgnnf-binutils-2.31.1/bin/ld: cannot find -lc
collect2: error: ld returned 1 exit status
make[2]: *** [cmsat5-src/CMakeFiles/cryptominisat5_simple-bin.dir/build.make:119: cryptominisat5_simple] Error 1
make[1]: *** [CMakeFiles/Makefile2:199: cmsat5-src/CMakeFiles/cryptominisat5_simple-bin.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:149: all] Error 2
thread 'main' panicked at '
command did not execute successfully, got: exit code: 2
build script failed, must exit now', /home/munin/.cargo/registry/src/github.com-1ecc6299db9ec823/cmake-0.1.45/src/lib.rs:894:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
So the issue seemingly is, something is not linked correctly, and I dont have any idea what I could do to debug, fix or work-around with. However, the offending cryptominisat
can be compiled just fine in a shell such as nix-shell -p gcc boost zlib python3 cmake pkg-config
.
Any tips on how to learn to fix such issues?