See the blog post for information.
Code forked from the GitHub repository.
# clone the repository
git clone [email protected]:fwyzard/cuda-linking.git
cd cuda-linking
# build and link with nvcc
make clean nvcc
LD_LIBRARY_PATH=$PWD:$LD_LIBRARY_PATH ./app
# build with nvcc, link explicitly with nvlink/fatbin
make clean nvlink
LD_LIBRARY_PATH=$PWD:$LD_LIBRARY_PATH ./app
# build with clang, link explicitly with nvlink/fatbin
make clean clang
LD_LIBRARY_PATH=$PWD:$LD_LIBRARY_PATH ./app