Build Tools
Many development tools and language runtimes compile native dependencies during installation. This guide covers the essential system libraries and compilers for each platform.
Installation
- macOS
- Windows
- Linux
Xcode Command Line Tools
Install the base toolchain (includes git, clang, make):
xcode-select --install
Additional Libraries
Install supplementary development libraries via Homebrew:
brew install openssl@3 pkg-config cmake gcc
Apple Silicon OpenSSL Configuration
Apple Silicon Macs need explicit OpenSSL paths. Add these to your shell profile (~/.zshrc):
echo 'export OPENSSL_DIR=/opt/homebrew/opt/openssl@3' >> ~/.zshrc
echo 'export PKG_CONFIG_PATH=/opt/homebrew/opt/openssl@3/lib/pkgconfig:$PKG_CONFIG_PATH' >> ~/.zshrc
echo 'export LDFLAGS="-L/opt/homebrew/opt/openssl@3/lib $LDFLAGS"' >> ~/.zshrc
echo 'export CPPFLAGS="-I/opt/homebrew/opt/openssl@3/include $CPPFLAGS"' >> ~/.zshrc
source ~/.zshrc
Without these, you will get compilation errors from tools that link against OpenSSL.
Visual Studio Build Tools
Install the C++ compiler toolchain from Visual Studio Downloads.
Using Chocolatey:
# PowerShell 7 as Administrator
choco install visualstudio2022buildtools cmake -y
refreshenv
Restart PowerShell after installation for PATH updates to take effect.
Verification
- macOS
- Windows
- Linux
pkg-config --modversion openssl
gcc --version
cmake --version
where cl
cmake --version
gcc --version
cmake --version
pkg-config --modversion openssl
Troubleshooting
macOS: "Could not find directory of OpenSSL installation"
Verify the environment variables are set:
echo $OPENSSL_DIR
echo $PKG_CONFIG_PATH
If empty, re-add the exports above and run source ~/.zshrc.
Windows: "Compiler not found"
Restart your terminal after installing Build Tools. If the issue persists, launch the Developer Command Prompt or Developer PowerShell from the Start menu.
Linux: Package installation fails
Run sudo apt update (Debian/Ubuntu) or sudo dnf update (Fedora/RHEL) first, then retry.
Related
- Package Managers - Install Homebrew, Chocolatey, or APT
- SSH Keys - Configure authentication keys
- Languages - Language-specific environment setup