· Last updated: · 2 min read
Compiling Pixlie AI 0.1.2 on MacOS
Fix compilation errors on MacOS after recent dependency updates.
The latest updates in our dependencies causes the compilation of Pixlie AI on MacOS to break, since it is not able to get access to some of the system dependencies.
To fix these issues, you need to take the following steps:
- Install
llvm
using Homebrew, by running:brew install llvm
- Add the following lines at the bottom of the file
~/.zshrc
:
To quickly open the file using TextEdit from your terminal, you can run:export LIBCLANG_PATH=$(brew --prefix llvm)/lib export DYLD_LIBRARY_PATH="$LIBCLANG_PATH:$DYLD_LIBRARY_PATH" export PATH=$(brew --prefix llvm)/bin:$PATH export CC=$(brew --prefix llvm)/bin/clang export CXX=$(brew --prefix llvm)/bin/clang++
open -a "TextEdit" ~/.zshrc
- Open a new terminal or reload the environment:
omz reload
- Now try to run Pixlie AI while you’re in the
pixlie_ai
folder:cargo run --bin cli
Update: 2 Mar, 2025
Some users have reported that the above steps are not enough and it still throws the error linking with `cc` failed
.
If you’re facing this error after making the above changes, please make sure you are using a fresh/reloaded terminal environment and take the following steps:
- Install
rocksdb
:brew install rocksdb
- Add the following lines at the bottom of the file
~/.zshrc
:export ROCKSDB_INCLUDE_DIR=$(brew --prefix rocksdb)/include export ROCKSDB_LIB_DIR=$(brew --prefix rocksdb)/lib
- Open a new terminal or reload the environment and try running Pixlie AI again.
Update: 4 Mar, 2025
The above steps still throw an error in rust-analyzer
running in the VS Code IDE, affecting some development features.
To resolve these issues, you can do the following:
- Install
lld
:brew install lld
- Run the following to check the installation path of Homebrew:
If the base path is not the same in step (3) below, you can use the correct path inbrew --prefix
settings.json
. - Add these settings to
.vscode/settings.json
in the project root:
You can exclude{ "rust-analyzer.runnables.extraEnv": { "LIBCLANG_PATH": "/opt/homebrew/opt/llvm/lib", "DYLD_LIBRARY_PATH": "/opt/homebrew/opt/llvm/lib", "PATH": "/opt/homebrew/opt/llvm/bin:${env:PATH}", "CC": "/opt/homebrew/opt/llvm/bin/clang", "CXX": "/opt/homebrew/opt/llvm/bin/clang++", "ROCKSDB_INCLUDE_DIR": "/opt/homebrew/opt/rocksdb/include", "ROCKSDB_LIB_DIR": "/opt/homebrew/opt/rocksdb/lib", "LD": "/opt/homebrew/opt/lld/bin/ld64.lld", "LDFLAGS": "-fuse-ld=/opt/homebrew/opt/lld/bin/ld64.lld", "AR": "/opt/homebrew/opt/llvm/bin/llvm-ar" } }
ROCKSDB_INCLUDE_DIR
&ROCKSDB_LIB_DIR
, if you have not installedrocksdb
.
If you still face any issues with compiling Pixlie AI, please do not hesitate to contact us. We would love to hear from you – issue or no issue.
Pixlie is open source. And while we are still in the early phases, we will be finalizing this piece of the puzzle in the coming weeks. Try it out for your self and see what PixlieAI can do.
Or contribute to PixlieAI and be part of something different.