Skip to content

Compiling Inishell

Once you have the source code of Inishell on your computer (either from downloading a source package or from performing a git clone, see Getting Inishell), you can compile it. Please have a look at the Compiling MeteoIO page in order to get links to various compilers and tools as well as more details on the compilation process.

Dependencies

You will need a C++ compiler (such as g++ on GNU/Linux), and the Qt compiler (translating code written for the Qt toolkit to pure C++). Note that Qt 5.9 or later is required.

GNU/Linux

On GNU/Linux, you can install the g++ compiler or the clang compiler. Then you can install relatively small toolkits to compile Inishell through the command line:

sudo apt install build-essential cmake-curses-gui
sudo apt install qtbase5-dev qttools5-dev-tools
On Ubuntu you may additionally need the following package to make language tools available:
sudo apt install qttools5-dev

Newer operating systems should offer this through their packet manager, but Ubuntu 16 for example offers Qt 5.5 via apt which will be too old and you will need to fetch Qt manually. For reference and as an example as other distributions follow similar patterns, here are the standard versions of Qt for each Ubuntu releases (LTS stands for Long Term Support and means 5 years of maintenance and security updates + 5 more years of extended commercial support):

Ubuntu Release Default Qt version
16.04 LTS 5.5.1
18.04 LTS 5.9.5
20.04 LTS 5.12.8
21.04 5.15.2
22.04 LTS 5.15.3

Microsoft Windows

You can install either Visual C++ or Code::blocks as compiler and then install the Qt online installer (you can select the open source version). Then launch the online installer to install Qt (you will need Qt Core as well as CMake if you did not install it for other projects).

Please note that some recent versions of Qt (apparently, Qt6) require a much more recent version of g++ than the one included in the latest Code::Block and fail to properly pack it in the Qt installer (so even after clicking to install the appropriate Mingw g++ distribution, it does not get installed). In this case, follow these two steps:

  • manually install a recent enough Mingw g++ distribution for Windows (in the Qt MingW wiki you can get a recent MingW package);
  • make sure the Qt path (such as "C:\Qt\6.3.0\mingw_64\bin") appears in the PATH environment variable definition before the path to the Code::Blocks Mingw binary (so CMake correctly finds the newest MingW binary)

MacOS

Install XCode (you can find a list of versions matching different MacOS versions at https://xcodereleases.com/), then install the Qt online installer (you can select the open source version: "Downloads for open source users" > "Go open source" > "Download the Qt Online Installer"). Then launch the online installer to install Qt (you will need Qt Core as well as CMake). The following settings are known to work: select "/Applications/Qt" as installation directory, select a "custom installation" with the following components: Qt 6.3.0 (for example, other versions work too) and select macos. Select in the "Developer and designer tools" CMake. When Qt has been installed, make sure to add the binary directory of the Qt installation (such as /Applications/Qt/6.2.3/macos/bin to your PATH environment variable:

export PATH=/Applications/Qt/6.2.3/macos/bin:$PATH

Compiling

from the command line

You have to go into the Inishell directory and then run the following commands:

cmake .
make

You can also run ccmake . instead of simply cmake . in order to get a terminal configuration screen that allows to configure several aspects of the compilation.

with a GUI

You can also use cmake-gui (or ccmake in the terminal) in order to configure the compilation process in more details and then have cmake generate a project file for your compiler (g++, visual c++ or clang).

screenshot_cmake_gui

After configuring your compiler kit (e. g. Clang on macOS, Visual C++ on Windows or Code::Blocks on all platforms) you can build the project. On Windows, be sure to make the needed DLLs from the Qt installation directory accessible (by e. g. copying them alongside the exe). Static linking requires a static version of Qt. On macOS you also need XCode to run Qt Creator, which can be obtained from Apple with an Apple ID (which does not have to be a developer ID) or directly from https://xcodereleases.com/ (please pick a version of XCode that matches your operating system version!). Of course you can also use Qt Creator on GNU/Linux.

Running Inishell

The compiled program can then be found in the bin subdirectory.


Last update: July 4, 2022