Skip to content

Commit b954598

Browse files
committed
More Makefile cleanup
1 parent 9e2a745 commit b954598

File tree

1 file changed

+22
-19
lines changed

1 file changed

+22
-19
lines changed

Makefile

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ CUDA_MAJOR ?= 12
55
CUDA_FULL_VERSION ?= 12.9.1
66
LIB_NAME = libparcagpucupti.so.$(CUDA_MAJOR)
77

8-
# Default target: build everything for native architecture
9-
all: cupti-all test-infra
8+
# Default target: build all CUDA versions (12 & 13) for both architectures and test infrastructure
9+
all: cupti-all-versions test-infra
1010

1111
# Build libparcagpucupti.so for AMD64 using Docker
1212
cupti-amd64:
@@ -40,12 +40,28 @@ cupti-arm64:
4040
@ln -sf $(LIB_NAME) build/$(CUDA_MAJOR)/arm64/libparcagpucupti.so
4141
@echo "ARM64 library built: build/$(CUDA_MAJOR)/arm64/$(LIB_NAME)"
4242

43-
# Build both architectures for current CUDA version
43+
# Build both architectures for current CUDA version (controlled by CUDA_MAJOR variable)
44+
# Example: make cupti-all CUDA_MAJOR=13
4445
cupti-all: cupti-amd64 cupti-arm64
4546

46-
# Build runtime container with both CUDA versions for both architectures
47-
# Note: Builds but doesn't load into Docker (multi-platform images can't be loaded)
48-
# Use docker-push to push to a registry, or remove one platform to load locally
47+
# Build all local artifacts: CUDA 12 & 13 for both amd64 and arm64
48+
# This extracts the .so files to build/12/{amd64,arm64}/ and build/13/{amd64,arm64}/
49+
# Use this target when you want local build artifacts for testing
50+
cupti-all-versions:
51+
@echo "=== Building all CUDA versions (12 and 13) for both architectures ==="
52+
@$(MAKE) cupti-amd64 CUDA_MAJOR=12 CUDA_FULL_VERSION=12.9.1
53+
@$(MAKE) cupti-arm64 CUDA_MAJOR=12 CUDA_FULL_VERSION=12.9.1
54+
@$(MAKE) cupti-amd64 CUDA_MAJOR=13 CUDA_FULL_VERSION=13.0.2
55+
@$(MAKE) cupti-arm64 CUDA_MAJOR=13 CUDA_FULL_VERSION=13.0.2
56+
@echo "=== All artifacts built ==="
57+
@echo "CUDA 12 amd64: build/12/amd64/libparcagpucupti.so.12"
58+
@echo "CUDA 12 arm64: build/12/arm64/libparcagpucupti.so.12"
59+
@echo "CUDA 13 amd64: build/13/amd64/libparcagpucupti.so.13"
60+
@echo "CUDA 13 arm64: build/13/arm64/libparcagpucupti.so.13"
61+
62+
# Build runtime container image with both CUDA versions for both architectures
63+
# Note: This builds a Docker image but doesn't extract local artifacts or load into Docker
64+
# Multi-platform images stay in buildx cache. Use docker-push to push to registry.
4965
cross:
5066
@echo "=== Building runtime container for AMD64 and ARM64 (includes CUDA 12 and 13) ==="
5167
@docker buildx create --name parcagpu-builder --use --bootstrap 2>/dev/null || docker buildx use parcagpu-builder
@@ -57,19 +73,6 @@ cross:
5773
.
5874
@echo "Runtime container built for both platforms (cached, not loaded into Docker)"
5975

60-
# Build all artifacts (CUDA 12 & 13 for both amd64 and arm64)
61-
cupti-all-versions:
62-
@echo "=== Building all CUDA versions (12 and 13) for both architectures ==="
63-
@$(MAKE) cupti-amd64 CUDA_MAJOR=12 CUDA_FULL_VERSION=12.9.1
64-
@$(MAKE) cupti-arm64 CUDA_MAJOR=12 CUDA_FULL_VERSION=12.9.1
65-
@$(MAKE) cupti-amd64 CUDA_MAJOR=13 CUDA_FULL_VERSION=13.0.2
66-
@$(MAKE) cupti-arm64 CUDA_MAJOR=13 CUDA_FULL_VERSION=13.0.2
67-
@echo "=== All artifacts built ==="
68-
@echo "CUDA 12: build/12/amd64/libparcagpucupti.so.12"
69-
@echo "CUDA 12: build/12/arm64/libparcagpucupti.so.12"
70-
@echo "CUDA 13: build/13/amd64/libparcagpucupti.so.13"
71-
@echo "CUDA 13: build/13/arm64/libparcagpucupti.so.13"
72-
7376
# CUDA header image configuration
7477
# Can be overridden to use local images (e.g., make cupti-all CUDA_12_HEADERS=cuda-headers:12)
7578
CUDA_HEADERS_REGISTRY ?= ghcr.io/parca-dev/cuda-headers

0 commit comments

Comments
 (0)