Skip to content

Commit

Permalink
Add windows build instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
magnesj committed Oct 7, 2024
1 parent ca3a557 commit ff591e7
Show file tree
Hide file tree
Showing 10 changed files with 102 additions and 173 deletions.
2 changes: 1 addition & 1 deletion content/getting-started/Overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ When ResInsight is compiled with ABAQUS-odb support, _`*.odb`_ files can be impo

The geomechanical cases are sorted into its own folder in the project tree named **Geomechanical Models** {{< image-in-text src="images/getting-started/GeoMechCases24x24.png" >}} as opposed to the **Grid Models** folder where the Eclipse cases and **Grid Case Groups** resides.

See [Build Instructions]({{< ref "buildinstructions.md" >}}) on how to compile ResInsight with odb-support.
See [Build Instructions]({{< ref "cmake-configuration.md" >}}) on how to compile ResInsight with odb-support.

#### Grid Case Groups

Expand Down
2 changes: 1 addition & 1 deletion content/getting-started/download-and-install/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ See the following for common install procedures and options:

- [ Windows Installation ]({{< ref "windows-installation.md" >}})

See [ Build Instructions ]({{< ref "buildinstructions.md" >}}) for the complete list of configuration options including support for
See [ Build Instructions ]({{< ref "cmake-configuration.md" >}}) for the complete list of configuration options including support for
Octave plugins, ABAQUS ODB API, and HDF5.


Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,20 @@ weight = 30

## Dependencies and Prerequisites

This page is mainly build instructions for Ubuntu, but some comments are also added for RHEL8 and Windows.
This page is mainly build instructions for Ubuntu, but some comments are also added for **RHEL8**.

Basic instructions without Python binding and GRPC.


### Configuration and build

| Tool | Minimum version |
|-------------------------|------------------|
| git | 2.7.4 |
| gcc | 10 |
| python | 3 |
| gcc | 11 |
| python | 3.8 |
| Qt | 6.4 |

It is possible to use Qt 6.4 for building ResInsight, but some install features introduced in Qt 6.5 are not supported.

Update apt installer

Expand All @@ -27,7 +30,6 @@ Install GCC and related tools

sudo apt install build-essential curl zip unzip tar flex bison

As gcc 10 is required, it can be useful to set the default compiler.
[Set default compiler](https://linuxconfig.org/how-to-switch-between-multiple-gcc-and-g-compiler-versions-on-ubuntu-20-04-lts-focal-fossa)

Dependencies for RHEL8
Expand All @@ -45,46 +47,36 @@ vcpkg is located in the folder ThirdParty/vcpkg. The packages to be installed is

ThirdParty/vcpkg/bootstrap-vcpkg.sh

### (Windows) Build and install required dependencies using vcpkg
Open a command prompt using "Run as Administrator" for Visual Studio x64.
### Qt

[Detailed Developer notes](https://ceetronsolutions.github.io/resinsight-system-doc/editor/vcpkg)
The version of Qt ResInsight depends on is probably not available as a package for the Linux distribution you are working with. Here is a short description on how to install a custom Qt version.

ThirdParty/vcpkg/bootstrap-vcpkg.bat
[aqtinstall](https://github.com/miurahr/aqtinstall) is a Python tool used to install precompiled versions of Qt. Other ways to install Qt is described [official Qt documentation](https://www.qt.io/download-qt-installer-oss)

### Python dependencies
Install Python version 3.8 or newer, and use dev-requirements.txt

python3 -m pip install -r GrpcInterface/Python/dev-requirements.txt
Create a root folder for Qt installations. In this folder, create a virtual environment for **aqtinstall**:

### Qt
python3 -m venv myvenv
source myvenv/bin/activate
pip3 install aqtinstall
aqt install-qt linux desktop 6.6.3 -m qtcharts qt5compat qtnetworkauth


System packages Ubuntu
### Build ResInsight

sudo apt install -y qtbase5-dev libqt5svg5-dev qtbase5-private-dev libqt5networkauth5-dev
Install Ninja build tool

sudo apt-get install ninja-build

System packages RHEL8
The configuration flags for a basic build is given in `CMakePresets.json` in the root of the repository. Configuration flags specific for the system to build on can be specified in `CMakeUserPresets.json`. This file is ignored by git.

sudo yum install -y qt5-devel qt5-qtnetworkauth-devel qt5-qtcharts-devel qt5-qtbase-private-devel gcc-toolset-10 gcc-toolset-10-libatomic-devel
- Create a copy of `CMakeUserPresets-example.json` and rename to `CMakeUserPresets.json`
- Update the path to your local installation of Qt6 for the key `CMAKE_PREFIX_PATH` in `CMakeUserPresets.json`

Installation of custom Qt
Set current working folder to the root folder of the ResInsight repository. Execute the following commands to build ResInsight:

Go to a folder to install custom Qt
In this folder, execute

python3 -m pip install aqtinstall
aqt install-qt linux desktop 5.15.2 -m qtcharts qtnetworkauth

cmake . --preset=linux-base
cd build
ninja

### Build ResInsight
mkdir cmakebuild
cd cmakebuild
cmake \
-DCMAKE_PREFIX_PATH=/your_qt_path/5.15.2/gcc_64/lib/cmake \
-DRESINSIGHT_ENABLE_GRPC=true \
-DRESINSIGHT_GRPC_PYTHON_EXECUTABLE=python \
-DCMAKE_TOOLCHAIN_FILE=../ThirdParty/vcpkg/scripts/buildsystems/vcpkg.cmake \
-DVCPKG_TARGET_TRIPLET=x64-linux-release \
..

make -j8
[CMake Configuration]({{< relref "cmake-configuration" >}})
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
+++
title = "Build Instructions Windows"
published = true
hidden = false
weight = 31
+++

## Dependencies and Prerequisites

### Configuration and build

| Tool | Minimum version | Recommended |
|-------------------------|------------------|-------------|
| Visual Studio | 2019 | 2022 |
| python | 3.8 | 3.10 |
| Qt | 6.5 | 6.6 |

It is possible to use Qt 6.4 for to build ResInsight, but some install features introduced in Qt 6.5 are not available.

### Clone and update sub modules

git clone https://github.com/OPM/ResInsight
cd ResInsight
git submodule update --init

### Build and install required dependencies using vcpkg
Open a command prompt using "Run as Administrator" for Visual Studio x64.

[Detailed Developer notes](https://ceetronsolutions.github.io/resinsight-system-doc/editor/vcpkg)

ThirdParty/vcpkg/bootstrap-vcpkg.bat

### Qt

**Official install tools**

Qt can be installed using the `MaintenanceTool.exe`, and select the following modules:

![]({{< relref "" >}}images/getting-started/qtmaintenancetool.png)

**aqtinstall**

[aqtinstall](https://github.com/miurahr/aqtinstall) is a Python tool used to install Qt directly from Qt distribution sites, and does not require a user account for Qt sites. Other ways to install Qt is described [official Qt documentation](https://www.qt.io/download-qt-installer-oss)

Create a root folder for Qt installations. In this folder, create a virtual environment for **aqtinstall**:

python3 -m venv myvenv
myvenv/Scripts/activate
pip3 install aqtinstall
aqt install-qt linux desktop 6.6.3 -m qtcharts qt5compat qtnetworkauth


### Build ResInsight

The configuration flags for a basic build is given in `CMakePresets.json` in the root of the repository. Configuration flags specific for the system to build on can be specified in `CMakeUserPresets.json`. This file is ignored by git.

- Create a copy of `CMakeUserPresets-example.json` and rename to `CMakeUserPresets.json`
- Update the path to your local installation of Qt6 for the key `CMAKE_PREFIX_PATH` in `CMakeUserPresets.json`

Start Visual Studio, and open the ResInsight source folder. When you open the ResInsight folder for the first time, **vcpkg** may spend a few minutes building the required dependencies specified in `vcpkg.json`.

[CMake Configuration]({{< relref "cmake-configuration" >}})

[Configure and build with CMake Presets in Visual Studio](https://learn.microsoft.com/en-us/cpp/build/cmake-presets-vs?view=msvc-170)
Original file line number Diff line number Diff line change
@@ -1,35 +1,13 @@
+++
title = "Building ResInsight from Source"
title = "CMake Configuration"
published = true
hidden = false
weight = 30
weight = 35
aliases = [
"/getting-started/buildinstructions/"
]
+++

## Source code
The source code is hosted at [GitHub](https://github.com/opm/resinsight)

In a git enabled shell do: `git clone https://github.com/OPM/ResInsight.git`

## Dependencies and Prerequisites

### Windows Compiler

Visual Studio 2019 and later is supported.

### GCC Compiler

On RedHat Linux 7 or CentOS 7 you need to install devtoolset-10, and enable it with

source /opt/rh/devtoolset-10/enable

### Qt 5
Qt 5.12 or later is supported, Qt 5.15 is recommended.

[Qt download](http://download.qt.io/archive/qt/)

On some configurations you will be asked to specify the location of Qt. Preferred method is to add Qt path to CMake variable **CMAKE_PREFIX_PATH**

Example for Windows : `CMAKE_PREFIX_PATH=F:/Qt/5.15.2/msvc2019_64`

### CMake
[CMake](https://cmake.org/download/) version 3.15 or later is supported.
Expand All @@ -38,24 +16,6 @@ Example for Windows : `CMAKE_PREFIX_PATH=F:/Qt/5.15.2/msvc2019_64`
The ResInsight build may be configured in different ways, with optional support for Octave plugins,
ABAQUS ODB API, HDF5, Pyton, and OpenMP. This is configured using options in CMake.

If you check the button 'Grouped' in the CMake GUI, the CMake variables are grouped by prefix.
This makes it easier to see all of the options for ResInsight.

- Open the CMake GUI
- Set the path to the source code
- Set the path to the build directory
- Click **Configure** and select your preferred compiler
- Set the build options and click "Configure" again (see ResInsight specific options below)
- Click **Generate** to generate the makefiles or solution file and project files in the build directory
- Run the compiler using the generated makefiles or solution file/project files to build ResInsight

### Windows
ResInsight has been verified to build and run on Windows 10/11 using Microsoft Visual Studio 2019/2022. Typical usage on Windows is to follow the build instructions above, and then open the generated solution file in Visual Studio to build the application.

### Linux

For a reference build instruction for Ubuntu, see [Reference installation description for Ubuntu]({{< ref "build-instructions-ubuntu.md" >}})

### CMake Options for ResInsight

| CMake Name | Default | Description |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ For further installation details, see the ResInsight distribution on [Opm Projec

{{% notice info %}}
The binary distributions does not support ABAQUS odb files. For building ResInsight with ABAQUS support, see
[Build Instructions]({{< ref "buildinstructions.md" >}}).
[Build Instructions]({{< ref "cmake-configuration.md" >}}).
{{% /notice %}}

## Custom Qt configuration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ weight = 20

{{% notice info %}}
The binary distribution does not support ABAQUS odb files. For building ResInsight with ABAQUS support, see
[Build Instructions]({{< ref "buildinstructions.md" >}}).
[Build Instructions]({{< ref "cmake-configuration.md" >}}).
{{% /notice %}}


Expand Down
2 changes: 1 addition & 1 deletion content/import/GeomechanicalData.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ weight = 20

ResInsight can be built with support for reading and displaying geomechanical analysis models produced by ABAQUS in the _`*.odb`_ format. This is only possible if you or your organization has a copy of the ODB-Api from Simulia, and a valid license to use it.

If you have, and would like to a use these features, please see [ Build Instructions ]({{< relref "buildinstructions.md" >}}) for a description on how to build ResInsight and how to include the support for odb-files.
If you have, and would like to a use these features, please see [ Build Instructions ]({{< relref "cmake-configuration.md" >}}) for a description on how to build ResInsight and how to include the support for odb-files.

### Geo Mechanical Data Support
Geo-mechanical data can be imported using the **Import -> Geo Mechanical Cases menu**. Here three options are present: **Import Geo Mechanical Model**, **Import Geo Mechanical Model (Time Step Filtered)** (both for odb files) and **Import Element Property Table**.
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit ff591e7

Please sign in to comment.