mithril-security / blindai

Confidential AI deployment with secure enclaves :lock:
https://www.mithrilsecurity.io/
Apache License 2.0
502 stars 36 forks source link

Client build for macOS (x64) platforms #66

Closed kbamponsem closed 2 years ago

kbamponsem commented 2 years ago

Description

Described below are the details for building successfully on macOS (x64) architectures:

  1. A new buildAttestationLibDarwin.sh shell script is created which separately handles darwin platforms.

  2. Also, since LLVM's Clang toolchain isn't the same on Apple devices, this condition was factored into Intel's DCAP Attestation Library.

    if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
  3. Particularly for the postExtensionBuildDarwin.sh shell script, instead of using patchelf, on macOS, install_name_tool is used to replace rpath in the _quote_verification bundle file with the necessary absolute paths.

  4. The setup.py file which builds the python library, is also updated to include building for darwin.

    SUPPORTED_PLATFORMS = {"LINUX", "WINDOWS", "DARWIN"}

    Related Issue

Type of change

How Has This Been Tested?

Tested on a macOS Big Sur VM with VMWare, and a sample application consuming the server, and it works perfectly!

Checklist: