本家様 https://cmake.org/

ひと昔なら

./configure
make
make check
make install

でソースからコンパイルはOKだったと思うのだが、最近はCMakeを使うシーンが多い.
っでこのCMakeですが、パッケージごとに要求するversionがまちまちで、たとえ最新のOSでもCMakeは別途調達する必要が生じる

ここでは CMake-3.26.3 を RockyLInux9 に入れてみる

[root@rockylinux9 ~]# cat /etc/redhat-release
Rocky Linux release 9.1 (Blue Onyx)
 
[root@rockylinux9 ~]#
[root@rockylinux9 ~]# dnf list installed cmake
Installed Packages
cmake.x86_64                          3.20.2-7.el9                          @appstream
[root@rockylinux9 ~]#

とCMake-3.20.2なのだが最新にしてみる
取得はhttps://cmake.org/download/にて行える. 取得するファイルですが、
ここでは「cmake-3.26.3-linux-x86_64.sh」にしてみた.

[root@rockylinux9 ~]# cd /apps/src/
[root@rockylinux9 src]#
[root@rockylinux9 src]# wget https://github.com/Kitware/CMake/releases/download/v3.26.3/cmake-3.26.3-linux-x86_64.sh
 
[root@rockylinux9 src]# ls -lh cmake-3.26.3-linux-x86_64.sh
-rw-r--r--. 1 root root 47M Apr  5 05:02 cmake-3.26.3-linux-x86_64.sh
 
[root@rockylinux9 src]#
[root@rockylinux9 src]# bash ./cmake-3.26.3-linux-x86_64.sh --help
Usage: ./cmake-3.26.3-linux-x86_64.sh [options]
Options: [defaults in brackets after descriptions]
  --help            print this message
  --version         print cmake installer version
  --prefix=dir      directory in which to install
  --include-subdir  include the cmake-3.26.3-linux-x86_64 subdirectory
  --exclude-subdir  exclude the cmake-3.26.3-linux-x86_64 subdirectory
  --skip-license    accept license
 
[root@rockylinux9 src]# mkdir /apps/cmake-3.26.3    <--- インストール先を掘っておきます
 
[root@rockylinux9 src]# bash ./cmake-3.26.3-linux-x86_64.sh --prefix=/apps/cmake-3.26.3 --skip-license
 
CMake Installer Version: 3.26.3, Copyright (c) Kitware
This is a self-extracting archive.
The archive will be extracted to: /apps/cmake-3.26.3
 
Using target directory: /apps/cmake-3.26.3
Extracting, please wait...
 
Unpacking finished successfully
 
[root@rockylinux9 src]# ls -lF /apps/cmake-3.26.3/
total 0
drwxr-xr-x.  2 root root  76 Apr  5 04:10 bin/
drwxr-xr-x.  3 root root  19 Apr  5 04:10 doc/
drwxr-xr-x.  4 root root  30 Apr  5 04:10 man/
drwxr-xr-x. 10 root root 131 Apr  5 04:10 share/
[root@rockylinux9 src]#

EnvironmentModulesを用意します.

[root@rockylinux9 ~]# mkdir -p /apps/modulefiles/cmake
 
[root@rockylinux9 ~]# vi /apps/modulefiles/cmake/3.26.3
#%Module1.0
 
set root /apps/cmake-3.26.3
prepend-path PATH $root/bin
 
[root@rockylinux9 ~]#

トップ   編集 添付 複製 名前変更     ヘルプ   最終更新のRSS
Last-modified: 2023-05-07 (日) 00:44:19 (34d)