Installing TauDEM actually means installing 3 tools:
Please follow instructions on how to install TauDEM, GDAL and MPI depending on your operating system, then finalize your installation as specified below.
No matter your operating system, take note of the steps you follow. This way, if anything goes wrong, you will be able to open an informative bug report and get help more easily.
You’re in luck! The TauDEM Windows installer will install all three tools at once! Refer to https://hydrology.usu.edu/taudem/taudem5/downloads.html.
To install the dependencies, Homebrew is recommended. It is a package manager, similar to APT on Linux systems.
Open a terminal.
Download and install GDAL and MPICH:
sh brew install gdal mpich cmake
Go to the Github page of TauDEM and download the code as ZIP
Extract it and move the folder
TauDEM-Develop to a
convenient place, e.g.:
Go back to the terminal and go into the directory with:
sh cd /Users/$USER/Documents/TauDEM/TauDEM-Develop
Create a folder where the executables will be installed in:
sh mkdir bin
Go into source folder, create a build folder and go into with:
sh cd src && mkdir build && cd build
make && sudo make install
The executable files will end up in
Add the location of the executable files to your path environment
variable. This is a bit tricky on macOS, since RStudio and the package
only see the path added to
/etc/paths.d/. So add it
with the following two commands:
echo "/usr/local/taudem/" > taudem sudo mv taudem /etc/paths.d/
Do you need to install GDAL? In a terminal try
gdalinfo --version, if it fails
gdal-config --version. If it works and return something you
do not need to install GDAL unless you want a newer version. You might
have installed GDAL in the past for, say, using the sf R package.
If you need to, install GDAL using the official GDAL docs (or refer to TauDEM README for further suggestions).
First try running
mpiexec --version in a terminal. If it
works and returns something, you do not need to install MPI unless you
want a newer version.
If you need to, install MPI using the official MPI docs (or refer to TauDEM README for further suggestions).
First you need to obtain TauDEM source for GitHub https://github.com/dtarb/TauDEM/. If you are at ease with this, you can clone the repository. If not, find the green button that allows you to clone, open (with GitHub CLI) or download, and download the ZIP version.
We recommend using CMake because that is what we did but TauDEM README also has a method using Make. Therefore,
If the installation shows errors, try using https://github.com/maelle/TauDEM/tree/more-mpi-deprecations instead.
Even for a successful installation you might see many warnings.
Once you are done, you need to register TauDEM in R and check your installation.
Add an R environmental variable called
points to the location where the TauDEM executables can be found (on
Windows it might be
C:\Program Files\TauDEM, on Ubuntu
For instance on Ubuntu it could be adding this line in
then re-starting R:
or, for just the session, running this line of R code:
Sys.setenv(TAUDEM_PATH = "/usr/local/taudem")
traudem::taudem_sitrep() and read its output
carefully. Pay attention to any error that might indicate part of the
installation was not successful.
If all is well (no error, only normal output from TauDEM), congratulations! Your system is ready to apply TauDEM to your own data.