mirror of
1
0
Fork 0

Merge branch 'henryiii-installing' into 'master'

Installing updates

Closes #17

See merge request CLIUtils/modern-cmake!22
This commit is contained in:
Henry Schreiner 2019-09-23 20:01:19 +00:00
commit df3a6f19af
1 changed files with 38 additions and 10 deletions

View File

@ -6,11 +6,30 @@ Your CMake version should be newer than your compiler. It should be newer than t
If you have a built in copy of CMake, it isn't special or customized for your system. You can easily install a new one instead, either on the system level or the user level. Feel free to instruct your users here if they complain about a CMake requirement being set too high. Especially if they want < 3.1 support. Maybe even if they want CMake < 3.15 support...
#### Quick list (more info on each method below)
Ordered by author preference:
* All
- [Pip][PyPI] (official, sometimes delayed slightly)
- [Anaconda][] / [Conda-Forge][]
* Windows
- [Chocolaty][]
- [Download binary][download] (official)
* MacOS
- [Homebrew][]
- [MacPorts][]
- [Download binary][download] (official)
* Linux
- [Snapcraft][snap] (official)
- [APT repository][apt] (Ubuntu/Debian only) (official)
- [Download binary][download] (official)
## Official package
You can [download CMake from KitWare][cmake-download]. This is how you'll probably get CMake if you are on Windows. It's not a bad way to get it on macOS either, but using `brew install cmake` is much nicer if you use [Homebrew](https://brew.sh) (and you should).
You can [download CMake from KitWare][download]. This is how you will probably get CMake if you are on Windows. It's not a bad way to get it on macOS either, but using `brew install cmake` is much nicer if you use [Homebrew](https://brew.sh) (and you should). You can also get it on most other package managers, such as [Chocolaty](https://chocolatey.org) for Windows or [MacPorts](https://www.macports.org) for macOS.
On Linux, there are binaries provided, but you'll need to pick an install location. If you already use `~/.local` for user-space packages, the following single line command[^1] will get CMake for you [^2]:
On Linux, there are several options. Kitware provides a [Debian/Ubunutu apt repository][apt], as well as [snap packages][snap]. There are universal Linux binaries provided, but you'll need to pick an install location. If you already use `~/.local` for user-space packages, the following single line command[^1] will get CMake for you [^2]:
{% term %}
~ $ wget -qO- "https://cmake.org/files/v3.15/cmake-3.15.3-Linux-x86_64.tar.gz" | tar --strip-components=1 -xz -C ~/.local
@ -50,11 +69,12 @@ Here are some common build environments and the CMake version you'll find on the
| [Ubuntu 18.10: Cosmic](https://launchpad.net/ubuntu/cosmic/+source/cmake) | 3.12.1 | |
| [Ubuntu 19.04: Disco](https://launchpad.net/ubuntu/disco/+source/cmake) | 3.13.4 | |
| [AlpineLinux 3.10](https://pkgs.alpinelinux.org/packages?name=cmake&branch=v3.10)| 3.14.5 | Useful in Docker |
| [Python PyPI](https://pypi.org/project/cmake/) | 3.14.4 | Just `pip install cmake` on many systems. Add `--user` for local installs. (ManyLinux1 (old pip or OS) gets CMake 3.13.3)|
| [Anaconda](https://anaconda.org/anaconda/cmake) | 3.14.0 | For use with Conda |
| [Conda-Forge](https://github.com/conda-forge/cmake-feedstock) | 3.15.1 | For use with Conda |
| [Homebrew on macOS](https://formulae.brew.sh/formula/cmake) | 3.15.3 | On macOS with Homebrew, this is only a few minutesa behind cmake.org. |
| [Chocolaty on Windows](https://chocolatey.org/packages/cmake) | 3.15.3 | Also up to date. The normal cmake.org installers are common on Windows, as well. |
| [Python PyPI][PyPI] | 3.15.3 | Just `pip install cmake` on many systems. Add `--user` for local installs. (ManyLinux1 (old pip or OS) gets CMake 3.13.3)|
| [Anaconda][] | 3.14.0 | For use with Conda |
| [Conda-Forge][] | 3.15.3 | For use with Conda |
| [Homebrew on macOS][homebrew] | 3.15.3 | On macOS with Homebrew, this is only a few minutesa behind cmake.org. |
| [MacPorts on macOS][macports] | 3.15.3 | Useful if you use MacPorts. |
| [Chocolaty on Windows][chocolaty] | 3.15.3 | Also up to date. The normal cmake.org installers are common on Windows, as well. |
| TravisCI Trusty | 3.9 | The December 2017 update added a recent version of clang and CMake! Finally! |
| TravisCI Xenial | 3.12.4 | Mid November 2018 this image became ready for widescale use. |
@ -62,7 +82,7 @@ Also see [pkgs.org/download/cmake](https://pkgs.org/download/cmake).
## Pip
This is also provided as an official package, maintained by the authors of CMake at KitWare. It's a rather new method, and might fail on some systems (Alpine isn't supported last I checked, but that has CMake 3.8), but works really well when it works (like on Travis CI). If you have pip (Python's package installer), you can do:
[This][PyPI] is also provided as an official package, maintained by the authors of CMake at KitWare. It's a rather new method, and might fail on some systems (Alpine isn't supported last I checked, but that has CMake 3.8), but works really well when it works (like on Travis CI). If you have pip (Python's package installer), you can do:
```term
gitbook $ pip install cmake
@ -80,5 +100,13 @@ Personally, on Linux, I put versions of CMake in folders, like `/opt/cmake312` o
[^1]: I assume this is obvious, but you are downloading and running code, which exposes you to a man in the middle attack. If you are in a critical environment, you should download the file and check the checksum. (And, no, simply doing this in two steps does not make you any safer, only a checksum is safer).
[^2]: If you don't have a `.local` in your home directory, it's easy to start. Just make the folder, then add `export PATH="$HOME/.local/bin:$PATH"` to your `.bashrc` or `.bash_profile` or `.profile` file in your home directory. Now you can install any packages you build to `-DCMAKE_INSTALL_PREFIX=~/.local` instead of `/usr/local`!
[cmake-download]: https://cmake.org/download/
[LMod]: http://lmod.readthedocs.io/en/latest/
[LMod]: http://lmod.readthedocs.io/en/latest/
[apt]: https://apt.kitware.com/
[snap]: https://snapcraft.io/cmake
[PyPI]: https://pypi.org/project/cmake/
[chocolaty]: https://chocolatey.org/packages/cmake
[anaconda]: https://anaconda.org/anaconda/cmake
[conda-forge]: https://github.com/conda-forge/cmake-feedstock
[download]: https://cmake.org/download/
[homebrew]: https://formulae.brew.sh/formula/cmake
[macports]: https://ports.macports.org/port/cmake/summary