Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
13 lines
749 B
Bash
13 lines
749 B
Bash
#!/usr/bin/env bash
|
|
# Build the CUPTI tracer. Needs the CUDA toolkit headers (cuda.h not required) and the CUPTI redist (include/, lib/).
|
|
# CUPTI=~/cupti ./build.sh -> libleleka_cupti_trace.so (RUNPATH: the build's CUPTI lib dir, ../cupti/lib, ~/work/cupti/lib)
|
|
set -euo pipefail
|
|
here=$(cd "$(dirname "$0")" && pwd)
|
|
CUPTI=${CUPTI:-$HOME/cupti}
|
|
CUDA=${CUDA:-$HOME/cuda-toolkits/13.2.2}
|
|
out=${1:-$here/libleleka_cupti_trace.so}
|
|
g++ -O2 -std=c++17 -fPIC -shared -Wall -Wextra -Wno-unused-parameter -I"$CUPTI/include" -I"$CUDA/include" \
|
|
"$here/cupti_trace.cpp" -o "$out" -L"$CUPTI/lib" -lcupti -lpthread \
|
|
-Wl,-rpath,"$CUPTI/lib" -Wl,-rpath,'$ORIGIN/../cupti/lib' -Wl,-rpath,'/home/para/work/cupti/lib' -Wl,--enable-new-dtags
|
|
echo "built $out"
|