All required libraries

Adrien Smith edited this page Sep 10, 2018 · 48 revisions

This is a list of known required libraries needed to run Crystal's specs.


You will need LLVM 3.8, 3.9, 4.0, 5.0, or 6.0.

You will also need BOEHM GC 7.6 or greater (because of this commit). If your distro does not have a new enough package, one way is to install the latest bdw git master (you may need autoreconf, automake, libtool, make, g++, pkg-config and diff packages prerequisites):

git clone
cd bdwgc
git clone
autoreconf -vif
./configure --enable-static --disable-shared
make -j
make check
sudo make install

To build crystal, a requisite is to have a working version of crystal itself already installed, see one of the non "from sources" option or use cross compilation to bootstrap a compiler for your current OS.


sudo apt-get install \
  libbsd-dev \
  libedit-dev \
  libevent-core-2.0-5 \
  libevent-dev \
  libevent-extra-2.0-5 \
  libevent-openssl-2.0-5 \
  libevent-pthreads-2.0-5 \
  libgmp-dev \
  libgmpxx4ldbl \
  libssl-dev \
  libxml2-dev \
  libyaml-dev \
  libreadline-dev \
  automake \
  libtool \
  git \
  llvm \
  llvm-dev \
  libpcre3-dev \
  build-essential -y

You will likely have to install bdw gc from source, above, most distro's don't have a new enough package of it. However, some distros might, test it via apt install libgc-dev and if crystal make works OK, it's new enough, regardless of release number.


sudo dnf -y install \
  gmp-devel \
  libbsd-devel \
  libedit-devel \
  libevent-devel \
  libxml2-devel \
  libyaml-devel \
  llvm-static \
  openssl-devel \
  readline-devel \

Fedora 25 (current version as of writing) only packages Boehm GC 7.4. You can pull the 7.6 packages from Fedora Rawhide with:

sudo dnf install fedora-repos-rawhide
sudo dnf install gc gc-devel # get all dependencies from Fedora 25
sudo dnf install gc gc-devel --enablerepo=rawhide --best --allowerasing # upgrade only gc and gc-devel to the version in Rawhide

This will not upgrade any other part of your system to Fedora Rawhide.

Mac OSX (with homebrew)

xcode-select --install
brew install \
  bdw-gc \
  gmp \
  libevent \
  libxml2 \
  libyaml \
brew link llvm --force

No boehm gc from source needed OS X.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.