First, you need to load the git submodules.
make submodules
Tip
If you already have LLVM installed, you don't need to download the llvm-project
submodule.
You can run the make submodules_without_llvm
command instead.
If you only want to use Lily
locally to try it out, run:
./scripts/patches/enable_local.sh
If you want to install Lily on your machine, you'll be able to do so when you finish building in release mode (configure with make configure
):
Caution
For the moment, the script only supports Unix machines and the Bash, Zsh and Fish shells. The script will also modify your shell configuration file.
./scripts/install.sh
Make sure you are using Clang
16 as your default compiler, if not, run:
export CC=clang # or clang-16
export CXX=clang++ # or clang++-16
After launching the CMake configuration:
make configure_with_llvm # We use Ninja
# If LLVM is already installed:
make configure # We use Ninja
Then, the build:
# If you don't have a very powerful machine or are already using a
# lot of resources, it's worth trying to add a restriction on the
# number of possible tasks, with the -j option.
ninja -C build -j <n_jobs>
Launch lilyc
:
NOTE: This is the command to use the Lily compiler.
./bin/lilyc -h # local version
lilyc -h # installed version
Launch lily
:
NOTE: This is the command to use some utility tools for the Lily language (build, init, new, ...).
./bin/lily -h # local version
lily -h # installed version
Make sure you are using Clang
16 as your default compiler, if not, run:
# Brew installation
export CC=$(brew --prefix llvm@16)/bin/clang
export CXX=$(brew --prefix llvm@16)/bin/clang++
# No-brew installation
export CC=clang
export CXX=clang++
After launching the CMake configuration:
make configure_with_llvm # We use Ninja
# If LLVM is already installed:
make configure # We use Ninja
If LLVM is not found by CMake run:
# Brew installation
export LLVM_DIR=$(brew --prefix llvm@16)
Then, the build:
# If you don't have a very powerful machine or are already using a
# lot of resources, it's worth trying to add a restriction on the
# number of possible tasks, with the -j option.
ninja -C build -j <n_jobs>
Launch lilyc
:
NOTE: This is the command to use the Lily compiler.
./bin/lilyc -h # local version
lilyc -h # installed version
Launch lily
:
NOTE: This is the command to use some utility tools for the Lily language (build, init, new, ...).
./bin/lily -h # local version
lily -h # installed version
...
The steps for building on FreeBSD are exactly the same as those described for Linux.