Make and Cmake
1.  cmake
1.1. Find CUDA
find_package(CUDAToolkit [
Some default environment variable will be searched, such as CUDAToolkit_ROOT.
More information
1.2.  The difference between LD_LIBRARY_PATH and LIBRARY_PATH
LD_LIBRARY_PATH enables the system to locate dynamic libraries during runtime.
LIBRARY_PATH directs the compiler to locate dynamic libraries during
compilation.
1.3. Libtorch
The CmakeLists.txt is as follow.
1  | cmake_minimum_required(VERSION 3.10 FATAL_ERROR)  | 
It will use /usr/bin/gcc and /usr/bin/g++ to compile the source files. When
I add
1  | set(CMAKE_C_COMPILER /usr/bin/gcc-13)  | 
into the CmakeLists.txt, it reports
The C compiler identification is GNU 13.3.0. However, it also use
/usr/bin/gcc and /usr/bin/g++ to compile the source files. Only if i
rm /usr/bin/g++, and ln -s /usr/bin/g++-13 /usr/bin/g++, it will use g++13.
The path of standard include directory for g++ is embeded in the binary file of
g++, and it has nothing with CmakeLists.txt.
2.  make
2.1. Some Symbols
$@ means the target file
$^ means all the dependences
$< means the first dependence
$? means the dependences newer than the target file