[LINUX] Install the latest version of CMake on Ubuntu 18.04.4 LTS

Introduction

Learn how to install the latest version of CMake on Ubuntu.

environment

The version of CMake that I tried to install this time

The easiest installation method

If you want to install CMake most easily, you can install it with apt-get (RHEL system such as CentOS is yum) as follows.

$ sudo apt-get install cmake

However, the version of Cmake you get with this is somewhat older. (I think the version of cmake I checked was 3.10.) The only way to get the latest version (not just the latest version, but other versions as well) is to get it directly from the site.

Install the OpenSSL development package

You will need the OpenSSL development package to install CMake. It can be installed with the following command.

$ sudo apt-get install libssl-dev

You can check the version as follows.

$ dpkg -l | grep libssl
ii  libssl-dev:amd64                                1.1.1-1ubuntu2.1~18.04.5                         amd64        Secure Sockets Layer toolkit - development files

Looking at this, it seems that it is version 1.1.1. By the way, prior to this, OpneSSL itself was updated as follows.

$ sudo apt-get install openssl

After the installation is complete, check the version as follows.

[email protected]:~$ openssl version
OpenSSL 1.1.1  11 Sep 2018

Install CMake

The source code of CMake can be obtained from the following site. https://cmake.org/download/

Here, I installed the latest version of CMake 3.17 at that time. Please note that make must be pre-installed before installation.

Download the source file (hogehoge.tar.gz) from the above site. What is the content of the file after downloading and unzipping it?

$ ls /path/to/cmake-3.17.2
Auxiliary                   CMakeLists.txt     CTestCustom.cmake.in  Help       README.rst  Utilities                 doxygen.config
CMakeCPack.cmake            CMakeLogo.gif      CompileFlags.cmake    Licenses   Source      bootstrap
CMakeCPackOptions.cmake.in  CONTRIBUTING.rst   Copyright.txt         Modules    Templates   cmake_uninstall.cmake.in
CMakeGraphVizOptions.cmake  CTestConfig.cmake  DartConfig.cmake      Packaging  Tests       configure

Just run bootstrap in it and then make. For more information, read the README.rst inside. (In fact, the content written here explains the contents of README.rst as it is)

$ cd /path/to/cmake-3.17.2
$ ./bootstrap && make && make install

This completes the installation. After all is completed, check the version with the cmake command.

$ cmake --version
cmake version 3.17.2

Summary

When I tried it, it got stuck without the OpenSSL development package, but after that it worked fine. I would be grateful if you could let me know if you are stuck.

Recommended Posts

Install the latest version of CMake on Ubuntu 18.04.4 LTS
Use the latest version of PyCharm on Ubuntu
Install the latest version of Git on your Linux server
Install the latest Cuda + CuDNN on Ubuntu 18.04 @ Spring 2020
Install Ubuntu 20.04 LTS (Server) 64bit version on RaspberryPi3B +
Install the latest version of Apache httpd 2.4 from source on Cent OS 8
Put the latest version of Python on linux (Debian) on Chromebook
Steps to install the latest version of OpenCV on OS X El Capitan without Homebrew
Install Pleasant on Ubuntu 20.04 (.NetCore3.1 / PostgreSQL version)
Install pyenv and Python 3.6.8 on Ubuntu 18.04 LTS
At the time of python update on ubuntu
Change the resolution of Ubuntu running on VirtualBox
Install TensorFlow on Ubuntu
Install PySide2 on Ubuntu
Install Docker (Ubuntu 18.04 LTS)
Install JModelica on Ubuntu
Install Python 3.3 on Ubuntu 12.04
Install Theano on Ubuntu 12.04
Install angr on Ubuntu 18.04
Install pip / pip3 on Ubuntu
Steps to install the latest Python on your Mac
The latest version of Pillow 7.0.0 will kill the pytorch transform.
Announcing the availability of Java 11 LTS on Amazon Linux 2
USB Wifi on Ubuntu 20.04LTS
Install the JDK on Linux
Install GoLand IDE on Ubuntu
Install OpenCV on Ubuntu + python
wsl Install PostgreSQL on Ubuntu 18.04
[ROS] Install ROS (melodic) on Ubuntu (18.04)
Install Caffe on Ubuntu 14.04 (GPU)
Install Docker on WSL Ubuntu 18.04
Notes on the version of CUDA, cuDNN where tensorflow-gpu worked
[Personal memo] Install the latest Java on Amazon Linux that already contains Java and switch the version
Install CUDA10.1 + cuDNN7.6.5 + tensorflow-2.3.0 on Ubuntu 18.04
Python 3.4 pyvenv fails on Ubuntu 14.04 LTS
Install Caffe on Ubuntu 14.04 (CPU mode)
Raise the version of pyenv itself
Suspend Thread on Linux (corrected version at the bottom of the article)
[Latest version] Let the bot speak at regular intervals on discord.py
Install Mecab and mecab-python3 on Ubuntu 14.04
Install and run dropbox on Ubuntu 20.04
Change the background of Ubuntu (GNOME)
Install OpenCV and Chainer on Ubuntu
Install CUDA 8.0 and Chainer on Ubuntu 16.04
Install Python 3.8 on Ubuntu 20.04 (OS standard)
Install an older version of Tensorflow
Install xgboost (python version) on Windows
pyenv-change the python version of virtualenv
Change the Python version of Homebrew
Install and manage multiple environments of the same distribution on WSL
Install fabric on Ubuntu and try
Install Python 3.9 on Ubuntu 20.04 (OS standard?)
Install confluent-kafka for Python on Ubuntu
How to update the python version of Cloud Shell on GCP
Install Python 2.7 on Ubuntu 20.04 (OS standard?)
Notes on installing Ubuntu 18.04 on the XPS 15 7590
How to install Go on Ubuntu
Environment construction of "Tello_Video" on Ubuntu
ROS study # 1 Install ros-noetic on ubuntu 20.04
2019 version: Unauthorized access trend analysis (example of general-purpose server on the cloud)
The story of running the asp.net core 3.1 app on arm64 version Amazon Linux 2