Skip to content

Latest commit

 

History

History
122 lines (88 loc) · 2.41 KB

BUILD.md

File metadata and controls

122 lines (88 loc) · 2.41 KB

Build

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:
NOTE: Currently there is no script to install Lily on the machine.

./scripts/patches/enable_local.sh

Linux

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

MacOS

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

Windows

...

BSD

...