Linux and MacOS

The Linux release was tested on Ubuntu 24.04 LTS, and MacOS was tested on Sonoma. Please let us know if you test on a different OS version or Linux distribution and have any issues.

Installation

Linux

Your Linux distribution may have a QGIS package as part of its standard collection. Provided it is QGIS 3.16 version or later (not QGIS 2) you will be OK using it, and you can use the standard package management system to install it. The instructions that follow here are an alternative for obtaining the latest long term release of QGIS, currently 3.34.

Start by going to the QGIS download page and selecting Linux. Follow the instructions for your distribution. Note the instructions on the QGIS page include installing qgis-plugin-grass, but this is not necessary for QSWAT+, i.e. the install command needed is merely sudo apt install qgis (though Ubuntu seemed to install GRASS anyway).

Install QSWAT+ using the swatplus-linux-installer from the installation page. This takes the form of a compressed tar archive. Save it somewhere, open a terminal and cd to the directory it is saved in. Use the command tar -xvf swatplus-linux-installer.tgz to unpack the tar file. You then decide whether to install it just for you, or for everyone. In the first case it will only be available to the user who installs it. In the second case it will be available to any user, but will require the root user password to install. To take the first option, use the command ./installforme.sh and to take the second option use the command sudo ./installforall.sh This will install the QSWAT+ plugin for QGIS, in the user's personal files with the first option, and within the QGIS installation with the second option. It also installs the SWAT+ Editor and other tools and data in the SWATPlus directory. With the first option, SWATPlus is ~/.local/share/SWATPlus (where ~ is the user's home directory) and with the second option it is /usr/local/share/SWATPlus. There are also shell scripts uninstallforme.sh and unistallforall.sh for uninstalling.

The TauDEM executables used for watershed delineation by QSWAT+ can run in multiprocessing mode, using MPI (Message Passing Interface). Unfortunately, they need MPI to be installed even if the user chooses not to use MPI. The usual version of MPI for Linux is openmpi, and in Ubuntu, for example, running the command sudo apt-get install openmpi-bin in a terminal will install openmpi or tell you it is already installed.

Mac

Obtain QGIS from the download page, selecting Download for macOS and then QGIS 3.34 LTR, the one described as the most stable version. This will give you a .dmg file, Open it, agree to the license, and you get a small window with a QGIS symbol and an Applications symbol. Drag the QGIS symbol onto the Applications symbol. This places QGIS in your Applications folder, and takes a few minutes. When you open QGIS in MacOS you get a response that it cannot be opened because Apple cannot check it for malicious software. Click the Show in Finder button, and then instead of left clicking on QGIS, right click (or hold Ctrl while you click) on QGIS and then choose Open. The same warning about malicious software appears, but this time there is an Open button that you click to start QGIS. Thereafter QGIS will open normally.

The TauDEM software used to do watershed delineation in QSWAT+ is linked dynamically to openmpi, so this needs to be installed. This is most easily achieved by running in a terminal the command sudo brew install openmpi

The instructions new vary according to whether you have a Mac with an Intel processor or an Arm processor (also called M1 or M2)

For an Intel processor

Install QSWAT+ using the swatplus-mac-installer from the installation page. This takes the form of a compressed tar archive. Save it somewhere, open a terminal and cd to the directory it is saved in. Use the command tar -xvf swatplus-mac-installer.tgz to unpack the tar file. cd to swatplus-mac-installer and use the command sudo ./installforme.sh to install for just the user doing the installation. This needs sudo because it fixes a problem in the QGIS installation to properly link some gdalplugins library files. This will install the QSWAT+ plugin for QGIS, under the user's home directory. It also installs the SWAT+ Editor and other tools and data in the ~/SWATPlus directory (where ~ is the user's home directory). It is also possible to install for all users, with the command sudo ./installforall.sh This installs the QSWAT+ plugin within the QGIS installation, and makes the QSWATPlus directory /usr/local/share/SWATPlus. There are also shell scripts uninstallforme.sh and uninstallforall.sh for uninstalling.

For an Arm processor

Install QSWAT+ using the swatplus-mac-arm -installer from the installation page. This takes the form of a compressed tar archive. Save it somewhere, open a terminal and cd to the directory it is saved in. Use the command tar -xvf swatplus-mac-arm-installer.tgz to unpack the tar file. cd to swatplus-mac-arm-installer and use the command ./installforme.sh to install for just the user doing the installation. This will install the QSWAT+ plugin for QGIS, under the user's home.directory. It also installs the SWAT+ Editor and other tools and data in the ~/SWATPlus directory (where ~ is the user's home directory). It is also possible to install for all users, with the command sudo ./installforall.sh This installs the QSWAT+ plugin within the QGIS installation, and makes the QSWATPlus directory /usr/local/share/SWATPlus. There are also shell scripts uninstallforme.sh and uninstallforall.sh for uninstalling.

There are some extra libraries needed for Arm machines. You need to run the following in a terminal:

sudo brew install gdal
sudo brew install hwloc
sudo brew install libevent

Known Issues

SWAT+ Model on MacOS

Be sure to update to the version 2.3 or later of SWAT+ Editor for MacOS. In version 2.2 and earlier you might receive an error while trying to run the model stating it can't find the library libiomp5. We have packaged this with the latest 2.3 SWAT+ Editor install.

You may also run the model outside the editor by downloading the executables from the Installation page and following the instructions in the read-me file.

SWAT+ Editor on Debian 10: SUID Sandbox

You may receive an error trying to launch SWAT+ Editor on Debian or other non-Ubuntu Linux distributions:

The SUID sandbox helper binary was found, but it is not configured correctly.

If so, please try the following.

Find your installation location. If you did install for me, it is:

cd ~/.local/share/SWATPlus/SWATPlusEditor

If you selected install for all, it is:

cd /usr/local/share/SWATPlus/SWATPlusEditor

From the install directory, type the following commands:

sudo chown root chrome-sandbox
sudo chmod 4755 chrome-sandbox

You should now be able to launch the editor without error.

Last updated