interplane.Get Omega
Read in your language

omega-bridge

Omega-first language interoperability: checked conversion backends and native language bindings

Brought by drakestapleton

branch main Branches Tags History

omega-bridge / attach / torch / build.sh

10 lines · 661 bytes Raw Blame History
1#!/bin/sh
2# Link CUDA++'s libomega_gpu.a (built with -fPIC: make CC="gcc -fPIC" OUT_DIR=build-pic libomega_gpu) into the one
3# shared object cudapp_torch.py loads. usage: build.sh CUDAPP_LIB_A [OUT_SO]
4# The archive must carry omega_gpu_gemm_ex (CUDApp gemm_ex, build switch CUDAPP_MIGRATION_PENDING_GEMM_EX=1).
5set -eu
6A=${1:?usage: build.sh libomega_gpu.a [out.so]}
7O=${2:-$(dirname "$0")/libcudapp_attach.so}
8nm "$A" | grep -q ' T omega_gpu_gemm_ex$' || { echo "FAIL $A has no omega_gpu_gemm_ex" >&2; exit 1; }
9cc -shared -o "$O" -Wl,--whole-archive "$A" -Wl,--no-whole-archive -lpthread -lm
10echo "BUILT $O from $A (sha256 $(sha256sum < "$A" | cut -c1-16))"