Files
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

52 lines
1.8 KiB
Bash
Executable File

#!/usr/bin/env bash
# Copyright (c) 2026 Advanced Micro Devices, Inc.
# SPDX-License-Identifier: MIT
#
# Convenience entry point: build the glibc-portable mirage + rocjitsu
# prefix via `mirage-docker-build.sh` (if not already built) and then run
# the freshly installed `mirage` binary, forwarding all arguments.
#
# The installed `<prefix>/bin/mirage` finds its sibling
# `<prefix>/lib/librocjitsu*.so` automatically, so no LD_LIBRARY_PATH or
# extra wiring is needed.
#
# Usage:
# ./scripts/mirage.sh [mirage args...]
#
# Examples:
# ./scripts/mirage.sh --help
# ./scripts/mirage.sh run --profile rocjitsu-MI350X -- rocminfo
#
# Environment variables:
# MIRAGE_PREFIX - install/run prefix (default: <mirage>/build/manylinux)
# MIRAGE_SKIP_BUILD - set to 1 to skip the rebuild and run the existing binary
# RJ_LOG_GROUPS - rocjitsu compile-time log groups (default: VM; see
# rocjitsu/cmake/rj_log.cmake -- OFF, ALL, or names like
# VM,CP,DBT_HOOKS)
# plus everything honoured by mirage-docker-build.sh
# (MIRAGE_BUILD_IMAGE, MIRAGE_IMAGE_TAG, CONTAINER_ENGINE, CARGO_PROFILE)
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
MIRAGE_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
PREFIX="${MIRAGE_PREFIX:-${MIRAGE_DIR}/build/manylinux}"
MIRAGE_BIN="$PREFIX/bin/mirage"
# Always rebuild via the Docker image -- BuildKit layer + cache mounts make
# re-runs fast, and this guarantees source/log-group changes are picked up.
# Set MIRAGE_SKIP_BUILD=1 to bypass and run the already-installed binary.
if [ "${MIRAGE_SKIP_BUILD:-0}" != "1" ]; then
echo "mirage: building via mirage-docker-build.sh ($PREFIX)" >&2
"$SCRIPT_DIR/mirage-docker-build.sh" "$PREFIX" >&2
fi
if [ ! -x "$MIRAGE_BIN" ]; then
echo "mirage: build did not produce $MIRAGE_BIN" >&2
exit 1
fi
exec "$MIRAGE_BIN" "$@"