Skip to content

Latest commit

 

History

History
129 lines (87 loc) · 2.19 KB

File metadata and controls

129 lines (87 loc) · 2.19 KB

Building STELF

This document describes how to set up dependencies and build STELF locally.

STELF is an in-progress OCaml port of Twelf. Some areas of the codebase are still under active translation, so occasional compile failures in unfinished subsystems can be expected.

Prerequisites

  • OCaml 5.0 or newer
  • opam 2.1 or newer
  • dune 3.20 or newer

Optional but useful:

  • ocamlformat (for formatting)
  • odoc (for docs)

One-Time Setup

From the repository root:

opam switch create . ocaml-base-compiler.5.1.1
eval "$(opam env)"

# Pin local basis package used by this repository
opam pin add -y basis ./basis

# Install dependencies for stelf
opam install -y . --deps-only --with-test --with-doc

If you already have a switch for this repo, you can skip switch creation and just run:

eval "$(opam env)"
opam pin add -y basis ./basis
opam install -y . --deps-only --with-test --with-doc

Build Commands

Standard Build

dune build

Release Build

dune build --profile=release

Check Profile Build

dune build --profile=check

Run Tests

dune test

Or run the test alias explicitly:

dune build @runtest

Format Code

dune fmt

Build Documentation

dune build @doc

Build Executable

The main executable is built via dune:

dune build bin/main.exe

After a successful build, the binary is available under _build/default/bin/.

Using Makefile Targets

Common targets:

make build
make test
make fmt
make check

Note: the install target currently depends on build-release, which is not defined in the current Makefile. Prefer dune commands directly for installation flows until that target is updated.

Troubleshooting

  • If dune cannot find dependencies, ensure your opam switch is active:

     eval "$(opam env)"
  • If basis resolves incorrectly, re-pin local basis and reinstall deps:

     opam pin add -y basis ./basis
     opam install -y . --deps-only --with-test --with-doc
  • If build failures appear in partially ported modules, verify whether the failure is in actively translated code before treating it as a regression.