Finished compiling COAWST Installation - Ubuntu 14.04

Discussion on computers, ROMS installation and compiling

Moderators: arango, robertson

Post Reply
Message
Author
tarankalra
Posts: 5
Joined: Wed Dec 10, 2014 9:34 pm
Location: University of Maryland

Finished compiling COAWST Installation - Ubuntu 14.04

#1 Unread post by tarankalra »

This post might help people with installing COAWST on their local Linux machines. I had recently installed the latest version of COAWST on an Ubuntu 14.04 desktop. These steps are not very different from the original post that gave guidance on installing ROMS on a Linux Machine.
However a few new versions have come up of various packages after that so this can be useful.

Steps to install

ROMS/COAWST can require subversion, GNUMAKE, Gfortran (Free Fortran compiler), Perl, Gcc, netcdf libraries.

1. Install subversion
---------------------------------------------------------------------------------------
sudo apt-get install subversion
---------------------------------------------------------------------------------------
Add the installation path to .bash_profile
export PATH=/opt/subversion/bin:$PATH

2. Do a SVN check out of the source code (ROMS/COAWST)
---------------------------------------------------------------------------------------
svn checkout --username usrname https://coawstmodel.sourcerepo.com/coawstmodel/COAWST .
---------------------------------------------------------------------------------------

3. Install gfortran
---------------------------------------------------------------------------------------
sudo apt-get install gfortran
---------------------------------------------------------------------------------------


4. Install gcc,GNUMAKE-3.81
---------------------------------------------------------------------------------------
sudo apt-get install build-essential
---------------------------------------------------------------------------------------
Check the versions of gcc and GNUMAKE
make -v
gcc -v

5. Install NETCDF, HDF5
---------------------------------------------------------------------------------------
This was the link (http://forum.wrfforum.com/viewtopic.php?f=5&t=7099) that I basically used which guided me home with NETCDF installation.
I am going to rewrite the steps from the link. I had to install NETCDF-4.3.2 version of Fortran rather than NETCDF-4.4.0 as the link describes. I was getting errors with the latest version.

The steps for NETCDF installation require the installation of zlib, hdf5, netcdf and then netcdf-fortran. I have installed all these in
my /usr/local folder with sudo command. This helps me to locate the folders easily and not delete them accidentally if they are somewhere else on the machine.
---------------------------------------------------------------------------------------
5a) install zlib.1.8 based on WRF link above instructions step 4
5b) install hdf5 based on WRF link above instructions step 5

Then add the following lines in your path inside ".bashrc"

export CPPFLAGS="-I/usr/local/hdf5-1.8.13/include -I/usr/local/zlib-1.2.8/include -I/usr/local/netcdf.4.3.2/include"
export LDFLAGS="-L/usr/local/hdf5-1.8.13/lib -L/usr/local/zlib-1.2.8/lib -L/usr/local/netcdf.4.3.2/lib"
export LD_LIBRARY_PATH="/usr/local/hdf5-1.8.13/lib /usr/local/zlib-1.2.8/lib /usr/local/netcdf.4.3.2/lib"

5c) Extract netcdf-4.3.2 from .tar.gz found here
http://www.gfd-dennou.org/arch/ucar/netcdf/
5c1) tar xvf netcdf-4.3.2
5c2) make a directory for netcdf.4.3.2 inside /usr/local/
sudo mkdir /usr/local/netcdf.4.3.2 inside the folder
5c3)./configure --prefix=/usr/local/netcdf.4.3.2 (notice that this is different from the downloaded folder ie. netcdf-4.3.2 as we want to install netcdf-4.3.2 and netcdf-fortran in one folder)
5c4) make
5c5) make install
5d) Extract netcdf-4.3.2 fortran from .tar.gz found here (same link as before ie. http://www.gfd-dennou.org/arch/ucar/netcdf/)
5d1) tar xvf
5d2) ./configure --prefix=/usr/local/netcdf.4.3.2 (same folder as before)
5d3) make
5d4) make install
---------------------------------------------------------------------------------------
This concludes the installation for NETCDF

For running the code in parallel and using the coupling mode, one needs to install
MPICH (to implement MPI standard commands) and MCT (Model Coupling Toolkit).

6) Installing MPICH For parallel jobs
---------------------------------------------------------------------------------------
sudo apt-get install mpich-2
---------------------------------------------------------------------------------------

7) Installing MCT
Go inside the folder COAWST/Lib/MCT and
---------------------------------------------------------------------------------------
7a) ./configure
showed me a warning :
configure: WARNING: UNKNOWN FORTRAN 90 COMPILER
Output Variables: {CC=cc} {ALLCFLAGS=-DFORTRAN_UNDERSCORE_ -DSYSLINUX -DCPRUNKNOWNCPR -O} {FPP=cpp} {FPPFLAGS=-P -C -N -traditional} {FC=mpif90} {F90=f95} {FCFLAGS=} {F90FLAGS=} {MACHDEFS=-DSYSLINUX -DCPRUNKNOWNCPR} {OPT=} {REAL8=} {BIT64=} {ENDIAN=} {MPIF90=mpif90} {MPILIBS=} {MPIHEADER=} {INCLUDEFLAG=-I} {INCLUDEPATH=} {AR=ar cq} {BABELROOT=} {COMPILER_ROOT=} {PYTHON=} {PYTHONOPTS=} {FORT_SIZE=} {prefix=NONE}
7b)make
7c)make install
---------------------------------------------------------------------------------------

8. Inside COAWST/Compilers
Changed the lines 99-100 in Linux-gfortran.mk to be this:
FFLAGS += -I$(MCT_INCDIR) -I$(MPEU_INCDIR)
LIBS += -L$(MCT_LIBDIR) -lmct -L$(MPEU_LIBDIR) -lmpeu

Thank you,
Taran
Last edited by tarankalra on Wed Aug 24, 2016 4:20 pm, edited 1 time in total.

User avatar
kate
Posts: 4091
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: Finished compiling COAWST Installation - Ubuntu 14.04

#2 Unread post by kate »

Thanks for the nice description!

For those who don't have write access to the svn repo, but who would like to use source code management tools for their own changes, I recommend adding "git" to the list of packages. You can then:

Code: Select all

git svn clone <URL> <localdir>
There is at least one ROMS user who uses Mercurial instead of git, but it's the same idea - maintain your own changes, branches, etc. locally while still being able to download improvements from the trunk code.

tara
Posts: 26
Joined: Mon Aug 11, 2014 5:05 pm
Location: Indian Institute of Technology

Re: Finished compiling COAWST Installation - Ubuntu 14.04

#3 Unread post by tara »

Hello Roms Community,

Can anyone share the information about how to get the registered user id and password for downloading the source code of latest version of COAWST.

With Regards-
Tara

jcwarner
Posts: 1200
Joined: Wed Dec 31, 2003 6:16 pm
Location: USGS, USA

Re: Finished compiling COAWST Installation - Ubuntu 14.04

#4 Unread post by jcwarner »

send an email to
jcwarner@usgs.gov

HugoMichel
Posts: 13
Joined: Tue Aug 04, 2015 4:42 pm
Location: Universidad Del Mar

Re: Finished compiling COAWST Installation - Ubuntu 14.04

#5 Unread post by HugoMichel »

i have with a problem in this step.

5c3)./configure --prefix=/usr/local/netcdf.4.3.2 (notice that this is different from the downloaded folder ie. netcdf-4.3.2 as we want to install netcdf-4.3.2 and netcdf-fortran in one folder)



checking size of off_t... 8
checking size of size_t... 8
checking for library containing deflate... -lz
checking for floor in -lm... yes
checking for dlfcn.h... (cached) yes
checking for dlopen in -ldl... yes
checking for library containing H5Fflush... no
configure: error: Can't find or link to the hdf5 library. Use --disable-netcdf-4, or see config.log for errors.
[root@localhost netcdf-4.3.3]#


i am thankful for yours friendliness

User avatar
kate
Posts: 4091
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: Finished compiling COAWST Installation - Ubuntu 14.04

#6 Unread post by kate »

configure: error: Can't find or link to the hdf5 library. Use --disable-netcdf-4, or see config.log for errors.
I take it this is the configure of netcdf4. Do you want to use the new compression features of netcdf4? They use the hdf5 library. If not, you can use --disable-netcdf-4 to turn it off. Otherwise, you need to build hdf5 and tell netcdf where to find it. Did you do all this stuff listed above?

Code: Select all

5a) sudo apt-get install zlib.1.8
5b) sudo apt-get install hdf5

Then add the following lines in your path inside ".bashrc"

export CPPFLAGS="-I/usr/local/hdf5-1.8.13/include -I/usr/local/zlib-1.2.8/include -I/usr/local/netcdf.4.3.2/include"
export LDFLAGS="-L/usr/local/hdf5-1.8.13/lib -L/usr/local/zlib-1.2.8/lib -L/usr/local/netcdf.4.3.2/lib"
export LD_LIBRARY_PATH="/usr/local/hdf5-1.8.13/lib /usr/local/zlib-1.2.8/lib /usr/local/netcdf.4.3.2/lib"

HugoMichel
Posts: 13
Joined: Tue Aug 04, 2015 4:42 pm
Location: Universidad Del Mar

Re: Finished compiling COAWST Installation - Ubuntu 14.04

#7 Unread post by HugoMichel »

for that i use gedit ~/.bashrc
# .bashrc

# User specific aliases and functions

alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
export CPPFLAGS="-I/usr/local/hdf5-1.8.13/include -I/usr/local/zlib-1.2.8/include -I/usr/local/netcdf.4.3.3/include"
export LDFLAGS="-L/usr/local/hdf5-1.8.13/lib -L/usr/local/zlib-1.2.8/lib -L/usr/local/netcdf.4.3.3/lib"
export LD_LIBRARY_PATH="/usr/local/hdf5-1.8.13/lib /usr/local/zlib-1.2.8/lib /usr/local/netcdf.4.3.3/lib"

# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
but maybe i can to do bad

User avatar
kate
Posts: 4091
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: Finished compiling COAWST Installation - Ubuntu 14.04

#8 Unread post by kate »

Did you execute the .bashrc after editing it? You have to either log out and log back in or else do:

Code: Select all

. ~/.bashrc

HugoMichel
Posts: 13
Joined: Tue Aug 04, 2015 4:42 pm
Location: Universidad Del Mar

Re: Finished compiling COAWST Installation - Ubuntu 14.04

#9 Unread post by HugoMichel »

i do that but happens the same, maybe i install the hdf5 in other site.it maybe that the error ?

HugoMichel
Posts: 13
Joined: Tue Aug 04, 2015 4:42 pm
Location: Universidad Del Mar

Re: Finished compiling COAWST Installation - Ubuntu 14.04

#10 Unread post by HugoMichel »

sorry but i forget to say that my distribution is FEDORA 21

User avatar
kate
Posts: 4091
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: Finished compiling COAWST Installation - Ubuntu 14.04

#11 Unread post by kate »

Only you would know if the hdf5 library is here on your system:
/usr/local/hdf5-1.8.13/lib

Ahumada
Posts: 11
Joined: Fri Jul 13, 2007 3:01 pm
Location: Universidad del Mar

Re: Finished compiling COAWST Installation - Ubuntu 14.04

#12 Unread post by Ahumada »

Hi,

I found netcdf-4.3.2.tar.gz in http://www.gfd-dennou.org/arch/ucar/netcdf/old/ but I cannot find netcdf-fortran-4.3.2.tar.gz

Do you have any suggestions on where I could find it?

Thanks in advance

Cheers!

M.A.

User avatar
ngarg
Posts: 19
Joined: Fri Jul 12, 2013 5:46 pm
Location: NTU

Re: Finished compiling COAWST Installation - Ubuntu 14.04

#13 Unread post by ngarg »

You can use the below links to find the releases of NetCDF library you need

https://github.com/Unidata/netcdf-c/releases
https://github.com/Unidata/netcdf-fortran/releases

If you are still facing the issue in finding HDF5 library, just locate the hdf5 lib and include, as well as zlib lib path and pass it to configure

CPPFLAGS=-I/usr/local/hdf5-1.8.13/include -I/usr/local/zlib-1.2.8/include LDFLAGS=-L/usr/local/hdf5-1.8.13/lib
-L/usr/local/zlib-1.2.8/lib ./configure --prefix=/usr/local/netcdf.4.3.2 --disable-dap --disable-large-file-tests --disable-dap-remote-tests --disable-cxx

Something like this should work. I tend to disable dap, but you can keep it if you want.

Ahumada
Posts: 11
Joined: Fri Jul 13, 2007 3:01 pm
Location: Universidad del Mar

Re: Finished compiling COAWST Installation - Ubuntu 14.04

#14 Unread post by Ahumada »

Hi,

I have installed netcdf-4.3.2 but I cannot find netcdf-fortran-4.3.2.
Is it possible to use another netcdf-fortran version with netcdf-4.3.2, for example the latest release (netcdf-fortran-4.4.2?

Thanks in advance!

M.A.

User avatar
kate
Posts: 4091
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: Finished compiling COAWST Installation - Ubuntu 14.04

#15 Unread post by kate »

Yes, they disconnected netcdf-fortran from the netcdf bundle so that they could release versions as needed, out of step. Just get the latest.

Ahumada
Posts: 11
Joined: Fri Jul 13, 2007 3:01 pm
Location: Universidad del Mar

Re: Finished compiling COAWST Installation - Ubuntu 14.04

#16 Unread post by Ahumada »

Hi,

I cannot connect to https://coawstmodel.sourcerepo.com/coawstmodel/COAWST .
Any suggestions?

Thanks

M.A.

HugoMichel
Posts: 13
Joined: Tue Aug 04, 2015 4:42 pm
Location: Universidad Del Mar

Re: Finished compiling COAWST Installation - Ubuntu 14.04

#17 Unread post by HugoMichel »

when i try install MCT i have a problems because showed me that:

configure: WARNING: UNKNOWN FORTRAN 90 COMPILER

Output Variables: {CC=cc} {ALLCFLAGS=-DFORTRAN_UNDERSCORE_ -DSYSLINUX -DCPRUNKNOWNCPR -O} {FPP=cpp} {FPPFLAGS=-P -C -N -traditional} {FC=f95} {F90=f95} {FCFLAGS=} {F90FLAGS=} {MACHDEFS=-DSYSLINUX -DCPRUNKNOWNCPR} {OPT=} {REAL8=} {BIT64=} {ENDIAN=} {MPIF90=f95} {MPILIBS=} {MPIHEADER=} {INCLUDEFLAG=-I} {INCLUDEPATH=} {AR=ar cq} {BABELROOT=} {COMPILER_ROOT=} {PYTHON=} {PYTHONOPTS=} {FORT_SIZE=} {prefix=NONE}

configure: creating ./config.status
config.status: creating Makefile.conf
Please check the Makefile.conf
Have a nice day!
[michel@localhost MCT]$ make
make[1]: Entering directory '/home/michel/COAWST/Lib/MCT/mpeu'
cc -c -DFORTRAN_UNDERSCORE_ -DSYSLINUX -DCPRUNKNOWNCPR -O get_zeits.c
f95 -c -DSYSLINUX -DCPRUNKNOWNCPR m_mpif.F90
m_mpif.F90:60: Error: Can't open included file 'mpif.h'
Makefile:66: recipe for target 'm_mpif.o' failed
make[1]: *** [m_mpif.o] Error 1
make[1]: Leaving directory '/home/michel/COAWST/Lib/MCT/mpeu'
Makefile:10: recipe for target 'subdirs' failed
make: *** [subdirs] Error 2

User avatar
kate
Posts: 4091
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: Finished compiling COAWST Installation - Ubuntu 14.04

#18 Unread post by kate »

You told it your compiler is called "f95". Do you have such a compiler? Does your system have an MPI library? It's also complaining about mpif.h, an mpi include file. Is there someone you can ask about these things on your system?

HugoMichel
Posts: 13
Joined: Tue Aug 04, 2015 4:42 pm
Location: Universidad Del Mar

Re: Finished compiling COAWST Installation - Ubuntu 14.04

#19 Unread post by HugoMichel »

mi compiler is gcc-gfortran-4.9.2-6.fc21.x86_64

and yes i have a MPI library and in the directory mct are ampif.h and mpi include file

User avatar
kate
Posts: 4091
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: Finished compiling COAWST Installation - Ubuntu 14.04

#20 Unread post by kate »

You probably want to tell configure that your compiler is called "mpif90".

HugoMichel
Posts: 13
Joined: Tue Aug 04, 2015 4:42 pm
Location: Universidad Del Mar

Re: Finished compiling COAWST Installation - Ubuntu 14.04

#21 Unread post by HugoMichel »

hi
i finish the installing thanks for the attentions, my next step is install the SCRIP but i have problems and i tried all but i can't, when i use make to build the executable happend that

remap_write.o:remap_write.f:(.text+0x4d65): más referencias a `nf_put_var_double_' sin definir a continuación
remap_write.o: En la función `__remap_write_MOD_write_remap_scrip':
remap_write.f:(.text+0x4ed6): referencia a `nf_put_var_int_' sin definir
remap_write.f:(.text+0x4efe): referencia a `nf_put_var_int_' sin definir
remap_write.f:(.text+0x4f26): referencia a `nf_put_var_double_' sin definir
remap_write.f:(.text+0x4f42): referencia a `nf_close_' sin definir
remap_write.f:(.text+0x5f04): referencia a `nf_put_var_int_' sin definir
remap_write.f:(.text+0x5f2c): referencia a `nf_put_var_int_' sin definir
collect2: error: ld devolvió el estado de salida 1
makefile:57: recipe for target 'scrip' failed
make: *** [scrip] Error 1
[root@localhost source]#


thanks for read

Hugo

tarankalra
Posts: 5
Joined: Wed Dec 10, 2014 9:34 pm
Location: University of Maryland

Re: Finished compiling COAWST Installation - Ubuntu 14.04

#22 Unread post by tarankalra »

Make sure that you have correct paths for NETCDF libraries as you had in COAWST installation.
Also I added "-lnetcdf" and "-lnetcdff" flags along with compiler flags in the makefile for SCRIP to get
compiled.
COMPILE = ifort -lnetcdf -lnetcdff

HugoMichel
Posts: 13
Joined: Tue Aug 04, 2015 4:42 pm
Location: Universidad Del Mar

Re: Finished compiling COAWST Installation - Ubuntu 14.04

#23 Unread post by HugoMichel »

when i try complie JOE_TC THIS ERROR CAME UP:

Opciones del shell:
-ilrsD or -c command or -O shopt_option (invocation only)
-abefhkmnptuvxBCHP o -o opción
cp -f /usr/local/include/netcdf.mod ./Build
cp: no se puede efectuar `stat' sobre «/usr/local/include/netcdf.mod»: No existe el fichero o el directorio
make: *** No rule to make target 'Build/netcdf.mod', needed by 'Build/MakeDepend'. Alto.

UP TO THIS SHOW THAT

Error : Not found /home/michel/COAWST/WRF/netcdf_links/include/netcdf.inc

Please check this installation of NetCDF and re-run this configure scrip


THANKS FOR READ

jcwarner
Posts: 1200
Joined: Wed Dec 31, 2003 6:16 pm
Location: USGS, USA

Re: Finished compiling COAWST Installation - Ubuntu 14.04

#24 Unread post by jcwarner »

Please don't post COAWST questions on the roms forum. I saw your post on the coawst trac but did not get a chace to answer it yet. In reality, this is an issue with your compilation of WRF. See the COAWST user manual :

Set your environment variables, for example as shown here:
setenv MCT_INCDIR /PATH_TO_YOUR_MCT/include
setenv MCT_LIBDIR /PATH_TO_YOUR_MCT/lib
setenv NETCDF_INCDIR /PATH_TO_YOUR_NETCDF/include
setenv NETCDF_LIBDIR /PATH_TO_YOUR_NETCDF/lib
setenv NETCDF /PATH_TO_YOUR_NETCDF/

The settings of MCT_INCDIR and MCT_LIBDIR are needed to build a coupled system. The settings of NETCDF _INCDIR and _LIBDIR are for roms. The setting of NETCDF is for WRF.

ilgar
Posts: 3
Joined: Fri Mar 09, 2012 5:26 pm
Location: USGS Woods Hole

Re: Finished compiling COAWST Installation - Ubuntu 14.04

#25 Unread post by ilgar »

Here are the two things that helped me tackle the netcdf issues discussed above (using zlib-1.2.8.tar.gz ; hdf5-1.8.13.tar.gz ; netcdf-4.3.2.tar.gz ; netcdf-fortran-4.4.0.tar.gz ):

1) When configuring netcdf, I added the flags for hdf5. ngarg's post was implying that but where I wrote the CPPFLAGS etc. (see below) solved that step for me, and I did not have to disable anything. Here's the command:

sudo ./configure CPPFLAGS=-I/usr/local/hdf5-1.8.13/include LDFLAGS=-L/usr/local/hdf5-1.8.13/lib –prefix=/usr/local/netcdf.4.3.2

2) Similarly, when configuring netcdf fortran, I added the flags for netcdf :

sudo ./configure CPPFLAGS=-I/usr/local/netcdf.4.3.2/include LDFLAGS=-L/usr/local/netcdf.4.3.2/lib --prefix=/usr/local/netcdf.4.3.2

3) I could not find netcdf fortran 4.3.2 either but netcdf 4.3.2 and netcdf fortran 4.4.0 worked fine together once I applied steps 1&2.


Ilgar

venuscheung

Re: Finished compiling COAWST Installation - Ubuntu 14.04

#26 Unread post by venuscheung »

i am trying to install netcdf-fortran but i recieved several error messege after i used your methods mentioned above. would you guys have any suggestions for me?

nf_test.F:217:32:

217 | cmode(num_cmode) = nf_cdf5
| 1
Error: Symbol 'nf_cdf5' at (1) has no IMPLICIT type; did you mean 'nf_char'?
make[3]: *** [nf_test.o] Error 1
make[2]: *** [check-am] Error 2
make[1]: *** [check] Error 2
make: *** [check-recursive] Error 1

User avatar
kate
Posts: 4091
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: Finished compiling COAWST Installation - Ubuntu 14.04

#27 Unread post by kate »

The modern way to install netcdf-fortran on Ubuntu is:
sudo apt install netcdf-bin libnetcdf-dev libnetcdff-dev
Then you will have to check to see if nf-config is working because some versions gave a weird error about cmake.

Post Reply