Open jfecher opened 2 years ago
Since the assembly that failed to compile doesn't seem to be ARM, I think the culprit could be these lines in CMakeLists.txt:
if(ARM)
message(STATUS "Compiling for ARM.")
set(DISABLE_ASM ON)
set(RUN_HAVE_STD_REGEX 0)
set(RUN_HAVE_POSIX_REGEX 0)
endif()
in which the if(ARM)
is false on my M1, causing DISABLE_ASM
to remain off.
Is there anybody who solve the compilation error on Mac?
I've pushed a temporary fix for the compiler issues on M1 Macs.
Running bootstrap.sh APPLE_M1
should work now. Multithreading is disabled, however, as there are lingering linker errors with OpenMP.
Attempting to compile barretenberg on an apple M1 currently fails during cmake configuration and fixing it seems non-trivial.
First, configuring cmake for barretenberg currently gives an error due to M1s storing binaries at different locations than intel-based macs:
On my system, the path for apple clang is at
/usr/bin/clang
instead. Using this gives an error for-fopenmp
not being supported however. Using the homebrew clang at/opt/homebrew/opt/llvm/bin/clang
works instead. Then changingbarretenberg/cmake/toolchains/x86_64-apple-clang.cmake
fromto
works as a quick band-aid to the problem, though perhaps cmake should detect an M1 processor and defer to a new
arm64-apple-clang.cmake
file instead. Runningcmake .
again from there we run into a similar error to #65:For some reason, this last error isn't present on the branch
kw/noir-dsl-mac
. Continuing on that branch, building viamake
fails due to clang (13.0.0) not supporting-march=native
on an apple M1:arch.cmake
can be patched up a bit to get past this:After which
make
gives a different error sincelibomp
is installed to a different directory (/opt/homebrew/lib/libomp.a
) instead of the expected:After manually creating a link for the library to the expected location the build fails in a dependency:
This error is fatal unless we build in debug mode instead. Compiling in debug gets us a bit further but fails here instead: