omega-bridge
Omega-first language interoperability: checked conversion backends and native language bindings
Brought by drakestapleton
omega-bridge / attach / torch / build.sh
| 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). |
| 5 | set -eu |
| 6 | A=${1:?usage: build.sh libomega_gpu.a [out.so]} |
| 7 | O=${2:-$(dirname "$0")/libcudapp_attach.so} |
| 8 | nm "$A" | grep -q ' T omega_gpu_gemm_ex$' || { echo "FAIL $A has no omega_gpu_gemm_ex" >&2; exit 1; } |
| 9 | cc -shared -o "$O" -Wl,--whole-archive "$A" -Wl,--no-whole-archive -lpthread -lm |
| 10 | echo "BUILT $O from $A (sha256 $(sha256sum < "$A" | cut -c1-16))" |