Building from Source¶
Build RemoteJuggler from source code.
Requirements¶
Chapel Compiler¶
Install Chapel 2.7.0 or later:
Nix (recommended):
Linux (Spack):
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¶
Output: target/debug/remote-juggler
Features: - Full debugging symbols - Assertions enabled - No optimizations
Release Build¶
Output: target/release/remote-juggler
Features:
- Optimizations enabled (--fast)
- Smaller binary
- Production ready
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¶
Build Troubleshooting¶
"Module not found"¶
Ensure -M src/remote_juggler is in compiler flags:
"Undefined symbols" (macOS)¶
Add framework linker flags:
"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: