mimblewimble / grin-miner

Standalone miner for grin
Apache License 2.0
296 stars 153 forks source link

Apple Silicon - build failed #260

Open gringum opened 2 years ago

gringum commented 2 years ago

It seems some misunderstanding about options for Cmake?

-- Configuring done -- Generating done -- Build files have been written to: xxxxxxxx/grin/dev/grin-miner/grin-miner/target/debug/build/cuckoo_miner-86e8b47af42b98f9/out/build running: "cmake" "--build" "." "--target" "" "--config" "Debug" "--parallel" "8"

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

  CMAKE_ASM_COMPILER
  CMAKE_ASM_FLAGS

Usage: cmake --build

[options] [-- [native-options]] cmake --build --preset [options] [-- [native-options]] Options:

= Project binary directory to be built. --preset , --preset= = Specify a build preset. --list-presets = List available build presets. --parallel [], -j [] = Build in parallel using the given number of jobs.
gringum commented 2 years ago

when I go a little bit deeper I think maybe the --target "" might be problem and then I also see that -march=native is throwing some errors

[ 15%] Building CXX object CMakeFiles/cuckatoo_mean_cpu_avx2_31.dir/cuckoo/src/cuckatoo/mean.cpp.o [ 17%] Building CXX object CMakeFiles/cuckatoo_lean_cpu_compat_31.dir/cuckoo/src/cuckatoo/lean.cpp.o clangclang: : clangclang: : clang: errorerrorerror: : : the clang compiler does not support '-march=native'the clang compiler does not support '-march=native'the clang compiler does not support '-march=native' error: the clang compiler does not support '-march=native' error: the clang compiler does not support '-march=native'

quentinlesceller commented 2 years ago

AFAIK the option -march=native will not work on Apple M1. Out of curiosity I've tried replacing it with -mcpu=apple-m1 and managed to start the build of Cuckoo (https://github.com/tromp/cuckoo/tree/master/src/cuckoo). No luck to build the whole cuckoo-miner crate though.