Message Boards

Back

Successfully installed and run Delft3d on Amazon AWS Ubuntu 16.04 (EC2)

PL
Paul Liu, modified 14 Days ago.

Successfully installed and run Delft3d on Amazon AWS Ubuntu 16.04 (EC2)

Youngling Posts: 6 Join Date: 2/18/14 Recent Posts

Have successfully Installed and run Delft3d on Amazon AWS Ubuntu 16.04 (EC2) or any PC
by Paul Liu (jpliu AT ncsu.edu)

I have tested the following procedures on 1)Amazon AWS EC2 Ubuntu 16.04 (Free tier);

2) an old Dell PC installed Ubuntu 16.04 desktop; 3) and an old Lenovo PC.

I downloaded and tested both trunk revision 5740 and trunk 7545.  The latest trunk revision 62441 does not work.

If you follow the following step by step, you should be able to install and run the Delft3d without a problem. Please test and see if it works for you, please let me know if nay step does not work.

Just copy and paste the following commands one by one to Terminal (1)

1.  Update and upgrade your Ubuntu 16.04 system:

1)  sudo apt-get update

2)  sudo apt-get upgrade

2. Install the required compliers and programs:

1)  sudo apt-get install build-essential subversion autoconf libtool bison flex g++ gfortran libstdc++6 byacc libexpat1 libexpat1-dev  uuid-dev ruby make

2)  sudo apt-get install libcurl4-openssl-dev

3)  sudo apt-get install -y pkg-config

3. Now, you can go ahead to download the Delft3d, it may take up to 10-20 minutes
Please open a new Terminal(2) (u can right click your Terminal from pc or mac)

1)  cd ~; mkdir delft3d; cd delft3d;

2)  svn co https://svn.oss.deltares.nl/repos/delft3d/tags/delft3d4/7545/ trunk7545

it needs your admin passed and delft3d username and passed to download.

4. go back Terminal (1), get and install MPICH-3.2

1) cd ~; mkdir Downloads; cd Downloads   #your system may have already had a Downloads folder
2) wget http://www.mpich.org/static/downloads/3.2/mpich-3.2.tar.gz
3) tar -xzf mpich-3.2.tar.gz; cd mpich-3.2
4) ./configure --prefix=/opt/mpich-3.2     # INSTALL version3.2 TO "/opt/mpich-3.2"
5)  make
8)  sudo make install; cd ..

5. Get and Install ZLIB-1.2.8
1) wget ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-4/zlib-1.2.8.tar.gz
2) tar -xzf zlib-1.2.8.tar.gz; cd zlib-1.2.8
3) ./configure --prefix=/usr/local/zlib-1.2.8
4) make
5) sudo make install; cd ..

6. Get and install HDF5
1) wget https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.8/hdf5-1.8.16/src/hdf5-1.8.16.tar.gz
2) tar -zxf hdf5-1.8.16.tar.gz; cd hdf5-1.8.16
3) ./configure --prefix=/usr/local/hdf5-1.8.16 --with-zlib=/usr/local/zlib-1.2.8
4) make
5) sudo make install;  cd ..

7. Get and install NetCDF-C and NetCDF-fortran

1)  wget https://github.com/Unidata/netcdf-c/archive/v4.4.1.tar.gz

2)   tar -xzf v4.4.1.tar.gz; cd netcdf-c-4.4.1

3) CPPFLAGS="-I/usr/local/hdf5-1.8.16/include -I/usr/local/zlib-1.2.8/include -I/usr/local/netcdf4.4/include"  LDFLAGS="-L/usr/local/hdf5-1.8.16/lib -L/usr/local/zlib-1.2.8/lib -L/usr/local/netcdf4.4/lib" \
./configure --prefix=/usr/local/netcdf4.4 --enable-netcdf-4 --enable-shared --enable-dap


4) make
5) sudo make install; cd ..

6)
wget https://github.com/Unidata/netcdf-fortran/archive/v4.4.4.tar.gz
7)
tar -xzf v4.4.4.tar.gz; cd netcdf-fortran-4.4.4
8)
   CPPFLAGS="-I/usr/local/hdf5-1.8.16/include -I/usr/local/netcdf4.4/include"  LDFLAGS="-L/usr/local/hdf5-1.8.16/lib -L/usr/local/netcdf4.4/lib" ./configure --prefix=/usr/local/netcdf4.4 --enable-shared

9) make
10) sudo make install; cd ..

8. edit the Delft3d's "build.sh" file. I hope the downloading is finished.

1) If done, in Terminal-2,
cd trunk7545/src

2) you can use "nano", "vi", or "vim" to open and edit the "build.sh" file

> vi build.sh;  or  nano build.sh

you only need to make changes in 3 places:

3) First place around line #258, under # mpich2  (see attached Build.sh)
if [ "$compiler" = 'gnu' ]; then
>>>>#please change #line 258-262 to:
    addpath PATH /opt/mpich-3.2/bin
    export MPI_INCLUDE=/opt/mpich-3.2/include
    export MPILIBS_ADDITIONAL="-L/opt/mpich-3.2/lib -lfmpich -lmpich -lmpl"
    # export MPILIBS_ADDITIONAL=" "
    export MPIFC=/opt/mpich-3.2/bin/mpif90


>>>>4) 2nd place #Change Line 295, THE netcdf root DIR: /usr/local/netcdf4.4 (see attached Build.sh)
 
    export NETCDFROOT=/usr/local/netcdf4.4

5) 3rd place: (see attached Build.sh)
#Change around line 377. --prefix="pwd"  TO --prefix=/home/YOURID/delft3d/trunk7545/bin  (by doing this, and you do not need to change any example test case code, you can just run it)    
or WHEREVER you want to install.  (IF do not change here, you can copy the lnx64 folder to and under /home/Paul/delft3d/trunk/bin)

(near "# More information here:
# http://www.gentoo.org/proj/en/base/amd64/howtos/index.xml?full=1#book_part1_chap3
command=" ")

>>>>#change line 377 to:

  change ./configure  --prefix='pwd'  $configureArgs &> $log \   to

  ./configure  --prefix=/home/ubuntu/delft3d/trunk7545/bin  $configureArgs &> $log \
or ./configure  --prefix=/home/YOURID/delft3d/trunk7545/bin  $configureArgs &> $log \

(please make sure change your userid and trunk#)

6)***************** THAT'S ALL!!!!!****************************  #SVAE the "build.sh" file

9. #NOW TRY TO COMPLIE

   ./build.sh -gnu -64bit

#(it will take 10-20 mins, you can check the log file under /logs, It should be okay if anything wrong, please see what you missed)

10. Test and run examples:
1) cd ~/delft3d/trunk7545;
2) to run the Delft3d, you need a series of right PATH and environments
# and copy the following configures into the above file editor (n
#------------------

#!/bin/bash
export PATH=/home/YourID/delft3d/trunk7545/bin/lnx64/flow2d3d/bin:$PATH
export PATH=/home/YourID/delft3d/trunk7545/bin/lnx64/wave/bin:$PATH
export PATH=/home/YOURid/delft3d/trunk7545/bin/lnx64/swan/scripts:$PATH
export LD_LIBRARY_PATH=/home/YOURID/delft3d/trunk7545/bin/lnx64/flow2d3d/bin:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=/home/YOURID/delft3d/trunk7545/bin/lnx64/wave/bin:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=/home/YOURID/delft3d/trunk7545/bin/lnx64/swan/bin:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=/home/YOURID/delft3d/trunk7445/bin/lnx64/swan/scripts:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=/opt/mpich-3.2/lib:$LD_LIBRARY_PATH
export PATH=/opt/mpich-3.2/bin:$PATH


# ———

3) nano delft3d_env.sh 
COPY AND edit the above text, PLEASE CHANGE THE YOURID to your id, or "ubuntu" under Amazon AWS EC2;

Save the file "delft3d_env.sh " under your current trunk—  "trunk7545"
(see attached *.sh)
11. #before run any project, just run a command: "

 
 source /home/ubuntu/delft3d/trunk7545/delft3d_env.sh

 or
   source /home/YOURID/delft3d/trunk/delft3d_env.sh


# THIS IS VERY IMPORTANT STEP. By doing this, will make all paths and libraries ready to use any where you want!!!!

If not, you will the following errors: "d_hydro ABORT: Cannot load component library "libflow2d3d.so": libmpifort.so.12: cannot open shared object file: No such file or directory"

 

After run " source /home/ubuntu/delft3d/trunk7545/delft3d_env.sh" in your Terminal

In any anywhere (directory/folder), you can type:    wave.exe

you will see: "Usage: waves.exe <mdw-file> [mode]
       <mdw-file>: Name of the (input) mdw-file"

Congratulations!   You are ready to GO!


12. #Go to Examples or any your project

source /home/ubuntu/delft3d/trunk7545/delft3d_env.sh


1)  cd /home/YOURID/delft3d/trunk/examples/01_standard
2)  ./run_flow2d3d.sh

#Or directly run some tests:  d_hydro.exe config_d_hydro.xml

3)  flow and wave  03_flow-wave

./run_flow2d3d.sh     or ./run_flow2d3d_parallel_wave.sh
 
 or  d_hydro.exe config_d_hydro.xml & wave.exe r17.mdw 1

or   Pa

mpirun -np 2 d_hydro.exe config_d_hydro.xml & wave.exe r17.mdw 1

Just enjoy!  If have any question, u'r welcome to contact me: jpliu AT ncsu.edu

installation installation linux 32-bit 64-bit compiling delft3d under ubuntu compile delft3d in ubuntu 7545 ubuntu16.04 amazon aws ec2