wget https://github.com/openssl/openssl/archive/refs/tags/OpenSSL_1_1_1t.tar.gz tar zxf OpenSSL_1_1_1t.tar.gz cd openssl-OpenSSL_1_1_1t ./config --prefix=/opt/openssl --openssldir=/opt/openssl -fPIC no-shared no-afalgeng -static make sudo make install_sw install_ssldirs
wget https://github.com/Kitware/CMake/releases/download/v3.22.1/cmake-3.22.1.tar.gz tar zxf cmake-3.22.1.tar.gz cd cmake-3.22.1 ./configure gmake sudo make install
安装完成:
1 2 3 4 5 6 7 8 9 10 11
$ which cmake /usr/local/bin/cmake $ cmake --version cmake version 3.22.1
CMake suite maintained and supported by Kitware (kitware.com/cmake). $ ccmake --version ccmake version 3.22.1
CMake suite maintained and supported by Kitware (kitware.com/cmake).
5️⃣ 安装 LLVM/Clang
在 CentOS 7 下,gcc 版本为 4.8 过于老旧,需要临时切换到 gcc 10。
1 2 3 4 5 6 7
$ scl enable devtoolset-10 bash $ gcc --version gcc (GCC) 10.2.1 20210130 (Red Hat 10.2.1-11) Copyright (C) 2020 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
[shawnyan@centos7 build]$ ninja [185/3417] Building CXX object utils/TableGen/CMakeFiles/llvm-tblgen.dir/CodeGenRegisters.cpp.o In file included from /home/shawnyan/llvm-project/llvm/utils/TableGen/CodeGenRegisters.h:25, from /home/shawnyan/llvm-project/llvm/utils/TableGen/CodeGenRegisters.cpp:14: /home/shawnyan/llvm-project/llvm/include/llvm/ADT/SparseBitVector.h: In member function 'unsigned int llvm::CodeGenRegister::getWeight(const llvm::CodeGenRegBank&) const': /home/shawnyan/llvm-project/llvm/include/llvm/ADT/SparseBitVector.h:129:15: warning: array subscript 2 is above array bounds of 'const BitWord [2]' {aka 'const long unsigned int [2]'} [-Warray-bounds] 129 | if (Bits[i] != 0) | ~~~~^ ... -- Could not find ParallelSTL, libc++abi will not attempt to use it but the build may fail if the libc++ in use needs it to be available. -- Configuring done -- Generating done CMake Warning: Manually-specified variables were not used by the project:
-- Build files have been written to: /home/shawnyan/llvm-project/build/runtimes/runtimes-bins [3414/3417] Performing build step for 'runtimes' [516/516] Linking CXX static library /home/shawnyan/llvm-project/build/lib/x86_64-unknown-linux-gnu/libc++abi.a [3415/3417] No install step for 'runtimes' [3417/3417] Completed 'runtimes'