omega-mv
Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.
Brought by drakestapleton
omega-mv / research / atemporal / at0 / model / build.sh
| 1 | #!/bin/sh |
| 2 | # SPDX-License-Identifier: Apache-2.0 |
| 3 | # Copyright 2026 Drake Stapleton (AIEN / aien-dev) |
| 4 | # |
| 5 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | # you may not use this file except in compliance with the License. |
| 7 | # You may obtain a copy of the License at |
| 8 | # |
| 9 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | # |
| 11 | # Unless required by applicable law or agreed to in writing, software |
| 12 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | # See the License for the specific language governing permissions and |
| 15 | # limitations under the License. |
| 16 | |
| 17 | # Build the AT-0 candidate engine and its tests (plain C11, -lm only). |
| 18 | # ./build.sh plain build into ./build |
| 19 | # ./build.sh asan address + undefined sanitizer build into ./build-asan |
| 20 | # Links omega's src/omega_om_units.c (the only shared source); never touches omega's Makefile. |
| 21 | set -eu |
| 22 | HERE=$(cd "$(dirname "$0")" && pwd) |
| 23 | ROOT=$(cd "$HERE/../../../.." && pwd) |
| 24 | MODE=${1:-plain} |
| 25 | CFLAGS="-std=c11 -Wall -Wextra -Werror -pedantic -D_POSIX_C_SOURCE=200809L -I$HERE -I$ROOT/src" |
| 26 | if [ "$MODE" = asan ]; then OUT="$HERE/build-asan"; CFLAGS="$CFLAGS -O1 -g -fsanitize=address,undefined -fno-sanitize-recover=all" |
| 27 | else OUT="$HERE/build"; CFLAGS="$CFLAGS -O2"; fi |
| 28 | CC=${CC:-gcc} |
| 29 | mkdir -p "$OUT" |
| 30 | LIB="$HERE/at0_exact.c $HERE/at0_case.c $HERE/at0_io.c $HERE/at0_state.c $HERE/at0_hamiltonian.c $HERE/at0_constraint.c \ |
| 31 | $HERE/at0_povm.c $HERE/at0_conditional.c $HERE/at0_observable.c $HERE/at0_engine.c $HERE/at0_output.c $ROOT/src/omega_om_units.c" |
| 32 | # shellcheck disable=SC2086 |
| 33 | $CC $CFLAGS -o "$OUT/at0-model" $HERE/at0_main.c $LIB -lm |
| 34 | # shellcheck disable=SC2086 |
| 35 | $CC $CFLAGS -o "$OUT/at0-tests" $HERE/tests/test_model.c $LIB -lm |
| 36 | echo "built $OUT/at0-model and $OUT/at0-tests ($MODE)" |