Coder Social home page Coder Social logo

Compilation problem in Debian about taudem HOT 9 CLOSED

dtarb avatar dtarb commented on August 19, 2024
Compilation problem in Debian

from taudem.

Comments (9)

dtarb avatar dtarb commented on August 19, 2024

I am not familiar with Debian specifics. In general, you will need to make sure that the GDAL/OGR software is installed and that your include path references this file. In my installation (on a PC) the file is in C:\GDAL\include. Perhaps @ahmetartu or @nazmussazib can comment on how to set up Linux include paths to GDAL and if the makefile needs changing.

from taudem.

artulab avatar artulab commented on August 19, 2024

Hi,

I will talk about 2 ways to compile TauDEM on Linux systems.

[1] Compiling the source files one by one as you showed using mpic++. In this case, you should show the mpi compiler where to find the gdal library and include files. After installing gdal-dev package using apt-get in debian-based distros, run "sudo updatedb" and then "locate gdal.h" to find the header file's location. For example, gdal.h file is located at "/usr/include/gdal/gdal.h" in my ubuntu machine. Then you should use such a command below to compile:

mpic++ -g -c -I/usr/include/gdal -lgdal areadinfmn.cpp -o areadinfmn.o

Note that here -I option specifies include directory of header files. mpic++ is basically using gcc options, thus please refer to gcc manuals for more information. You must also specify gdal library for the linker via -lgdal option.

[2] Second option is to use make that streamlines those process for you, or a cmake system that I highly recommend. We have a cmake script file that you don't need to specify where gdal include and library files are located. cmake automatically finds dependent libraries header and library locations for you and nicely compiles the TauDEM. So first, please install cmake into your system. "sudo apt-get install cmake". I put the new CMakeLists.txt file of TauDEM in this comment (the existing one is outdated please use that version), copy/overwrite the file into src directory of TauDEM project. Then just type "cmake" in terminal in src directory. It will compile all of the TauDEM programs for you. Later, we will update cmake file with the new version of TauDEM.

CMakeLists.txt

from taudem.

dtarb avatar dtarb commented on August 19, 2024

Thanks @ahmetartu. I updated the develop branch with this CmakeLists.txt file.

from taudem.

privatemajory avatar privatemajory commented on August 19, 2024

Thank you. The compiltation worked after uncommenting some line in the make file as described in the README.md file. But how do I install it in my system now? Running sudo make install gives make: *** No rule to make target 'package'.Stop. and there seems no install script generated anywhere. Sorry I'm not good at compiling but I need TauDEM on my PC so please can you show me the steps?

from taudem.

privatemajory avatar privatemajory commented on August 19, 2024

Sorry for disturbing but it finally did with CXX=mpicxx cmake -DCMAKE_INSTALL_PREFIX=/usr/local ... I think you should just provide some guidance for compilation and installation on linux. Many thanks!

from taudem.

privatemajory avatar privatemajory commented on August 19, 2024

Only gagewatershed isn't included 😞

from taudem.

dtarb avatar dtarb commented on August 19, 2024

@ahmetartu can you please add gagewatershed to the cmake file. It is one of the newer functions added in Visual Studio in Windows, but the linux makefiles have not kept up.

from taudem.

artulab avatar artulab commented on August 19, 2024

I added cmake directions to CMakeFiles.txt to compile gagewatershed. It is compiling OK in my ubuntu machine.

I listed the following steps to clarify the installation through CMake

[1] It is mostly recommended way to create a temporary directory and run cmake within that not to make the source directory dirty with the intermediate compilation files. So as you see below, I created a directory named "bin" in the TauDEM folder

cd TauDEM
mkdir bin

[2] Then run the cmake tool in the bin (temp. folder). You must locate the CMakeLists.txt file for the cmake tool to find it, which is located at Taudem/src folder

cd bin
cmake ../src/

In most linux systems, particularly new ones, cmake should detect all the dependencies well, but please note that in some linux systems (like supercomputers or old systems), cmake might fail in finding gdal header files. Then you should explicitly show the GDAL include library to cmake (in my case, gdal.h is at /usr/gdal/include). In such cases, the cmake command should look like this:

cmake ../src/ -DGDAL_INCLUDE_DIR=/usr/gdal/include

[3] cmake tool should find the MPI and gdal libraries and generate a Makefile which is used to compile source files into executables. Then we basically run make command for that.

make

from taudem.

privatemajory avatar privatemajory commented on August 19, 2024

Thank you.

from taudem.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.