jetson compile fix

This commit is contained in:
awe
2026-09-18 16:34:44 +03:00
parent fa9da949df
commit f0ad4e6185
3 changed files with 16 additions and 3 deletions
+9 -1
View File
@@ -18,15 +18,23 @@ 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)))
# cuda.h can live in a DIFFERENT pip package than nvrtc.h (Jetson: cuda_runtime
# vs cuda_nvrtc); the unified cu13 package on dev machines has both in one dir.
GPR_CUDA_RT_INC_DIR ?= $(dir $(firstword $(wildcard $(GPR_VENV)/lib/python*/site-packages/nvidia/*/include/cuda.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_CUDA_RT_INC_DIR)),)
GPR_CUDA_RT_INC_DIR := /usr/local/cuda/include
endif
ifeq ($(strip $(GPR_NVRTC_LIB)),)
GPR_NVRTC_LIB := $(firstword $(wildcard /usr/local/cuda/lib64/libnvrtc.so*))
endif
# Deduplicated CUDA include flags (a single dir on dev machines).
GPR_CUDA_INC_FLAGS := $(addprefix -I,$(sort $(GPR_CUDA_INC_DIR) $(GPR_CUDA_RT_INC_DIR)))
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.
@@ -34,7 +42,7 @@ DATA_PROCESSOR_LDFLAGS := $(LDFLAGS) $(GPR_CPP_LIB) $(GPR_NVRTC_LIB) -lcuda -Wl,
INCLUDES := \
-I$(GPR_CPP_DIR)/include \
-I$(GPR_CUDA_INC_DIR) \
$(GPR_CUDA_INC_FLAGS) \
-Idata_acq_and_processing/common_cpp/ipc/include \
-Idata_acq_and_processing/common_cpp/config/include \
-Idata_acq_and_processing/third_party \