Skip to content

Latest commit

 

History

History
51 lines (37 loc) · 1.7 KB

QuickstartMacOS.md

File metadata and controls

51 lines (37 loc) · 1.7 KB

Set up environment on Mac OS

Mac support is still experimental. Submit bugs if you experience issues.

  1. Run terminal.

  2. Install homebrew (if haven't already) following instructions from here:

    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile\n
    
  3. Install clang-17 compiler (make sure that the version is not older than 15, otherwise it will not compile):

    brew install llvm@17
    export PATH="/opt/homebrew/opt/llvm/bin:$PATH"
    export CC=clang
    export CXX=clang++
    

    Consider making environment changes permanent:

    echo 'export PATH="/opt/homebrew/opt/llvm/bin:$PATH"' >> ~/.zshrc
    echo 'export CC=clang' >> ~/.zshrc
    echo 'export CXX=clang++' >> ~/.zshrc
    
  4. Build release version of google benchmark library. It doesn't matter which compiler you use to build it. Install google benchmark library with:

    git clone https://github.com/google/benchmark.git
    cd benchmark
    git clone https://github.com/google/googletest.git
    mkdir build
    cd build
    cmake -DCMAKE_BUILD_TYPE=Release ..
    cmake --build . --config Release --target install
    
  5. Go to any lab and check if local lab builds are working. You can find the CMake commands here.

  6. (Optional) Install ninja.

    $ brew install ninja
    

    You can use it to build labs by passing -G Ninja to the CMake invocation.