Getting

Prerequisite

Make

How to compile DelftD under Linux Fedor Baart

January , 

Fedor Baart How to compile DelftD under Linux

Contribute

Getting

Prerequisite

 Getting DelftD

 Prerequisites

 Compiling

 Contributing

Fedor Baart How to compile DelftD under Linux

Make

Contribute

Getting

Subscribe

Fedor Baart How to compile DelftD under Linux

Prerequisite

Make

Contribute

Getting

Prerequisite

Make

Subversion Use subversion to get the source. DelftD can be found here. https://svn.oss.deltares.nl/repos/delftd/trunk Get it using subversion software, which can be found here: http://subversion.apache.org/

Fedor Baart How to compile DelftD under Linux

Figure: Browsing the sourcecode

Contribute

Getting

Prerequisite

Make

How do I download the DelftD source code?  

svn co h t t p s : / / svn . oss . d e l t a r e s . n l / repos / d e l f t  d / t r u n k d e l f t  t r u n k

# > The program ’ svn ’ i s c u r r e n t l y not i n s t a l l e d .  # > sudo apt −get i n s t a l l s u b v e r s i o n

You can i n s t a l l i t by t y p i n g :

 # I n s t a l l subversion sudo apt −get i n s t a l l s u b v e r s i o n  # R e t r y to get the sourcecode svn co h t t p s : / / svn . oss . d e l t a r e s . n l / repos / d e l f t  d / t r u n k d e l f t  t r u n k  # A d e l f t  d p r e p a r e d / s r c / t o o l s g p l /mormerge/ packages / mormerge version number / mormerge version number . v c p r o j # ...  # Checked out r e v i s i o n .  # Tagged v e r s i o n s are more s t a b l e ( we ’ l l use the t r u n k today ) svn co h t t p s : / / svn . oss . d e l t a r e s . n l / repos / d e l f t  d / tags /... d e l f t  d r e l e a s e

Fedor Baart How to compile DelftD under Linux

Contribute

Getting

Prerequisite

Make

Branches The main developments are happening in the trunk New developments are done in branches/research Old releases are maintained at brances/release

Fedor Baart How to compile DelftD under Linux

Contribute

Getting

Prerequisite

Make

How do I keep up to date with the latest developments?





# Go to the d i r e c t o r y where d e l f t  d was downloaded cd d e l f t  d t r u n k # Use the s u b v e r s i o n update command to get over the l a t e s t changes svn up

Fedor Baart How to compile DelftD under Linux

Contribute

Getting

Prerequisite

Make

Contribute

How do I keep up to date with the latest developments?





ls # examples gpl −  .  . t x t l g p l −  .  . t x t props cd s r c ls # AUTHORS common . am plugins lgpl tools lgpl

Fedor Baart How to compile DelftD under Linux

src

tsvn −auto −

engines gpl

Getting

Prerequisite

Make

Contribute

What do I need installed to build DelftD? Linux (official supported: CentOS , today we use ubuntu) Build tools (autoconf, automake, libtool, make) Compilers (gcc, g++, gfortran (≥ .), g?, official supported ifort) Compiler-compiler (bison/flex) Scripting (tclsh, probably temporary) Subversion (svnversion) Libraries (expat, pthread) MPI (mpif, build with same compiler as fortran compiler, only mpich supported) Fedor Baart How to compile DelftD under Linux

Getting

Prerequisite

Make

Contribute

What do I need to know?

Basics (system maintainer available): bash, less Intermediate (maintaining own system): editor (emacs/vim), package manager (apt, yum, port, emerge) Advanced (debugging, contributing): gdb, gprof, valgrind, nm, ldd, strace

Fedor Baart How to compile DelftD under Linux

Getting

Prerequisite

Make

Statistics of the DelftD sourcecode (sloccount)

Totals grouped by language (dominant language first): f:  (.%) ansic:  (.%) cpp:  (.%) sh:  (.%) fortran:  (.%) tcl:  (.%) ... Total Physical Source Lines of Code (SLOC) = , ( in third party)

Fedor Baart How to compile DelftD under Linux

Contribute

Getting

Prerequisite

Make

How do I configure the DelftD source?

Typical issues In the next examples I assume you did not install any of the prerequisites. The goal is to show some common errors. Steps in building linux software Prepare → Configure → Build → Install

Fedor Baart How to compile DelftD under Linux

Contribute

Getting

Prerequisite

Make

How do I prepare the DelftD source?



. / autogen . sh # P r e p a r i n g the D e l f t  D b u i l d system . . . please w a i t



# ERROR :

Unable to l o c a t e GNU Autoconf .





# ERROR : To scratch , # at installed sudo apt −get

prepare the D e l f t  D b u i l d system from l e a s t v e r s i o n . o f GNU Autoconf must be . i n s t a l l autoconf

Fedor Baart How to compile DelftD under Linux

Contribute

Getting

Prerequisite

Make

How do I prepare the DelftD source?   

. / autogen . sh # P r e p a r i n g the D e l f t  D b u i l d system . . . please w a i t # # # #

Found GNU Autoconf v e r s i o n . Found GNU Automake v e r s i o n  .   .  ... ERROR : Unable to l o c a t e GNU L i b t o o l .







# ERROR : To prepare the D e l f t  D b u i l d system from scratch , # at l e a s t v e r s i o n  .  .  o f GNU L i b t o o l must be installed . sudo apt −get i n s t a l l l i b t o o l

Fedor Baart How to compile DelftD under Linux

Contribute

Getting

Prerequisite

Make

Contribute

How do I prepare the DelftD source?

 



. / autogen . sh # Automatically preparing bu ild

. . . done

# The D e l f t  D b u i l d system i s now prepared . here , run : # . / configure # make

Fedor Baart How to compile DelftD under Linux

To b u i l d

Getting

Prerequisite

Make

How do I configure the DelftD source?





. / configure # checking f o r l e x . . . no # c o n f i g u r e : e r r o r : Can ’ t f i n d l e x , please i n s t a l l or s e t the LEX v a r i a b l e sudo apt −get i n s t a l l f l e x

Fedor Baart How to compile DelftD under Linux

Contribute

Getting

Prerequisite

Make

How do I configure the DelftD source?





. / configure # checking f o r mpif . . . no # c o n f i g u r e : e r r o r : cannot compile a simple F o r t r a n program # See ‘ c o n f i g . log ’ f o r more d e t a i l s sudo apt −get i n s t a l l g f o r t r a n mpich

Fedor Baart How to compile DelftD under Linux

Contribute

Getting

Prerequisite

Make

How do I configure the DelftD source?

 

. / configure # checking f o r mpif . . . yes # c o n f i g u r e : e r r o r : Compiler can ’ t f i n d l i b s t d c ++ sudo apt −get i n s t a l l g++

Fedor Baart How to compile DelftD under Linux

Contribute

Getting

Prerequisite

Make

How do I configure the DelftD source?



. / configure # c o n f i g u r e : e r r o r : Compiler can ’ t f i n d sudo apt −get i n s t a l l l i b e x p a t  l i b e x p a t  −dev

Fedor Baart How to compile DelftD under Linux

Contribute

Getting

Prerequisite

Make

How do I configure the DelftD source?

 

. / configure # x c o n f i g . s t a t u s : * / M a k e f i l e # config . status : creating config . h make

Fedor Baart How to compile DelftD under Linux

Contribute

Getting

Prerequisite

Make

How do I compile the DelftD source?

 

make # T h i s generates a l o t o f . o , . a , . la , . so , . exe f i l e s . # ..... # make [  ] : Leaving d i r e c t o r y ‘ d e l f t  t r u n k / src ’

Fedor Baart How to compile DelftD under Linux

Contribute

Getting

Prerequisite

Make

What now?

Figure: Things to do while DelftD compiles (src:xkcd.com)

Fedor Baart How to compile DelftD under Linux

Contribute

Getting

Prerequisite

Make

Installing the DelftD libraries and executables?

 



# T h i s i n s t a l l s the e x e c u t a b l e s i n / usr / l o c a l / l i b and / usr / l o c a l / b i n make i n s t a l l # T h i s i s the i n s t a l l method t h a t i s used to b u i l d a release # I t i n s t a l l s a l l the e x e c u t a b l e s i n . . / bin , only works i f you d i d . / c o n f i g u r e −− p r e f i x =$ ( pwd ) # I t a l s o groups the e x e c u t a b l e s make ds− i n s t a l l

Fedor Baart How to compile DelftD under Linux

Contribute

Getting

Prerequisite

Make

Running an example

   

. / c o n f i g u r e −− p r e f i x =$ ( pwd ) / b u i l d make i n s t a l l l s build / bin cd . . / examples / standard d e l t a r e s h y d r o . t c l # w i l l be c a l l e d . exe # d e l t a r e s h y d r o . t c l : command not found e x p o r t PATH=$ b u i l d p a t h / b i n : $PATH

Fedor Baart How to compile DelftD under Linux

Contribute

Getting

Prerequisite

Make

Running an example





d e l t a r e s h y d r o . t c l # w i l l be c a l l e d . exe # E x e c u t i n g ” b u i l d / b i n / d hydro . exe TMP config flowdd  . xml ” . . . # d hydro ABORT : Cannot load component l i b r a r y ” l i b f l o w  d  d . so ” : l i b f l o w  d  d . so : cannot open shared o b j e c t f i l e : No such f i l e or d i r e c t o r y e x p o r t LD LIBRARY PATH=$ b u i l d p a t h / l i b : $LD LIBRARY PATH

Fedor Baart How to compile DelftD under Linux

Contribute

Getting

Prerequisite

Make

Contribute

Running an example 

 

  

d e l t a r e s h y d r o . t c l # w i l l be c a l l e d . exe again # ERROR : S t a r t ” d e l t a r e s h y d r o . exe ” w i t h  or  arguments . # Usage : # d e l t a r e s h y d r o . exe < c o n f i g . i n i > [ −keepXML ] deltares hydro . t c l config flowdd . i n i # ... # −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

# FINISHED DelftD −FLOW # runid : f # date , time : −−, :: #  e r r o r s and  warnings # r e t u r n i n g to main program from domain f # −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

Fedor Baart How to compile DelftD under Linux

Getting

Prerequisite

Make

How do customize the compilation process?  

# i n s t a l l i n a custom d i r e c t o r y . / c o n f i g u r e −− p r e f i x =$ ( pwd ) / b u i l d e x p o r t LD LIBRARY PATH=$ ( pwd ) / b u i l d / l i b : $LD LIBRARY PATH e x p o r t PATH=$ ( pwd ) / b u i l d / b i n : $PATH

   

# switch comilers make clean FC= i f o r t . / c o n f i g u r e # t h i s assumes i f o r t was a l s o used to b u i l d mpi # Pass e x t r a options , t h i s can be needed f o r some AMD  b i t systems FCFLAGS=− f P I C . / c o n f i g u r e

 

# Customize the MPI c o m p i l e r MPIFC=openmpif . / c o n f i g u r e

Fedor Baart How to compile DelftD under Linux

Contribute

Getting

Prerequisite

Make

How can I get help?

Service packages Get pre-built tested executables from the service packages. http://www.deltaressystems.com/hydro/service-packages

Community support Through the forums: http://oss.deltares.nl

Fedor Baart How to compile DelftD under Linux

Contribute

Getting

Prerequisite

How do I report bugs?

delft[email protected]

Fedor Baart How to compile DelftD under Linux

Make

Contribute

Getting

Prerequisite

Make

How can I contribute my own sourcecode?

Getting write access If you want to contribute sourcecode, please ask for write access. You will get access to a branch. [email protected]

Fedor Baart How to compile DelftD under Linux

Contribute