Skip to content

Commit be4a0be

Browse files
ashvardanianab-10
andcommitted
Docs: OpenBLAS installation on MacOS
Co-authored-by: Armin Stepanjans <[email protected]>
1 parent 9120723 commit be4a0be

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Some of the highlights include:
2424
- __Scaling AI?__ Measure the gap between theoretical [ALU](https://en.wikipedia.org/wiki/Arithmetic_logic_unit) throughput and your [BLAS](https://en.wikipedia.org/wiki/Basic_Linear_Algebra_Subprograms).
2525
- __How many if conditions are too many?__ Test your CPU's branch predictor with just 10 lines of code.
2626
- __Prefer recursion to iteration?__ Measure the depth at which your algorithm will [`SEGFAULT`](https://en.wikipedia.org/wiki/Segmentation_fault).
27-
- __Why avoid exceptions?__ Take `std::error_code` or [`std::variant`](https://en.cppreference.com/w/cpp/utility/variant)-like wrappers?
27+
- __Why avoid exceptions?__ Take `std::error_code` or [`std::variant`](https://en.cppreference.com/w/cpp/utility/variant)-like [ADTs](https://en.wikipedia.org/wiki/Algebraic_data_type)?
2828
- __Scaling to many cores?__ Learn how to use [OpenMP](https://en.wikipedia.org/wiki/OpenMP), Intel's oneTBB, or your custom thread pool.
2929
- __How to handle [JSON](https://www.json.org/json-en.html) avoiding memory allocations?__ Is it easier with C++ 20 or old-school C 99 tools?
3030
- __How to properly use STL's associative containers__ with custom keys and transparent comparators?
@@ -93,6 +93,18 @@ cmake -B build_release -D CMAKE_BUILD_TYPE=Release -D USE_INTEL_TBB=OFF -D USE_N
9393
cmake --build build_release --config Release
9494
```
9595

96+
To build on MacOS, pulling key dependencies from [Homebrew](https://brew.sh):
97+
98+
```sh
99+
brew install openblas
100+
cmake -B build_release \
101+
-D CMAKE_BUILD_TYPE=Release \
102+
-D CMAKE_C_FLAGS="-I$(brew --prefix openblas)/include" \
103+
-D CMAKE_CXX_FLAGS="-I$(brew --prefix openblas)/include" \
104+
-D CMAKE_EXE_LINKER_FLAGS="-L$(brew --prefix openblas)/lib"
105+
cmake --build build_release --config Release
106+
```
107+
96108
To control the output or run specific benchmarks, use the following flags:
97109

98110
```sh

0 commit comments

Comments
 (0)