From 39c57bca3cbb42b1939a28377d8ef6cfab872450 Mon Sep 17 00:00:00 2001 From: Joshua Bakita Date: Thu, 20 Mar 2025 16:28:52 -0400 Subject: Makefile improvements - Add an "all" build target - Fix build if libcuda.so is not on linker search path - Do not assume that nvcc is available on $PATH - Allow specifying CFLAGS and LDFLAGS when running make - Allow passing non-standard CUDA build locations to make Suggested usage if CUDA is installed in a non-standard location, say, /playpen/jbakita/CUDA/cuda-archive/cuda-12.2: make CUDA=/playpen/jbakita/CUDA/cuda-archive/cuda-12.2 --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index c3f87c4..f4d7cd1 100644 --- a/README.md +++ b/README.md @@ -29,10 +29,10 @@ To build, ensure that you have `gcc` installed and access to the CUDA SDK includ make libsmctrl.a ``` -If you see an error that the command `nvcc` was not found, `nvcc` is not available on your `PATH`. -Correct this error by explictly specifying the location of `nvcc` to `make`, e.g.: +If you see errors about CUDA headers or libraries not being found, your CUDA installation may be in a non-standard location. +Correct this error by explictly specifying the location of the CUDA install `make`, e.g.: ``` -make NVCC=/playpen/jbakita/CUDA/cuda-archive/cuda-10.2/bin/nvcc libsmctrl.a +make CUDA=/playpen/jbakita/CUDA/cuda-archive/cuda-10.2/ libsmctrl.a ``` For binary backwards-compatibility to old versions of the NVIDIA GPU driver, we recommend building with an old version of the CUDA SDK. @@ -41,7 +41,7 @@ For example, by building against CUDA 10.2, the binary will be compatible with a Older versions of `nvcc` may require you to use an older version of `g++`. This can be explictly specified via the `CXX` variable, e.g.: ``` -make NVCC=/playpen/jbakita/CUDA/cuda-archive/cuda-8.0/bin/nvcc CXX=g++-5 libsmctrl.a +make CUDA=/playpen/jbakita/CUDA/cuda-archive/cuda-8.0/ CXX=g++-5 libsmctrl.a ``` `libsmctrl` supports being built as a shared library. -- cgit v1.2.2