ubuntu18.04cmake安装
时间: 2023-04-20 19:01:26 浏览: 390
要在Ubuntu 18.04上安装CMake,可以按照以下步骤进行操作:
1. 打开终端并输入以下命令以更新软件包列表:
sudo apt update
2. 安装CMake:
sudo apt install cmake
3. 验证CMake是否已成功安装:
cmake --version
如果成功安装,将显示CMake的版本号。
希望这可以帮助您在Ubuntu 18.04上安装CMake。
相关问题
ubuntu18.04cmake3.16安装
要在Ubuntu 18.04上安装CMake 3.16版本,可以按照以下步骤进行操作:
1. 安装CMake 3.19的apt密钥和存储库:
```
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | sudo apt-key add -
sudo apt-add-repository 'deb https://apt.kitware.com/ubuntu/ bionic main'
sudo apt-get update
```
2. 下载CMake 3.16的源码包:
```
wget https://cmake.org/files/v3.16/cmake-3.16.0.tar.gz
```
3. 解压源码包:
```
tar -xvzf cmake-3.16.0.tar.gz
```
4. 进入解压后的目录:
```
cd cmake-3.16.0
```
5. 运行bootstrap命令:
```
./bootstrap
```
6. 编译CMake:
```
make
```
7. 安装CMake:
```
sudo make install
```
8. 建立软链接:
```
sudo ln -sf /usr/local/bin/cmake /usr/bin/cmake
```
9. 检查安装的CMake版本:
```
cmake --version
```
通过以上步骤,您将成功安装CMake 3.16版本,并可以在Ubuntu 18.04上使用它。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [Ubuntu18.04安装cmake](https://blog.csdn.net/weixin_43642204/article/details/125592481)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *2* [ubuntu18升级/安装cmake 超详细(亲测成功,2022年7月13日)](https://blog.csdn.net/weixin_42035347/article/details/125763949)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
ubuntu18.04 cmake
在Ubuntu 18.04中安装CMake的方法有几种:
1. 通过.sh文件安装:
在终端中运行以下命令:
sudo sh cmake-3.22.3-linux-x86_64.sh --prefix=/usr/local --exclude-subdir
这将以.sh文件的方式安装CMake。
2. 通过apt-get方式安装:
在终端中运行以下命令:
sudo apt-get install cmake
这将使用apt-get命令从Ubuntu官方仓库安装CMake。
3. 通过源代码方式安装:
下载CMake的源代码包,可以通过以下命令下载:
wget https://github.com/Kitware/CMake/releases/download/v3.22.3/cmake-3.22.3.tar.gz
解压下载的源代码包:
tar -zxvf cmake-3.22.3.tar.gz
进入解压后的CMake源代码目录并执行bootstrap脚本:
cd cmake-3.22.3
./bootstrap --parallel=32
执行make命令编译CMake:
make -j32
执行make install命令安装CMake:
make install -j32
创建CMake软链接:
ln -s /usr/local/bin/cmake /usr/bin/cmake
通过cmake --version命令查看CMake版本。
如需卸载CMake,可以运行以下命令:
sudo apt-get autoremove cmake
以上是在Ubuntu 18.04中安装和卸载CMake的步骤。以上步骤参考了中的安装和卸载方式。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [ubuntu18.04下--CMake教程](https://blog.csdn.net/ch_ccc/article/details/123375901)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *2* *3* [在Ubuntu18.04下的Cmake使用记录](https://blog.csdn.net/m0_37957160/article/details/113179076)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文