File tree 5 files changed +35
-4
lines changed
5 files changed +35
-4
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,14 @@ option(MULTITHREADING "Enable multi-threading" ON)
16
16
option (TESTING "Build tests" ON )
17
17
option (BENCHMARKS "Build benchmarks" ON )
18
18
option (PROFILING "Build profiling" ON )
19
+ option (APPLE_M1 "Compile for Apple M1 CPUs" OFF )
20
+
21
+ if (APPLE_M1)
22
+ set (MULTITHREADING OFF )
23
+ set (DISABLE_ASM ON )
24
+ set (DISABLE_ADX ON )
25
+ add_definitions (-DNDEBUG)
26
+ endif ()
19
27
20
28
if (ARM)
21
29
message (STATUS "Compiling for ARM." )
@@ -43,7 +51,6 @@ include(cmake/arch.cmake)
43
51
include (cmake/threading.cmake)
44
52
include (cmake/gtest.cmake)
45
53
include (cmake/benchmark.cmake)
46
- include (cmake/build .cmake)
47
54
include (cmake/module.cmake)
48
55
49
56
add_subdirectory (src/aztec)
Original file line number Diff line number Diff line change @@ -40,6 +40,14 @@ Just run the bootstrap script.
40
40
./bootstrap.sh
41
41
```
42
42
43
+ N.B. FOR M1 MACS RUN THE FOLLOWING:
44
+
45
+ ```
46
+ ./bootstrap.sh APPLE_M1
47
+ ```
48
+
49
+ The current build for M1 macs disables multithreading, which will affect performance.
50
+
43
51
### Parallelise the build
44
52
45
53
Make sure your MAKEFLAGS environment variable is set to run jobs equal to number of cores. e.g. ` MAKEFLAGS=-j32 ` .
Original file line number Diff line number Diff line change @@ -16,11 +16,21 @@ if [ ! -d ./srs_db/ignition ]; then
16
16
cd ..
17
17
fi
18
18
19
+ appleM1=" APPLE_M1"
20
+ input=${1: foo}
21
+
19
22
# Build native.
23
+ if [ " $input " == " $appleM1 " ]; then
24
+ mkdir -p build && cd build
25
+ cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ .. -DAPPLE_M1=1
26
+ cmake --build . --parallel
27
+ cd ..
28
+ else
20
29
mkdir -p build && cd build
21
30
cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ ..
22
31
cmake --build . --parallel
23
32
cd ..
33
+ fi
24
34
25
35
# Install the webassembly toolchain and patch runtime.
26
36
if [ ! -d ./src/wasi-sdk-12.0 ]; then
Original file line number Diff line number Diff line change 5
5
add_compile_options (-fno-exceptions -fno-slp-vectorize)
6
6
endif ()
7
7
8
- if (NOT WASM)
8
+ if (NOT WASM AND NOT APPLE_M1 )
9
9
add_compile_options (-march=native)
10
10
endif ()
Original file line number Diff line number Diff line change 1
- set (CMAKE_CXX_COMPILER "/usr/local/opt/llvm/bin/clang++" )
2
- set (CMAKE_C_COMPILER "/usr/local/opt/llvm/bin/clang" )
1
+ if (APPLE_M1)
2
+ set (CMAKE_CXX_COMPILER "/opt/homebrew/opt/llvm/bin/clang++" )
3
+ set (CMAKE_C_COMPILER "/opt/homebrew/opt/llvm/bin/clang" )
4
+ set (DISABLE_ASM ON )
5
+ else ()
6
+ set (CMAKE_CXX_COMPILER "/usr/local/opt/llvm/bin/clang++" )
7
+ set (CMAKE_C_COMPILER "/usr/local/opt/llvm/bin/clang" )
8
+ endif ()
You can’t perform that action at this time.
0 commit comments