Make and Cmake
1. Make
1.1. Some Symbols
$@
means the target file
$^
means all the dependences
$<
means the first dependence
$?
means the dependences newer than the target file
2. Cmake
2.1. 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
.