interplane.Get Omega
Read in your language

MojoLlama

Archived Mojo/MAX quantizer and serving research repository (read-only history)

Brought by drakestapleton

branch main Branches Tags History

MojoLlama / src / mojollama / mojo_engine / build.sh

31 lines · 924 bytes Raw Blame History
1# MojoLlama Mojo Engine — Build Script
2# Builds the pure Mojo engine from source.
3#
4# Prerequisites:
5# - Mojo 0.26.2 installed
6# - GCC
7# - Model weights dumped (via dump_weights.py)
8#
9# Usage:
10# bash build.sh # Build mojo_engine_v6
11# LD_LIBRARY_PATH=<mojo_lib> ./mojo_engine_v6
12
13MOJO_LIB="$HOME/.local/share/uv/tools/mojo/lib/python3.11/site-packages/modular/lib"
14
15# 1. Build the C bridge (file I/O + raw memory access)
16gcc -c -fPIC -o read_helpers.o read_helpers.c
17
18# 2. Build Mojo engine to object file
19mojo build mojo_engine_v6_final.mojo --emit object -o mojo_v6.o
20
21# 3. Link with Mojo runtime
22gcc -o mojo_engine_v6 mojo_v6.o read_helpers.o \
23 -L"$MOJO_LIB" \
24 -lKGENCompilerRTShared \
25 -lAsyncRTRuntimeGlobals \
26 -lMSupportGlobals \
27 -lAsyncRTMojoBindings \
28 -lm -lpthread -ldl -lstdc++
29
30echo "Built: mojo_engine_v6"
31echo "Run: LD_LIBRARY_PATH=\"$MOJO_LIB\" ./mojo_engine_v6"