0

This question already has an answer here:

I am currently trying to install some executable files in the cluster supported by my academic institution. When running the installation for a particular executable, I am asked to update my CMake version to at least 3.1 (the cluster currently has CMake 2.7). However, I am not a sudoer in the system and can't use 'sudo' or 'apt-get'.

Thus, I am trying to install CMake from source, and the cluster runs on Linux. I've search online on how to do this, but I always run into the trouble of having to use 'sudo', 'apt-get' or './bootstap' which I do not have and can't get without the 'sudo' command. What is the easiest way to install CMake on my home directory and instruct the cluster to run the new CMake version without using sudo?

marked as duplicate by Thomas, Eric Carvalho, waltinator, Kevin Bowen, David Foerster Jul 10 '18 at 9:31

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

0

CMake appears to follow the convention of allowing an installation prefix to be defined at build time. If you run

./bootstrap --help

or consult the provided README.rst file

You need to have a C++ compiler (supporting C++11) and a make installed. Run the bootstrap script you find in the source directory of CMake. You can use the --help option to see the supported options. You may use the --prefix=<install_prefix> option to specify a custom installation directory for CMake. You can run the bootstrap script from within the CMake source directory or any other build directory of your choice. Once this has finished successfully, run make and make install.

The choice of directory is up to you, but for example you could run

./bootstrap --prefix=$HOME/opt/cmake3.12.0
make
make install

to install everything under the root $HOME/opt/cmake3.12.0 without requiring elevated permissions.

  • Further information can be found on cmake.org/install – abu_bua Jul 8 '18 at 21:17
  • Well, so I've tried this by getting the binary online, untaring it and then moving to the cmake-version directory. However, it returns the error './bootstrap command not found'. – Oscar Araiza Bravo Jul 8 '18 at 21:27
  • 1
    @OscarAraizaBravo this answer is about how to "install CMake from source", as per the text of your question – steeldriver Jul 8 '18 at 21:29

Not the answer you're looking for? Browse other questions tagged or ask your own question.