Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/omega-blas/blob/main/Makefile # omega-blas aien-dev/omega-blas Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `omega-blas / Makefile` 46 lines ยท 1958 bytes Raw Blame History 1 # omega-blas build. The compute unit om/blas.om is compiled by the pinned OM-2 omc and bound by 2 # omega-bridge tools/native (ABI v2); libomegablas.so links that binding with the interim C layer. 3 # make BRIDGE= OMC= OMC2= 4 # make ... GB10=1 CUDAPP= the GB10 device path (README.md), into build-gb10/: 5 # links CUDApp's libomega_gpu.a, built position-independent into $(CUDAPP)/build/omegablas-pic 6 # Pins: see PINS (parent omega-mv sha, omc sha256s, omega-bridge sha, CUDApp sha). 7 BRIDGE ?= ../omega-bridge 8 OMC ?= $(error set OMC to the seeded omc (sha256 in PINS)) 9 OMC2 ?= $(error set OMC2 to the OM-2 omc (sha256 in PINS)) 10 CC ?= cc 11 CFLAGS ?= -O2 12 GB10 ?= 0 13 N := build/native 14 ifeq ($(GB10),1) 15 CUDAPP ?= $(error set CUDAPP to a CUDApp checkout (sha in PINS)) 16 B := build-gb10 17 GPU_LIB := $(CUDAPP)/build/omegablas-pic/libomega_gpu.a 18 GPU_CFLAGS := -DOMB_GB10 -I$(CUDAPP)/src \ 19 -DOMB_CUDAPP_REV='"$(shell git -C $(CUDAPP) rev-parse HEAD)$(shell git -C $(CUDAPP) diff --quiet HEAD || echo -dirty)"' 20 GPU_LIBS := $(GPU_LIB) -lm 21 else 22 B := build 23 endif 24 25 all: $(B)/libomegablas.so 26 27 $(N)/omega_native.c: om/blas.om 28 OMEGA_NATIVE_OMC=$(OMC) OMEGA_NATIVE_OMC2=$(OMC2) $(BRIDGE)/tools/native $(N) om/blas.om 29 30 $(B)/libomegablas.so: $(N)/omega_native.c src/omegablas.c include/omegablas.h $(GPU_LIB) 31 mkdir -p $(B) 32 $(CC) -std=gnu11 $(CFLAGS) -Wall -Wextra -Werror -fPIC -shared -Wl,-soname,libomegablas.so \ 33 -Iinclude -I$(N) -include $(N)/omega_native.h $(GPU_CFLAGS) -o $@ src/omegablas.c \ 34 $(N)/omega_native.c $(GPU_LIBS) -lpthread 35 36 ifeq ($(GB10),1) 37 # CUDApp's own build with -fPIC added to the compiler; its CFLAGS, including the gemm_ex 38 # migration-pending switch of mk/gemm-ex.mk, stay as CUDApp sets them. 39 $(GPU_LIB): FORCE 40 $(MAKE) -C $(CUDAPP) OUT_DIR=build/omegablas-pic CC="$(CC) -fPIC" build/omegablas-pic/libomega_gpu.a 41 endif 42 43 clean: 44 rm -rf build build-gb10 45 46 .PHONY: all clean FORCE