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 Post by tarankalra » Sat May 09, 2015 9:23 pm

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: 3718
Joined: Wed Jul 02, 2003 5:29 pm
Location: IMS/UAF, USA

Re: Finished compiling COAWST Installation - Ubuntu 14.04

#2 Post by kate » Mon May 11, 2015 6:59 pm

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 Post by tara » Fri Jul 31, 2015 10:25 am

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: 816
Joined: Wed Dec 31, 2003 6:16 pm
Location: USGS, USA

Re: Finished compiling COAWST Installation - Ubuntu 14.04

#4 Post by jcwarner » Fri Jul 31, 2015 4:32 pm

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 Post by HugoMichel » Thu Aug 06, 2015 11:37 pm

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: 3718
Joined: Wed Jul 02, 2003 5:29 pm
Location: IMS/UAF, USA

Re: Finished compiling COAWST Installation - Ubuntu 14.04

#6 Post by kate » Thu Aug 06, 2015 11:48 pm

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 Post by HugoMichel » Fri Aug 07, 2015 12:05 am

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: 3718
Joined: Wed Jul 02, 2003 5:29 pm
Location: IMS/UAF, USA

Re: Finished compiling COAWST Installation - Ubuntu 14.04

#8 Post by kate » Fri Aug 07, 2015 12:07 am

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 Post by HugoMichel » Fri Aug 07, 2015 9:31 pm

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 Post by HugoMichel » Fri Aug 07, 2015 10:09 pm

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

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

Re: Finished compiling COAWST Installation - Ubuntu 14.04

#11 Post by kate » Fri Aug 07, 2015 10:25 pm

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 Post by Ahumada » Sat Aug 08, 2015 11:54 pm

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 Post by ngarg » Sun Aug 09, 2015 6:35 am

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 Post by Ahumada » Sun Aug 09, 2015 3:48 pm

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: 3718
Joined: Wed Jul 02, 2003 5:29 pm
Location: IMS/UAF, USA

Re: Finished compiling COAWST Installation - Ubuntu 14.04

#15 Post by kate » Sun Aug 09, 2015 4:11 pm

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 Post by Ahumada » Mon Aug 10, 2015 2:27 pm

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 Post by HugoMichel » Mon Aug 10, 2015 6:06 pm

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: 3718
Joined: Wed Jul 02, 2003 5:29 pm
Location: IMS/UAF, USA

Re: Finished compiling COAWST Installation - Ubuntu 14.04

#18 Post by kate » Mon Aug 10, 2015 6:49 pm

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 Post by HugoMichel » Mon Aug 10, 2015 11:51 pm

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: 3718
Joined: Wed Jul 02, 2003 5:29 pm
Location: IMS/UAF, USA

Re: Finished compiling COAWST Installation - Ubuntu 14.04

#20 Post by kate » Tue Aug 11, 2015 12:02 am

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 Post by HugoMichel » Wed Aug 12, 2015 4:44 pm

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 Post by tarankalra » Fri Aug 14, 2015 6:27 pm

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 Post by HugoMichel » Tue Aug 18, 2015 3:19 pm

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: 816
Joined: Wed Dec 31, 2003 6:16 pm
Location: USGS, USA

Re: Finished compiling COAWST Installation - Ubuntu 14.04

#24 Post by jcwarner » Tue Aug 18, 2015 4:19 pm

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 Post by ilgar » Mon Aug 29, 2016 1:34 pm

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
Posts: 35
Joined: Thu Oct 03, 2019 4:43 pm
Location: the Chinese University of Hong Kong

Re: Finished compiling COAWST Installation - Ubuntu 14.04

#26 Post by venuscheung » Fri Oct 11, 2019 4:12 pm

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: 3718
Joined: Wed Jul 02, 2003 5:29 pm
Location: IMS/UAF, USA

Re: Finished compiling COAWST Installation - Ubuntu 14.04

#27 Post by kate » Sat Oct 12, 2019 3:35 am

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