Installation

SLangCC is distributed primarily as a prebuilt compiler. Version 0.1.0 targets 64-bit x86 Linux and requires GCC or Clang to assemble and link compiled SLang programs.

Install the prebuilt compiler

Download the archive and checksum from the Download page, or use curl:

curl -LO https://www.slangcc.com/downloads/slangcc-v0.1.0-linux-x86_64.tar.gz
curl -LO https://www.slangcc.com/downloads/slangcc-v0.1.0-linux-x86_64.sha256
sha256sum -c slangcc-v0.1.0-linux-x86_64.sha256

Extract the archive:

tar -xzf slangcc-v0.1.0-linux-x86_64.tar.gz

Keep the extracted directory structure intact. slangcc locates codegen/runtime.o relative to the real location of bin/slangcc. You may symlink bin/slangcc or add its directory to PATH, but do not copy or move the executable by itself.

For a system-wide installation:

sudo mv slangcc-v0.1.0-linux-x86_64 /opt/
sudo ln -s /opt/slangcc-v0.1.0-linux-x86_64/bin/slangcc /usr/local/bin/slangcc

Alternatively, add its bin/ directory to your user PATH:

export PATH="/absolute/path/to/slangcc-v0.1.0-linux-x86_64/bin:$PATH"

Add that command to ~/.bashrc or ~/.zshrc to make it persistent.

Binary requirements

  • 64-bit x86 Linux
  • GCC or Clang available through PATH
  • permission to execute slangcc

Flex, Bison, Make, and a C++ compiler are not needed when using the prebuilt release.

Test the installation

Create hello.sl:

void main()
{
    print("Hello from SLangCC");
}

Compile and run it from any working directory:

slangcc hello.sl
./hello

Source availability

The SLangCC source repository is not public because the compiler is intended for a student project. Source code may be shared upon request. Contact the project maintainer or your course instructor to describe why access is needed and how the source will be used.

Build from source

Users who receive source access need:

  • Flex 2.6.4 or compatible
  • GNU Bison 3.8.2 or compatible
  • GCC or Clang with C++17 support
  • Make

From the private repository root:

make

This builds ./slangcc and codegen/runtime.o. To remove generated build files:

make clean

Platform note

SLangCC v0.1.0 supports only 64-bit x86 Linux (x86-64). The current code generator does not target macOS, Windows, ARM, or other architectures.