Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to install TauDEM on ubuntu 22 as I might have issues with MPI installed #48

Closed
monis4567 opened this issue Jan 31, 2024 · 1 comment

Comments

@monis4567
Copy link

I fail in getting TauDEM installed on ubuntu 22. I am not sure why I cannot make it work.

In a terminal on Ubuntu 22
I git clone the TauDEM repository

git clone https://github.com/dtarb/TauDEM.git

This works fine. Consulting the README provided with 'TauDEM' I check I have the dependencies, by installing them with

sudo apt-get install gdal-bin libgdal-dev gdal-bin libmpich-dev openmpi-bin

Which gives me

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
gdal-bin is already the newest version (3.4.1+dfsg-1build4).
libgdal-dev is already the newest version (3.4.1+dfsg-1build4).
libmpich-dev is already the newest version (4.0-3).
openmpi-bin is already the newest version (4.1.2-2ubuntu1).
openmpi-bin set to manually installed.

I then navigate into the TauDEM directory and make the 'MPICH2.sh' executable with

chmod 755 MPICH2.sh

Perhaps this might not be needed as the previous check informed me that the 'openmpi-bin is already the newest version (4.1.2-2ubuntu1).'
I then executed the MPICH2.sh with

./MPICH2.sh

This runs fine, but exits with these lines

checking whether gfortran allows mismatched arguments... no
configure: error: The Fortran compiler gfortran will not compile files that call
the same routine with arguments of different types.
make: *** No targets specified and no makefile found. Stop.
make: *** No rule to make target 'install'. Stop.

I am not sure what this is about. I could not find a solution on the internet for this.
I decided to continue and followed the next instructions in the README file for TauDEM

So I made a directory called 'bin' and navigated into 'src'

 mkdir bin
 cd src

And then tried 'make'

make

This kicks in fine, but exits with an error at the end I do not understand - see the output to screen here below (I had to shorten the output from screen, because of the word limit on issues)

mpicxx -O2 -std=c++11 gdal-config --cflags nc-config --cflags -c areadinfmn.cpp -o areadinfmn.o
mpicxx -O2 -std=c++11 gdal-config --cflags nc-config --cflags -c areadinf.cpp -o areadinf.o
mpicxx -O2 -std=c++11 gdal-config --cflags nc-config --cflags -c commonLib.cpp -o commonLib.o
mpicxx -O2 -std=c++11 gdal-config --cflags nc-config --cflags -c tiffIO.cpp -o tiffIO.o
tiffIO.cpp: In member function ‘void tiffIO::read(long int, long int, long int, long int, void*)’:
...
...
...
linklib.h: In function ‘bool sendLink(int32_t, int)’:
linklib.h:281:9: error: ‘MPI_Type_extent’ was not declared in this scope; did you mean ‘MPI_Type_get_extent’?
281 | MPI_Type_extent(MPI_LONG, &extent);
| ^~~~~~~~~~~~~~~
| MPI_Type_get_extent
linklib.h:286:9: error: ‘MPI_Type_struct’ was not declared in this scope; did you mean ‘MPI_Type_size_x’?
286 | MPI_Type_struct(2,blockcounts,offsets,oldtypes,&PointType);
| ^~~~~~~~~~~~~~~
| MPI_Type_size_x
linklib.h: In function ‘bool recvLink(int)’:
linklib.h:349:9: error: ‘MPI_Type_extent’ was not declared in this scope; did you mean ‘MPI_Type_get_extent’?
349 | MPI_Type_extent(MPI_LONG, &extent);
| ^~~~~~~~~~~~~~~
| MPI_Type_get_extent
linklib.h:354:9: error: ‘MPI_Type_struct’ was not declared in this scope; did you mean ‘MPI_Type_size_x’?
354 | MPI_Type_struct(2,blockcounts,offsets,oldtypes,&PointType);
| ^~~~~~~~~~~~~~~
| MPI_Type_size_x
streamnet.cpp: In function ‘int reachshape(long int*, float*, float*, float*, double*, double*, long int, tiffIO&)’:
streamnet.cpp:347:24: warning: ignoring return value of ‘OGRErr OGR_L_CreateFeature(OGRLayerH, OGRFeatureH)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
347 | OGR_L_CreateFeature( hLayer1, hFeature1 ); //adding feature
| ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
make: *** [makefile:218: streamnet.o] Error 1

I then tried the second set of instructions in the README file provided with TauDEM

cd ..
cd src && mkdir build && cd build
cmake ..

Which give this error here below (I had to shorten the output from screen, because of the word limit on issues)

-- The C compiler identification is GNU 11.4.0
-- The CXX compiler identification is GNU 11.4.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found MPI_C: /usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi.so (found version "3.1")
-- Found MPI_CXX: /usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi_cxx.so (found version "3.1")
-- Found MPI: TRUE (found version "3.1")
-- Found GDAL: /usr/lib/libgdal.so (found version "3.4.1")
-- Configuring done
-- Generating done
-- Build files have been written to: /home/hal9000/TauDEM/src/build
hal9000@hal9000:~/TauDEM/src/build$ make && make install
[ 0%] Building CXX object CMakeFiles/aread8.dir/aread8mn.cpp.o
[ 1%] Building CXX object CMakeFiles/aread8.dir/aread8.cpp.o
[ 1%] Building CXX object CMakeFiles/aread8.dir/commonLib.cpp.o
...
...
...
[ 67%] Building CXX object CMakeFiles/streamnet.dir/streamnetmn.cpp.o
[ 67%] Building CXX object CMakeFiles/streamnet.dir/streamnet.cpp.o
In file included from /home/hal9000/TauDEM/src/streamnet.cpp:56:
/home/hal9000/TauDEM/src/linklib.h: In function ‘bool sendLink(int32_t, int)’:
/home/hal9000/TauDEM/src/linklib.h:281:9: error: ‘MPI_Type_extent’ was not declared in this scope; did you mean ‘MPI_Type_get_extent’?
281 | MPI_Type_extent(MPI_LONG, &extent);
| ^~~~~~~~~~~~~~~
| MPI_Type_get_extent
/home/hal9000/TauDEM/src/linklib.h:286:9: error: ‘MPI_Type_struct’ was not declared in this scope; did you mean ‘MPI_Type_size_x’?
286 | MPI_Type_struct(2,blockcounts,offsets,oldtypes,&PointType);
| ^~~~~~~~~~~~~~~
| MPI_Type_size_x
/home/hal9000/TauDEM/src/linklib.h: In function ‘bool recvLink(int)’:
/home/hal9000/TauDEM/src/linklib.h:349:9: error: ‘MPI_Type_extent’ was not declared in this scope; did you mean ‘MPI_Type_get_extent’?
349 | MPI_Type_extent(MPI_LONG, &extent);
| ^~~~~~~~~~~~~~~
| MPI_Type_get_extent
/home/hal9000/TauDEM/src/linklib.h:354:9: error: ‘MPI_Type_struct’ was not declared in this scope; did you mean ‘MPI_Type_size_x’?
354 | MPI_Type_struct(2,blockcounts,offsets,oldtypes,&PointType);
| ^~~~~~~~~~~~~~~
| MPI_Type_size_x
/home/hal9000/TauDEM/src/streamnet.cpp: In function ‘int reachshape(long int*, float*, float*, float*, double*, double*, long int, tiffIO&)’:
/home/hal9000/TauDEM/src/streamnet.cpp:347:24: warning: ignoring return value of ‘OGRErr OGR_L_CreateFeature(OGRLayerH, OGRFeatureH)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
347 | OGR_L_CreateFeature( hLayer1, hFeature1 ); //adding feature
| ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
make[2]: *** [CMakeFiles/streamnet.dir/build.make:90: CMakeFiles/streamnet.dir/streamnet.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:749: CMakeFiles/streamnet.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

@fkeck
Copy link

fkeck commented Jan 31, 2024

Hi,
This is a TauDEM installation issue. I could replicate the error and fix it using the approach described here: dtarb/TauDEM#249

What you need to do is:

mkdir bin
cd src
sed -i -e 's/MPI_Type_struct/MPI_Type_create_struct/g' linklib.h
sed -i -e 's/MPI_Type_extent(MPI_LONG, \&extent)/MPI_Aint lb\;MPI_Type_get_extent(MPI_LONG, \&lb, \&extent)/g' linklib.h
make

I hope this helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants