cudalinkerinclude-pathnvcc

Add Permanent Include and Library Path for CUDA C/C++ Compiler


I'm currently doing some work that includes the use of CULA library and GPU Computing SDK's library.

When compiling I have to use the following flags when compiling with NVCC:

-lcutil_x86_64 -lcula_core -lcula_lapack -lcublas -lcudart -lcuda -I$CUDA_SDK_ROOT_DIR/common/inc/ -L$CUDA_SDK_ROOT_DIR/lib/ -L$CULA_LIB_PATH_64

Even though that works just fine, I'm tired of having to specify the include and library paths every time. Is there some way I can run the compiler without having to provide the following arguments:

-I$CUDA_SDK_ROOT_DIR/common/inc/ -L$CUDA_SDK_ROOT_DIR/lib/ -L$CULA_LIB_PATH_64

Solution

  • CUDA ships with documentation for nvcc. The file is nvcc.pdf. In particular read up on the Nvcc.profile file.