Installing cmake on ubuntu app on Windows (based on the sub system for Linux)
One of the best things that ever happened to Windows was the enabling of a sub system for Linux. The Windows sub system for Linux allows devs to run Linux environments on Windows without using Virtual machines.
To make things even better, operating systems (like ubuntu) can be downloaded as apps from the Windows Store!
This post explains how cmake can be installed on the ubuntu app.
- Open cmd and run the command ubuntu to start running the ubuntu app
- Download the version of cmake you want from https://cmake.org/download/. I will be using the latest version at the time of publishing this post (cmake-3.11.4), and will be downloading it in the E drive. You can do it in a drive of your choice.
- In the ubuntu app, run cd mnt
- Now run cd <drive where you downloaded cmake>. For me this is cd e
- If the downloaded file is a .gz file, run the command tar -xvf cmake-3.11.4-tar.gz. This will unpack the zipped file.
- After unpacking, a new folder named cmake-3.11.4 will be present in your working directory. Note that the folder's name may vary depending on the version you download.
- Run cd <cmake folder name>. For me this is cd cmake-3.11.4
- Run the command ./configure. Now the installer checks whether the dependencies are satisfied or not.
- Generally, the ubuntu app comes pre-packaged with gcc compiler. However, there is no compiler for C++ pre-packaged (when this post was published).
- The ./configure command will run into an error if no compiler for C++ is installed.
- I installed g++ (a compiler for C++) using the command sudo apt-get install g++ to overcome this issue
- Next, you will need an appropriate makefile processor installed. If it is not installed, ./configure command will run into an error Cannot find appropriate Makefile processor on this system
- To fix this, run sudo apt-get install build-essential
- Typing ./configure after installing g++ and build-essential should finish your installation without any further hassles. In case these were already installed, you most probably wouldn't have run into any of the above mentioned errors
Comments
Post a Comment