Skip to content

All required libraries

Nathan Broadbent edited this page Dec 2, 2019 · 73 revisions

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

General

You will need LLVM 3.8, 3.9, 4.0, 5.0, 6.0.1, 7.0, or 8.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 https://github.com/ivmai/bdwgc.git
cd bdwgc
git clone https://github.com/ivmai/libatomic_ops.git
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.

Ubuntu

sudo apt-get install \
  libbsd-dev \
  libedit-dev \
  libevent-dev \
  libgmp-dev \
  libgmpxx4ldbl \
  libssl-dev \
  libxml2-dev \
  libyaml-dev \
  libreadline-dev \
  automake \
  libtool \
  git \
  llvm-7 \
  llvm-7-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.

Fedora

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

Mac OSX (with homebrew)

You may find some more up-to-date packages in ./bin/ci (see the brew install commands in the prepare_build function.)

xcode-select --install
brew install \
  bdw-gc \
  gmp \
  libevent \
  libxml2 \
  libyaml \
  llvm@8 \
  pcre \
  openssl \
  pkg-config
brew link --force llvm@8

No boehm gc from source needed OS X, the bdw-gc brew package works well.