grin-miner icon indicating copy to clipboard operation
grin-miner copied to clipboard

Build failed due to cmake call from build.rs

Open cyphersnake opened this issue 2 years ago • 2 comments

error: failed to run custom build command for `cuckoo_miner v4.0.0 (/home/q99/projects/grin-miner/cuckoo-miner)`

Caused by:
  process didn't exit successfully: `/home/q99/projects/grin-miner/target/debug/build/cuckoo_miner-2a431783a83c291c/build-script-build` (exit status: 101)
  --- stdout
  cargo:rerun-if-changed=...
  running: "cmake" "/home/q99/projects/grin-miner/cuckoo-miner/src/cuckoo_sys/plugins" "-DBUILD_CUDA_PLUGINS=TRUE" "-DCMAKE_INSTALL_PREFIX=/home/q99/projects/grin-miner/target/debug/build/cuckoo_miner-88d2ac23c41bb2a6/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"
  -- The C compiler identification is GNU 11.2.0
  -- The CXX compiler identification is GNU 11.2.0
  -- Detecting C compiler ABI info
  -- Detecting C compiler ABI info - done
  -- Check for working C compiler: /usr/bin/cc - skipped
  -- Detecting C compile features
  -- Detecting C compile features - done
  -- Detecting CXX compiler ABI info
  -- Detecting CXX compiler ABI info - done
  -- Check for working CXX compiler: /usr/bin/c++ - skipped
  -- Detecting CXX compile features
  -- Detecting CXX compile features - done
  -- Looking for pthread.h
  -- Looking for pthread.h - found
  -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
  -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
  -- Found Threads: TRUE
  -- Found CUDA Toolkit v11.6
  -- Setting CMAKE_HOST_COMPILER to /opt/cuda/bin/gcc.
  -- CUDA NVCC target flags: -gencode;arch=compute_35,code=sm_35;-gencode;arch=compute_37,code=sm_37;-gencode;arch=compute_50,code=sm_50;-gencode;arch=compute_52,code=sm_52;-gencode;arch=compute_60,code=sm_60;-gencode;arch=compute_61,code=sm_61;-gencode;arch=compute_70,code=sm_70;-gencode;arch=compute_72,code=sm_72;-gencode;arch=compute_75,code=sm_75
  -- Found CUDA Toolkit v11.6
  -- Setting CMAKE_HOST_COMPILER to /opt/cuda/bin/gcc.
  -- CUDA NVCC target flags: -gencode;arch=compute_35,code=sm_35;-gencode;arch=compute_37,code=sm_37;-gencode;arch=compute_50,code=sm_50;-gencode;arch=compute_52,code=sm_52;-gencode;arch=compute_60,code=sm_60;-gencode;arch=compute_61,code=sm_61;-gencode;arch=compute_70,code=sm_70;-gencode;arch=compute_72,code=sm_72;-gencode;arch=compute_75,code=sm_75
  -- Found CUDA Toolkit v11.6
  -- Setting CMAKE_HOST_COMPILER to /opt/cuda/bin/gcc.
  -- CUDA NVCC target flags: -gencode;arch=compute_35,code=sm_35;-gencode;arch=compute_37,code=sm_37;-gencode;arch=compute_50,code=sm_50;-gencode;arch=compute_52,code=sm_52;-gencode;arch=compute_60,code=sm_60;-gencode;arch=compute_61,code=sm_61;-gencode;arch=compute_70,code=sm_70;-gencode;arch=compute_72,code=sm_72;-gencode;arch=compute_75,code=sm_75
  -- Found CUDA Toolkit v11.6
  -- Setting CMAKE_HOST_COMPILER to /opt/cuda/bin/gcc.
  -- CUDA NVCC target flags: -gencode;arch=compute_35,code=sm_35;-gencode;arch=compute_37,code=sm_37;-gencode;arch=compute_50,code=sm_50;-gencode;arch=compute_52,code=sm_52;-gencode;arch=compute_60,code=sm_60;-gencode;arch=compute_61,code=sm_61;-gencode;arch=compute_70,code=sm_70;-gencode;arch=compute_72,code=sm_72;-gencode;arch=compute_75,code=sm_75
  -- Found CUDA Toolkit v11.6
  -- Setting CMAKE_HOST_COMPILER to /opt/cuda/bin/gcc.
  -- CUDA NVCC target flags: -gencode;arch=compute_35,code=sm_35;-gencode;arch=compute_37,code=sm_37;-gencode;arch=compute_50,code=sm_50;-gencode;arch=compute_52,code=sm_52;-gencode;arch=compute_60,code=sm_60;-gencode;arch=compute_61,code=sm_61;-gencode;arch=compute_70,code=sm_70;-gencode;arch=compute_72,code=sm_72;-gencode;arch=compute_75,code=sm_75
  -- Found CUDA Toolkit v11.6
  -- Setting CMAKE_HOST_COMPILER to /opt/cuda/bin/gcc.
  -- CUDA NVCC target flags: -gencode;arch=compute_35,code=sm_35;-gencode;arch=compute_37,code=sm_37;-gencode;arch=compute_50,code=sm_50;-gencode;arch=compute_52,code=sm_52;-gencode;arch=compute_60,code=sm_60;-gencode;arch=compute_61,code=sm_61;-gencode;arch=compute_70,code=sm_70;-gencode;arch=compute_72,code=sm_72;-gencode;arch=compute_75,code=sm_75
  -- Found CUDA Toolkit v11.6
  -- Setting CMAKE_HOST_COMPILER to /opt/cuda/bin/gcc.
  -- CUDA NVCC target flags: -gencode;arch=compute_35,code=sm_35;-gencode;arch=compute_37,code=sm_37;-gencode;arch=compute_50,code=sm_50;-gencode;arch=compute_52,code=sm_52;-gencode;arch=compute_60,code=sm_60;-gencode;arch=compute_61,code=sm_61;-gencode;arch=compute_70,code=sm_70;-gencode;arch=compute_72,code=sm_72;-gencode;arch=compute_75,code=sm_75
  -- Found CUDA Toolkit v11.6
  -- Setting CMAKE_HOST_COMPILER to /opt/cuda/bin/gcc.
  -- CUDA NVCC target flags: -gencode;arch=compute_35,code=sm_35;-gencode;arch=compute_37,code=sm_37;-gencode;arch=compute_50,code=sm_50;-gencode;arch=compute_52,code=sm_52;-gencode;arch=compute_60,code=sm_60;-gencode;arch=compute_61,code=sm_61;-gencode;arch=compute_70,code=sm_70;-gencode;arch=compute_72,code=sm_72;-gencode;arch=compute_75,code=sm_75
  -- Found CUDA Toolkit v11.6
  -- Setting CMAKE_HOST_COMPILER to /opt/cuda/bin/gcc.
  -- CUDA NVCC target flags: -gencode;arch=compute_35,code=sm_35;-gencode;arch=compute_37,code=sm_37;-gencode;arch=compute_50,code=sm_50;-gencode;arch=compute_52,code=sm_52;-gencode;arch=compute_60,code=sm_60;-gencode;arch=compute_61,code=sm_61;-gencode;arch=compute_70,code=sm_70;-gencode;arch=compute_72,code=sm_72;-gencode;arch=compute_75,code=sm_75
  -- Found CUDA Toolkit v11.6
  -- Setting CMAKE_HOST_COMPILER to /opt/cuda/bin/gcc.
  -- CUDA NVCC target flags: -gencode;arch=compute_35,code=sm_35;-gencode;arch=compute_37,code=sm_37;-gencode;arch=compute_50,code=sm_50;-gencode;arch=compute_52,code=sm_52;-gencode;arch=compute_60,code=sm_60;-gencode;arch=compute_61,code=sm_61;-gencode;arch=compute_70,code=sm_70;-gencode;arch=compute_72,code=sm_72;-gencode;arch=compute_75,code=sm_75
  -- Found CUDA Toolkit v11.6
  -- Setting CMAKE_HOST_COMPILER to /opt/cuda/bin/gcc.
  -- CUDA NVCC target flags: -gencode;arch=compute_35,code=sm_35;-gencode;arch=compute_37,code=sm_37;-gencode;arch=compute_50,code=sm_50;-gencode;arch=compute_52,code=sm_52;-gencode;arch=compute_60,code=sm_60;-gencode;arch=compute_61,code=sm_61;-gencode;arch=compute_70,code=sm_70;-gencode;arch=compute_72,code=sm_72;-gencode;arch=compute_75,code=sm_75
  -- Found CUDA Toolkit v11.6
  -- Setting CMAKE_HOST_COMPILER to /opt/cuda/bin/gcc.
  -- CUDA NVCC target flags: -gencode;arch=compute_35,code=sm_35;-gencode;arch=compute_37,code=sm_37;-gencode;arch=compute_50,code=sm_50;-gencode;arch=compute_52,code=sm_52;-gencode;arch=compute_60,code=sm_60;-gencode;arch=compute_61,code=sm_61;-gencode;arch=compute_70,code=sm_70;-gencode;arch=compute_72,code=sm_72;-gencode;arch=compute_75,code=sm_75
  -- Found CUDA Toolkit v11.6
  -- Setting CMAKE_HOST_COMPILER to /opt/cuda/bin/gcc.
  -- CUDA NVCC target flags: -gencode;arch=compute_35,code=sm_35;-gencode;arch=compute_37,code=sm_37;-gencode;arch=compute_50,code=sm_50;-gencode;arch=compute_52,code=sm_52;-gencode;arch=compute_60,code=sm_60;-gencode;arch=compute_61,code=sm_61;-gencode;arch=compute_70,code=sm_70;-gencode;arch=compute_72,code=sm_72;-gencode;arch=compute_75,code=sm_75
  -- Configuring done
  -- Generating done
  -- Build files have been written to: /home/q99/projects/grin-miner/target/debug/build/cuckoo_miner-88d2ac23c41bb2a6/out/build
  running: "cmake" "--build" "." "--target" "" "--config" "Debug" "--"

  --- stderr
  CMake Warning:
    Manually-specified variables were not used by the project:

      CMAKE_ASM_COMPILER
      CMAKE_ASM_FLAGS


  Usage: cmake --build <dir>             [options] [-- [native-options]]
         cmake --build --preset <preset> [options] [-- [native-options]]
  Options:
    <dir>          = Project binary directory to be built.
    --preset <preset>, --preset=<preset>
                   = Specify a build preset.
    --list-presets
                   = List available build presets.
    --parallel [<jobs>], -j [<jobs>]
                   = Build in parallel using the given number of jobs.
                     If <jobs> is omitted the native build tool's
                     default number is used.
                     The CMAKE_BUILD_PARALLEL_LEVEL environment variable
                     specifies a default parallel level when this option
                     is not given.
    --target <tgt>..., -t <tgt>...
                   = Build <tgt> instead of default targets.
    --config <cfg> = For multi-configuration tools, choose <cfg>.
    --clean-first  = Build target 'clean' first, then build.
                     (To clean only, use --target 'clean'.)
    --resolve-package-references={on|only|off}
                   = Restore/resolve package references during build.
    --verbose, -v  = Enable verbose output - if supported - including
                     the build commands to be executed.
    --             = Pass remaining options to the native tool.
  thread 'main' panicked at '
  command did not execute successfully, got: exit status: 1

  build script failed, must exit now', /home/q99/.cargo/registry/src/github.com-1ecc6299db9ec823/cmake-0.1.44/src/lib.rs:885:5
  stack backtrace:
     0: rust_begin_unwind
               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/panicking.rs:584:5
     1: core::panicking::panic_fmt
               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/core/src/panicking.rs:143:14
     2: cmake::fail
               at /home/q99/.cargo/registry/src/github.com-1ecc6299db9ec823/cmake-0.1.44/src/lib.rs:885:5
     3: cmake::run
               at /home/q99/.cargo/registry/src/github.com-1ecc6299db9ec823/cmake-0.1.44/src/lib.rs:863:9
     4: cmake::Config::build
               at /home/q99/.cargo/registry/src/github.com-1ecc6299db9ec823/cmake-0.1.44/src/lib.rs:769:9
     5: build_script_build::main
               at ./src/build.rs:71:12
     6: core::ops::function::FnOnce::call_once
               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/core/src/ops/function.rs:227:5
  note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
warning: build failed, waiting for other jobs to finish...
error: build failed
  • cargo 1.60.0
  • rustc 1.60.0
  • cmake 3.23.1
  • gcc 11.2.0

The problem seems to be in "--target" "" in cmake args The only place where I found something similar is here. Please let me know what I'm doing wrong

cyphersnake avatar Apr 30 '22 13:04 cyphersnake

I'm getting the same issue too :(

NamesCode avatar Feb 05 '23 01:02 NamesCode

Same to me. Troubleshooting page says: Run CUDA_HOST_COMPILER=gcc-6 cargo build instead of cargo build. But it didn't help me.

Ubuntu 22.04 cargo 1.75.0 cmake 3.22.1 gcc version 11.4.0

HedgehogNSK avatar Jan 13 '24 15:01 HedgehogNSK