Skip to content
Snippets Groups Projects
prerequisites.pandoc 7.93 KiB
Newer Older
+++
date = "2017-01-14T22:56:13+01:00"
title = "Set Up Prerequisites"
author = "Lars Bilke"
weight = 1002

[menu]
  [menu.devguide]
    parent = "getting-started"
+++

## Minimum requirements

The minimum prerequisites to build OGS are:

- An 64-bit operating system (Linux, Windows 7 and up, macOS)
Lars Bilke's avatar
Lars Bilke committed
- Git (version control tool, at least version {{< dataFile "versions.minimum_version.git" >}})
- CMake (build configuration tool, at least version {{< dataFile "versions.minimum_version.cmake" >}})
Lars Bilke's avatar
Lars Bilke committed
- A compiler with [C++17](http://en.wikipedia.org/wiki/C%2B%2B17)-support
Lars Bilke's avatar
Lars Bilke committed
- [Conan package manager](https://www.conan.io/) (at least version {{< dataFile "versions.minimum_version.conan" >}}) **OR** install [required libraries]({{< ref "third-party-libraries.pandoc" >}}) manually (for advanced users only!)

## Step: Install a compiler

::: {.win}
As we use lots of features of the C++17-standard we support **Visual Studio {{< dataFile "versions.minimum_version.msvc.year" >}}** and up. Therefore you will need at least **Windows 7** (64-bit recommended). It is perfectly fine to use the free Community Edition of Visual Studio.
- Download and install [Visual Studio Community](https://www.visualstudio.com)
  - Select the *workload* `Desktop Development with C++`
  - You can uncheck everything else
- When installation finished please start Visual Studio once (when asked for credentials enter your Microsoft account or click on **Skip for now**)
:::

::: {.linux}
If you have a recent linux distribution you should also have a recent gcc. Please check that you have at least **gcc {{< dataFile "versions.minimum_version.gcc" >}}**:
gcc (GCC) {{< dataFile "versions.minimum_version.gcc" >}}.0
```
:::

::: {.mac}
Please install Xcode from the App Store. Then please run the following command in the terminal to install the command line tools:

```bash
$ xcode-select --install
```

Open Xcode one time to install some other Xcode stuff.

Now also install the [Homebrew](http://brew.sh) package manager:

```bash
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
$ brew doctor
```

The Homebrew package manager is needed for installing other libraries and packages. It is just like a linux package manager.
:::

## Step: Install Git

Git is a powerful and distributed version control system. OGS source code is hosted on [GitHub](https://github.com/ufz/ogs). See the developer guide page on [Code Reviews]({{< ref "code-reviews" >}}) for more info on how OGS uses GitHub for collaborative development.
Lars Bilke's avatar
Lars Bilke committed
Download and install git from the [git homepage](http://git-scm.com/download/win). Use the default installer options but also enable `Enable symbolic links` under the *Configuring extra options* page.

![Enable symbolic links option](../git-installer-win.png)

This install a new command line called *Git Bash* which should be used for all git operations.

Let Git know who you are:

```bash
$ git config --global user.name "Your Name Here"
$ git config --global user.email "your_email@example.com"
```

In some corporate environments you may have to use a proxy server. In this case tell git about it:

```bash
git config --global http.proxy http://yourproxy.example.com
```
:::

::: {.linux}
Please check if Git is already installed:

```bash
$ git --version
git version {{< dataFile "versions.minimum_version.git" >}}
Otherwise please install Git with your favorite package manager:

```bash
$ sudo yum install git      // RPM-based systems
$ sudo apt-get install git  // Debian-based systems
```

Let Git know who you are:

```bash
$ git config --global user.name "Your Name Here"
$ git config --global user.email "your_email@example.com"
```

Optionally enable password storing when interacting with a remote server:

```bash
$ git config --global credential.helper store
```

In some corporate environments you may have to use a proxy server. In this case tell git about it:

```bash
git config --global http.proxy http://yourproxy.example.com
```
:::

::: {.mac}
Install Git with Homebrew:

```bash
$ brew install git
```

Let Git know who you are:

```bash
$ git config --global user.name "Your Name Here"
$ git config --global user.email "your_email@example.com"
```

The [graphical GitHub client](http://mac.github.com/) is also maybe worth a look.

In some corporate environments you may have to use a proxy server. In this case tell git about it:

```bash
git config --global http.proxy http://yourproxy.example.com
```
:::


## Step: Install Git LFS

[Git LFS](https://git-lfs.github.com/) (large file storage) is a git extension dealing with large binary files such as images and is used for the documentation. You don't need to worry about anything but you need to install the extension as it is not a part of standard git.

::: {.win}
Lars Bilke's avatar
Lars Bilke committed
- Git LFS is already part of your regular git installation, to enable it run: `git lfs install` in the command line
:::

::: {.linux}
Install via [PackageCloud](https://packagecloud.io/):

```bash
$ curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash
$ sudo apt-get install git-lfs
$ git lfs install
```
:::

::: {.mac}
Install with Homebrew:

```bash
$ brew install git-lfs
$ git lfs install
```
:::

::: {.note}
### <i class="far fa-info-circle"></i> Git LFS installation without admin rights

If you do not have rights to install a system package (e.g. on cluster systems) you can [download](https://github.com/git-lfs/git-lfs/releases/latest) a precompiled `git-lfs` executable. Simply put it into your `PATH` and everything should work (remember to run `git lfs install` once!). See also: <https://github.com/git-lfs/git-lfs/wiki/Installation#other>
:::


## Step: Install Python 3

- [Download the Python 3 installer](https://www.python.org/ftp/python/3.7.2/python-3.7.2-amd64-webinstall.exe)
- Install with the following options
  - Check *Add Python 3.X to PATH*
  - *Customize installation*
  - Make sure to have `pip` enabled (you may uncheck *Documentation*, *tcl/tk*, *Python test suite*)
  - You may check *Install for all users*
  - Check *Add Python to environment variables*!

sudo apt-get install python3 python3-pip
Install Python 3 with Homebrew:
- Download the installer, at the [CMake download page](http://www.cmake.org/cmake/resources/software.html) choose the **Windows (Win32 Installer)**.
- Execute the installer, please check the **Add CMake to the system path for all users**-option
Install CMake via Kitware's APT Repository (for Ubuntu 18.04 onwards):
$ sudo apt-get update
$ sudo apt-get install apt-transport-https ca-certificates gnupg software-properties-common wget
$ wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | sudo apt-key add -
$ sudo apt-add-repository 'deb https://apt.kitware.com/ubuntu/ bionic main'
$ sudo apt-get update
$ sudo apt-get install cmake
For other linux distributions you want to use your distributions package manager, [pip](https://pypi.org/project/cmake/) or [snap](https://snapcraft.io/cmake).
Install CMake with Homebrew:
```
:::

## Step: Install Conan package manager

The [Conan package manager](https://www.conan.io) helps to install all required libraries in a convenient way on every platform. If you prefer you can also [install libraries manually]({{< ref "third-party-libraries.pandoc" >}}) instead.

Lars Bilke's avatar
Lars Bilke committed
Install Conan (>= {{< dataFile "versions.minimum_version.conan" >}}) with Python's pip:

```bash
pip3 install --user conan
Lars Bilke's avatar
Lars Bilke committed
This installed `conan` to `.local/bin` (or `C:\Users\[username]\AppData\Roaming\Python\Python37\Scripts` on Windows) in your home directory. Make sure to have this directory in your `PATH`!
Check on a newly opened command line if Conan was installed successfully:
Lars Bilke's avatar
Lars Bilke committed
Conan version {{< dataFile "versions.minimum_version.conan" >}}