# How to compile cmake on linux server?

**URL:** https://discourse.cmake.org/t/how-to-compile-cmake-on-linux-server/2188
**Category:** Usage
**Created:** [November 17, 2020, 11:29am UTC](https://discourse.cmake.org/t/how-to-compile-cmake-on-linux-server/2188 "2020-11-17T11:29:16Z")
**Posts on this page:** 18
**Page:** 1

<div class="post-metadata">

### Author: ![Ashish\_K](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/a/2acd7d/32.png) [@Ashish\_K](https://discourse.cmake.org/u/Ashish_K)
#### Post date: [November 17, 2020, 11:29am UTC](https://discourse.cmake.org/t/how-to-compile-cmake-on-linux-server/2188/1 "2020-11-17T11:29:16Z")

</div>

I want to compile cmake in my working folder on one of the super computing facility. I am not sure how to compile it in my working directory. Can anyone please help me in this regard?

–  
Ashish

---

<div class="post-metadata">

### Author: ![snikulov](https://discourse.cmake.org/user_avatar/discourse.cmake.org/snikulov/32/194_2.png) [@snikulov](https://discourse.cmake.org/u/snikulov)
#### Post date: [November 17, 2020, 11:34am UTC](https://discourse.cmake.org/t/how-to-compile-cmake-on-linux-server/2188/2 "2020-11-17T11:34:05Z")

</div>

Have you tried as described in [the documentation](https://cmake.org/install/)?

---

<div class="post-metadata">

### Author: ![Ashish\_K](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/a/2acd7d/32.png) [@Ashish\_K](https://discourse.cmake.org/u/Ashish_K)
#### Post date: [November 20, 2020, 8:03am UTC](https://discourse.cmake.org/t/how-to-compile-cmake-on-linux-server/2188/3 "2020-11-20T08:03:21Z")

</div>

Yes I tried that, but don’t know where I am going wrong. I am not familiar much with coding.

---

<div class="post-metadata">

### Author: ![snikulov](https://discourse.cmake.org/user_avatar/discourse.cmake.org/snikulov/32/194_2.png) [@snikulov](https://discourse.cmake.org/u/snikulov)
#### Post date: [November 20, 2020, 8:19am UTC](https://discourse.cmake.org/t/how-to-compile-cmake-on-linux-server/2188/4 "2020-11-20T08:19:37Z")

</div>

Could you please provide all steps you do?  
What step has failed?  
Could you please provide an error message?

---

<div class="post-metadata">

### Author: ![Ashish\_K](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/a/2acd7d/32.png) [@Ashish\_K](https://discourse.cmake.org/u/Ashish_K)
#### Post date: [November 20, 2020, 8:50am UTC](https://discourse.cmake.org/t/how-to-compile-cmake-on-linux-server/2188/5 "2020-11-20T08:50:43Z")

</div>

1] **./bootstrap** \> this step is working properly.  
2] After this step it is asking me to run **gmake**. and then it is showing following error…

![image](https://discourse.cmake.org/uploads/default/original/1X/652df2ad62b708b575d796506cd42a8264f5019f.png)

---

<div class="post-metadata">

### Author: ![snikulov](https://discourse.cmake.org/user_avatar/discourse.cmake.org/snikulov/32/194_2.png) [@snikulov](https://discourse.cmake.org/u/snikulov)
#### Post date: [November 20, 2020, 9:59am UTC](https://discourse.cmake.org/t/how-to-compile-cmake-on-linux-server/2188/6 "2020-11-20T09:59:17Z")

</div>

Could you please provide the version of Linux/gcc do you using?

---

<div class="post-metadata">

### Author: ![snikulov](https://discourse.cmake.org/user_avatar/discourse.cmake.org/snikulov/32/194_2.png) [@snikulov](https://discourse.cmake.org/u/snikulov)
#### Post date: [November 20, 2020, 10:19am UTC](https://discourse.cmake.org/t/how-to-compile-cmake-on-linux-server/2188/7 "2020-11-20T10:19:53Z")

</div>

one of the options can be to disable testing (since an error in it)

`./bootstrap -- -DBUILD_TESTING=OFF`

---

<div class="post-metadata">

### Author: ![Ashish\_K](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/a/2acd7d/32.png) [@Ashish\_K](https://discourse.cmake.org/u/Ashish_K)
#### Post date: [November 20, 2020, 11:15am UTC](https://discourse.cmake.org/t/how-to-compile-cmake-on-linux-server/2188/8 "2020-11-20T11:15:22Z")

</div>

Now it is showing following error  
 ![image](https://discourse.cmake.org/uploads/default/original/1X/15aa69398f8a4b93fe0ad238b916317be16bbb2f.png)

---

<div class="post-metadata">

### Author: ![snikulov](https://discourse.cmake.org/user_avatar/discourse.cmake.org/snikulov/32/194_2.png) [@snikulov](https://discourse.cmake.org/u/snikulov)
#### Post date: [November 20, 2020, 11:52am UTC](https://discourse.cmake.org/t/how-to-compile-cmake-on-linux-server/2188/9 "2020-11-20T11:52:39Z")

</div>

Looks like your compiler does not supports C++11 standard, even experimental.  
Could you please provide compiler information/version?

---

<div class="post-metadata">

### Author: ![Ashish\_K](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/a/2acd7d/32.png) [@Ashish\_K](https://discourse.cmake.org/u/Ashish_K)
#### Post date: [November 20, 2020, 12:09pm UTC](https://discourse.cmake.org/t/how-to-compile-cmake-on-linux-server/2188/10 "2020-11-20T12:09:34Z")

</div>

Following is the compiler information (I hope I am providing the required information)

![image](https://discourse.cmake.org/uploads/default/original/1X/bd478862b923d2e566735fe9e7eb07e2c5334990.png)

---

<div class="post-metadata">

### Author: ![snikulov](https://discourse.cmake.org/user_avatar/discourse.cmake.org/snikulov/32/194_2.png) [@snikulov](https://discourse.cmake.org/u/snikulov)
#### Post date: [November 20, 2020, 1:07pm UTC](https://discourse.cmake.org/t/how-to-compile-cmake-on-linux-server/2188/11 "2020-11-20T13:07:24Z")

</div>

I’m not sure when CMake make C++11 standard mandatory, but it’s clear to me that you’ll not be able to compile it with gcc 4.1.  
You need a more recent compiler ([at least 4.6](https://en.cppreference.com/w/cpp/compiler_support) IMO).

---

<div class="post-metadata">

### Author: ![fenrir](https://discourse.cmake.org/user_avatar/discourse.cmake.org/fenrir/32/734_2.png) [@fenrir](https://discourse.cmake.org/u/fenrir)
#### Post date: [November 20, 2020, 1:25pm UTC](https://discourse.cmake.org/t/how-to-compile-cmake-on-linux-server/2188/12 "2020-11-20T13:25:53Z")

</div>

Seems it since 3.10 ([https://gitlab.kitware.com/cmake/cmake/-/commit/fd4fd9a276126a1b1044d57a064c3b8201a91a33](https://gitlab.kitware.com/cmake/cmake/-/commit/fd4fd9a276126a1b1044d57a064c3b8201a91a33))

---

<div class="post-metadata">

### Author: ![Ashish\_K](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/a/2acd7d/32.png) [@Ashish\_K](https://discourse.cmake.org/u/Ashish_K)
#### Post date: [November 20, 2020, 1:30pm UTC](https://discourse.cmake.org/t/how-to-compile-cmake-on-linux-server/2188/13 "2020-11-20T13:30:33Z")

</div>

Thank you Sergei for your efforts and valuable time.

---

<div class="post-metadata">

### Author: ![Ashish\_K](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/a/2acd7d/32.png) [@Ashish\_K](https://discourse.cmake.org/u/Ashish_K)
#### Post date: [November 20, 2020, 1:31pm UTC](https://discourse.cmake.org/t/how-to-compile-cmake-on-linux-server/2188/14 "2020-11-20T13:31:57Z")

</div>

Thanks Jakub Zakrzewski. But I am not much familiar with coding, so i didn’t understand much from the given link. Could you please guide me in simple way?

---

<div class="post-metadata">

### Author: ![fenrir](https://discourse.cmake.org/user_avatar/discourse.cmake.org/fenrir/32/734_2.png) [@fenrir](https://discourse.cmake.org/u/fenrir)
#### Post date: [November 20, 2020, 1:34pm UTC](https://discourse.cmake.org/t/how-to-compile-cmake-on-linux-server/2188/15 "2020-11-20T13:34:43Z")

</div>

Nothing really - it’s just a link to a commit that introduced hard C++11 dependency. It was in CMake 3.10, so since this version a compiler supporting C++11 is required for building CMake.

The only 2 things you can do is either to set on CMake 3.9 or upgrade your compiler.

---

<div class="post-metadata">

### Author: ![Ashish\_K](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/a/2acd7d/32.png) [@Ashish\_K](https://discourse.cmake.org/u/Ashish_K)
#### Post date: [November 20, 2020, 1:55pm UTC](https://discourse.cmake.org/t/how-to-compile-cmake-on-linux-server/2188/16 "2020-11-20T13:55:18Z")

</div>

Okay… Thanks! Will try that one

---

<div class="post-metadata">

### Author: ![Ashish\_K](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/a/2acd7d/32.png) [@Ashish\_K](https://discourse.cmake.org/u/Ashish_K)
#### Post date: [November 24, 2020, 1:33pm UTC](https://discourse.cmake.org/t/how-to-compile-cmake-on-linux-server/2188/17 "2020-11-24T13:33:28Z")

</div>

Hi…  
Now I tried with CMake 3.9.6  
Executed following command:  
**./bootstrap – -DCMAKE\_BUILD\_TYPE:STRING=Release**  
It worked properly. Then it asked me to run **gmake**.  
After this when I checked CMake version by **cmake --version** it is showing me older version.

Do I need to execute some more commands? Please suggest.

Regards,  
Ashish

---

<div class="post-metadata">

### Author: ![fenrir](https://discourse.cmake.org/user_avatar/discourse.cmake.org/fenrir/32/734_2.png) [@fenrir](https://discourse.cmake.org/u/fenrir)
#### Post date: [November 24, 2020, 3:08pm UTC](https://discourse.cmake.org/t/how-to-compile-cmake-on-linux-server/2188/18 "2020-11-24T15:08:54Z")

</div>

It’s not enough to compile something. You have to install it somewhere and make sure that somewhere is in your path.  
It’s usually not a good idea to install self-compiled software over the version provided by your package manager. I usually install stuff to ~/local and have ~/local/bin in my PATH.
