Installing TauDEM actually means installing 3 tools:
- GDAL that TauDEM uses under the hood;
- MPI that R will call to launch TauDEM;
- TauDEM itself.
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, MPICH and CMake:
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-Developto 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 the source folder
sh cd src
builddirectory: and go into with:
sh mkdir build
Go into the
sh 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.
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.
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,
- install CMake or Make (check it’s not already installed);
- follow TauDEM README for further suggestions) for either CMake or Make depending on what you decided to use.
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.
- The Windows installer might have done this automatically.
- For other operating systems (macOS, Linux) use your usual method to add a directory to the PATH.
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.