Installation

Chapel 2.x, a POSIX host, a C compiler. Nothing else.

Updated 2 min read

Cataract requires Chapel 2.x with chpl on PATH, and a POSIX host with a working C compiler. The C compiler is needed because the socket layer is a small C shim that Chapel calls through its foreign function interface.

Install Chapel

Chapel ships prebuilt for most platforms. On macOS:

brew install chapel
chpl --version

On Linux, use your distribution's package or the release tarball from the Chapel project. Any 2.x release works; the framework does not depend on unreleased features.

Build the CLI

git clone https://github.com/lunikos/cataract.git
cd cataract
make

make compiles bin/cataract from src/cataract.chpl, src/cli and src/compiler. The runtime is not compiled into the toolchain โ€” it is compiled into each application binary instead, which is why the CLI needs to know where the runtime source lives.

Tell the CLI where the runtime is

Two mechanisms, in this order of precedence:

[paths]
runtime = "../cataract/src/runtime"
export CATARACT_RUNTIME=$PWD/src/runtime

A configured path that exists always wins, so a vendored copy of the runtime is never silently bypassed by a stale environment variable.

Verify

cataract new hello
cd hello
cataract routes
cataract build
./dist/hello --port=3000

cataract routes prints the compiled route table without invoking chpl, which makes it a fast check that the toolchain can read your project even before it can compile it.

Troubleshooting

SymptomCause
the Chapel compiler is not on PATHchpl is missing; cataract routes still works
runtime modules not foundpaths.runtime and CATARACT_RUNTIME both point nowhere
no root layoutThe project has pages but no app/layouts/root.chpl
route has no module declarationA file under app/routes is not wrapped in module Name { }