jetsom compile

This commit is contained in:
awe
2026-09-17 19:26:22 +03:00
parent e202f57ef8
commit fa9da949df
4 changed files with 69 additions and 8 deletions
+12 -2
View File
@@ -11,12 +11,22 @@ BIN_DIR := $(BUILD_DIR)/bin
# --- gpr_cpp: external C++/CUDA 3D SAR library (VNA_AlGo). Build it first with
# `bash $(GPR_CPP_DIR)/build_cmake.sh`; it is NOT built by this Makefile. CUDA
# headers and libnvrtc come from the pip nvidia-* packages inside the VNA_AlGo
# venv (same detection as build_cmake.sh); libcuda is the system driver.
GPR_CPP_DIR ?= /home/awe/Documents/VNA_AlGo/gpr_cpp
# venv (same detection as build_cmake.sh); when those are absent (e.g. Jetson,
# where CUDA comes with JetPack) the system toolkit at /usr/local/cuda is used.
# libcuda is always the system driver.
GPR_CPP_DIR ?= $(HOME)/Documents/VNA_AlGo/gpr_cpp
GPR_CPP_LIB ?= $(GPR_CPP_DIR)/build/libgpr_core_cpp.a
GPR_VENV ?= $(GPR_CPP_DIR)/../.venv
GPR_CUDA_INC_DIR ?= $(dir $(firstword $(wildcard $(GPR_VENV)/lib/python*/site-packages/nvidia/*/include/nvrtc.h)))
GPR_NVRTC_LIB ?= $(firstword $(wildcard $(GPR_VENV)/lib/python*/site-packages/nvidia/*/lib/libnvrtc.so*))
# System-CUDA fallback. An empty GPR_CUDA_INC_DIR would also corrupt the compile
# command: a bare `-I` swallows the next argument.
ifeq ($(strip $(GPR_CUDA_INC_DIR)),)
GPR_CUDA_INC_DIR := /usr/local/cuda/include
endif
ifeq ($(strip $(GPR_NVRTC_LIB)),)
GPR_NVRTC_LIB := $(firstword $(wildcard /usr/local/cuda/lib64/libnvrtc.so*))
endif
GPR_CUDA_LIB_DIR := $(dir $(GPR_NVRTC_LIB))
# libnvrtc from pip ships only as libnvrtc.so.N (no .so symlink), so link the
# full path; the rpath makes the binary find it without LD_LIBRARY_PATH.