Skip to content

Building from Source

Build RemoteJuggler from source code.

Requirements

Chapel Compiler

Install Chapel 2.7.0 or later:

Nix (recommended):

nix develop  # Provides Chapel 2.7.0 + all build tools

Linux (Spack):

spack install chapel

From Source:

git clone https://github.com/chapel-lang/chapel.git
cd chapel
./configure
make
source util/quickstart/setchplenv.bash

Build Tools

  • Just
  • C compiler (for FFI code)

Build Commands

Debug Build

just build

Output: target/debug/remote-juggler

Features: - Full debugging symbols - Assertions enabled - No optimizations

Release Build

just release

Output: target/release/remote-juggler

Features: - Optimizations enabled (--fast) - Smaller binary - Production ready

Clean

just clean

Removes build artifacts.

Justfile Reference

Key recipes from justfile:

# Recipes
build       # Debug build
release     # Optimized build
test        # Run tests
lint        # Check code style
install     # Install to $HOME/.local/bin
clean       # Remove artifacts

Mason Build

Alternative build using Chapel's package manager:

# Initialize (if needed)
mason update

# Debug build
mason build

# Release build
mason build --release

Note: Mason may not properly pass linker flags for macOS frameworks. Use just for production builds.

Cross-Compilation

Linux on macOS

Not directly supported. Use CI/CD for Linux builds.

Building in Docker

FROM chapel/chapel:2.7

WORKDIR /app
COPY . .
RUN just release

Build Troubleshooting

"Module not found"

Ensure -M src/remote_juggler is in compiler flags:

chpl -M src/remote_juggler src/remote_juggler.chpl

"Undefined symbols" (macOS)

Add framework linker flags:

chpl --ldflags="-framework Security -framework CoreFoundation" ...

"chpl: command not found"

Chapel not in PATH:

# Homebrew
eval "$(brew --prefix chapel)/util/quickstart/setchplenv.bash"

# Source install
source $CHPL_HOME/util/quickstart/setchplenv.bash

Build Configuration

Environment Variables

Variable Purpose
CHPL_HOME Chapel installation directory
CHPL_TARGET_PLATFORM Target platform (darwin, linux)
CHPL_LLVM Use LLVM backend (system, bundled)

Compiler Flags

Flag Purpose
-M <dir> Module search path
--fast Enable optimizations
-o <file> Output file name
--ldflags Linker flags
--main-module Specify main module

Binary Size

Typical sizes:

Build Size
Debug ~15 MB
Release ~5 MB
Release + strip ~3 MB

Strip debug symbols:

strip target/release/remote-juggler