---
# System prepended metadata

title: liboqs produce .a files for arm64 and x86_64

---

# liboqs produce .a files for arm64 and x86_64

[lib github](https://github.com/open-quantum-safe/liboqs)



1. 建立資料夾
    `mkdir build && cd build`
2. 建立 cmake
`cmake .. -GNinja -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -DCMAKE_BUILD_TYPE=Release -DOQS_USE_OPENSSL=OFF -DCMAKE_C_FLAGS="-mcpu=generic"`
3. 產生檔案
`ninja`

4. 檢查支援架構
lipo -info liboqs.a

---
### 排除 x86 失敗的情況
1. install brew in x86 folder
arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
2. check x86 brew version
arch -x86_64 brew --version
3. x86 install cmake ninja
arch -x86_64 /usr/local/bin/brew install cmake ninja

--- 
草稿

git clone
mkdir build-arm64 && cd build-arm64
cmake .. -DCMAKE_OSX_ARCHITECTURES=x86_64
cmake .. -DCMAKE_OSX_ARCHITECTURES=arm64
make
//以上失敗