What Can It Compile?
See the tests directory for a sample of what is/should-be working. You can also build SDC’s runtime library, that is compiled using SDC.
Compiling SDC on Linux
You’ll need make
and the latest DMD installed and LLVM 18.
Run make
.
Then you can run the test suite using make check
. There should be no
regressions.
SDC requires a recent version of LLVM. If the default llvm-config on your system
is too old, you can specify a newer version via LLVM_CONFIG
. For instance, on
a debian system, you want to use LLVM_CONFIG=llvm-config-11 make
.
Compiling SDC on Mac OS X
You’ll need make
and the latest DMD installed. You’ll also need a recent
version of LLVM if you don’t already have it. One way to install llvm that’s
been tested is to use Homebrew, a package manager for OS X. After
installing it by following instructions from the web page, run the command
brew install llvm11
, followed by LLVM_CONFIG=llvm-config-11 make
. If you
are using MacPorts instead, you can run sudo port install llvm-11
,
followed by LLVM_CONFIG=llvm-config-mp-11 make
. You’ll also need a recent
version of nasm
; if nasm
does not recognise the macho64
output format, try
upgrading nasm
to a newer version.
Building SDC as a Nix package
On Linux, you can also use the Nix package manager to automatically fetch
dependencies and build SDC for you. You may need to use the unstable nix
channel, to have a new enough dmd
to build SDC. Clone or download this
repository.
To build the executable, run
nix-build -E "(import <nixpkgs> {}).callPackage ./. {}"
or
nix-build -E "(import <nixpkgs> {}).callPackage ./. {dflags=\"-O -release\";}"
from the project root directory.