How to install WRF 3.6.1 on Ubuntu 14.10 server.

Very very long time for updating my site, www.aoddy.com. Today, I really need to share some experience about installation of WRF 3.6.1 on Ubunt 14.10 server. OK let’s start now.

Server specification:

OS : Ubuntu Server 14.10 and install ubuntu-gnome-desktop
CPU : Intel Core i3 (2 Cores)
Memory : 8 GB

Location of installation software:

/home/aoddy/Develops/WRF/WRF3
/home/aoddy/Develops/WRF/library

|— mpich-3.1.2.tar
|— zlib-1.2.8.tar
|— hdf5-1.8.12.tar
|— netcdf-4.3.2.tar
|— ARWpost_V3.tar
|— jasper-1.701.0.tar
|— libpng-1.6.12.tar
|— bufr.tar

Libraly & Software require:

  1. mpich-3.1.2.tar.gz
  2. zlib-1.2.8.tar.gz
  3. hdf5-1.8.13.tar.gz
  4. netcdf-4.3.2.tar.gz
  5. netcdf-fortran-4.4.0.tar.gz
  6. netcdf-cxx4-4.2.tar.gz
  7. ARWpost_V3.tar.gz
  8. jasper-1.701.0.tar.gz
  9. libpng-1.6.12.tar.gz
  10. bufr.tar.gz
  11. WRF 3.6.1

Step#1: We need to install gcc gcc-c++ gcc-gfortran first by

$ sudo apt-get install gcc gcc-c++ gcc-gfortran

Step#2 : Install basic software for compiling software.
$ sudo apt-get install build-essential

Step#3 : Install MPI

$ ./configure --prefix=/home/wrfadmin/WRFV3/library/mpich-3.0.4/mpich-install
$ make
$ make install

Then add path of MPI into file ~/.basrc

PATH=/home/wrfadmin/WRFV3/library/mpich-3.0.4/mpich-install/bin:$PATH;export PATH

Step#4 : Install zlib

$ ./configure --prefix=/home/wrfadmin/WRFV3/library/zlib-1.2.8
$ make test
$ make install

Then add path of zlib into file ~/.basrc

export zlib=/home/wrfadmin/WRFV3/library/zlib-1.2.8

Step#5 : Install HDF5
$ ./configure --prefix=/home/aoddy/Develops/WRF/library/hdf5-1.8.13 --enable-fortran --enable-cxx --with-zlib=/home/aoddy/Develops/WRF/library/zlib-1.2.8
$ make
$ make test
$ make install
$ make check-install

Then add path of HDF5 into file ~/.basrc

export HDF5=/home/wrfadmin/WRFV3/library/hdf5-1.8.12

Step#6 : Install NetCDF4.3.2

Before you start to compile&install you need to add a list of export variable below in ~/.bashrc

export CPPFLAGS="-I/home/aoddy/Develops/WRF/library/hdf5-1.8.13/include -I/home/aoddy/Develops/WRF/library/zlib-1.2.8/include -I/home/aoddy/Develops/WRF/library/netcdf.4.3.2/include"
export LDFLAGS="-L/home/aoddy/Develops/WRF/library/hdf5-1.8.13/lib -L/home/aoddy/Develops/WRF/library/zlib-1.2.8/lib -L/home/aoddy/Develops/WRF/library/netcdf.4.3.2/lib"
export LD_LIBRARY_PATH="/home/aoddy/Develops/WRF/library/hdf5-1.8.13/lib /home/aoddy/Develops/WRF/library/zlib-1.2.8/lib /home/aoddy/Develops/WRF/library/netcdf.4.3.2/lib"

** Don’t forget to update .bashrs by :
$ source ~/.bashrc

Create a directory for new netcdf. (It’s not the same directory of netcdf software.)

$ mkdir netcdf.4.3.2
Go to the installation netcdf software (netcdf-4.3.2) and start to install :
** Directory of source code is netcdf-4.3.2 but the directory for installation is netcdf.4.3.2 **

$ ./configure --prefix=/home/aoddy/Develops/WRF/library/netcdf.4.3.2 FC=gfortran F77=gfortran CC=gcc --enable-shared
$ make
$ make check
$ make install

You need to update ~/.bashrc file by adding :

export NetCDF=/home/aoddy/Develops/WRF/library/netcdf.4.3.2
export NETCDF_LIB=/home/aoddy/Develops/WRF/library/netcdf.4.3.2/lib
export NETCDF_INC=/home/aoddy/Develops/WRF/library/netcdf.4.3.2/include

Step#7 : Install netcdf-fortran-4.4.0
The installation of netcdf-fortran should install in the same of netcdf directory.
./configure --prefix=/home/aoddy/Develops/WRF/library/netcdf.4.3.2 FC=gfortran F77=gfortran CC=gcc --enable-shared 2>&1 | tee configure.log
$ make
$ make check
$ make install

Step#8 : Install netcdf-cxx4-4.2
The installation of netcdf-cxx should install in the same of netcdf directory.
./configure --prefix=/home/aoddy/Develops/WRF/library/netcdf.4.3.2 FC=gfortran F77=gfortran CC=gcc --enable-shared 2>&1 | tee configure.log
$ make
$ make check
$ make install

Step#9 : Install Install Jasper

./configure --prefix=/home/aoddy/Develops/WRF/library/jasper-1.900.1
make
make check
make install

You need to update ~/.bashrc file by adding :

export jasper=/home/aoddy/Develops/WRF/library/jasper-1.900.1
export JASPERLIB=/home/aoddy/Develops/WRF/library/jasper-1.900.1/lib
export JASPERINC=/home/aoddy/Develops/WRF/library/jasper-1.900.1/include

Step#10 : Install lipng

./configure --prefix=/home/aoddy/Develops/WRF/library/libpng-1.6.9
make
make check
make install

You need to update ~/.bashrc file by adding :
export libpng=/home/aoddy/Develops/WRF/library/libpng-1.6.9

Step#11 : Install burf
tar xvfz bufr.tar.gz
cd bufr
gcc -c *.c
gfortran -c -DUNDERSCORE *.f
ar -ru libbufr.a *.o

You need to update ~/.bashrc file by adding :
export BUFR=/home/aoddy/Develops/WRF/library/bufr

Step#12 : Verified .bashrc file
PATH=/home/aoddy/Develops/WRF/library/mpich-3.1.2/mpich-install/bin:$PATH;export PATH
export HDF5=/home/aoddy/Develops/WRF/library/hdf5-1.8.13
export BUFR=/home/aoddy/Develops/WRF/library/bufr
export NetCDF=/home/aoddy/Develops/WRF/library/netcdf.4.3.2
export NETCDF=/home/aoddy/Develops/WRF/library/netcdf.4.3.2
export NETCDF_LIB=/home/aoddy/Develops/WRF/library/netcdf.4.3.2/lib
export NETCDF_INC=/home/aoddy/Develops/WRF/library/netcdf.4.3.2/include
export jasper=/home/aoddy/Develops/WRF/library/jasper-1.701.0
export JASPERLIB=/home/aoddy/Develops/WRF/library/jasper-1.701.0/lib
export JASPERINC=/home/aoddy/Develops/WRF/library/jasper-1.701.0/include
export libpng=/home/aoddy/Develops/WRF/library/libpng-1.6.12
export zlib=/home/aoddy/Develops/WRF/library/zlib-1.2.8

export CPPFLAGS=”-I/home/aoddy/Develops/WRF/library/hdf5-1.8.13/include -I/home/aoddy/Develops/WRF/library/zlib-1.2.8/include -I/home/aoddy/Develops/WRF/library/netcdf.4.3.2/include”
export LDFLAGS=”-L/home/aoddy/Develops/WRF/library/hdf5-1.8.13/lib -L/home/aoddy/Develops/WRF/library/zlib-1.2.8/lib -L/home/aoddy/Develops/WRF/library/netcdf.4.3.2/lib”
export LD_LIBRARY_PATH=”/home/aoddy/Develops/WRF/library/hdf5-1.8.13/lib /home/aoddy/Develops/WRF/library/zlib-1.2.8/lib /home/aoddy/Develops/WRF/library/netcdf.4.3.2/lib”
export WRFIO_NCD_LARGE_FILE_SUPPORT=1

Step#13 : WRFV3.6.1
./configure
./compile em_real 2>&1 | tee compile.log

Some error message after you compiled, something like this :

 

Fatal Error: Can’t open module file ‘wrf_data.mod’ for reading at (1): No such file or directory

You need to update something in configure.wrf  like :

DM_FC           =       mpif90
DM_CC           =       mpicc -DMPI2_SUPPORT -DMPI2_THREAD_SUPPORT

And don’t forget to install ‘m4’ by :

$ sudo apt-get install m4

Finish!!!

0 0 vote
Article Rating
10 Comments
Inline Feedbacks
View all comments
shahzad
shahzad
6 years ago

Thanks for your valuable tutorial, I would like to ask about Mac OS 10.4.x as according to WRF official website
MAC Mavericks OS (Posted 8/14/2014)

Problem: Current WRF/WPS code does not support CLANG, the default c compiler on this Mac OS

Solution: Work is underway to resolve this issue. In the meantime, one can install gcc instead

is there any solution regarding this?
kindly let me know at shahzad@cuhk.edu.hk

Thanks

Quamrul
Quamrul
6 years ago

When I try to configure wrf it gives following error (WRF V3.6.1, UBUNTU 14.04 and gfortran)
************************** W A R N I N G ************************************

There are some Fortran 2003 features in WRF that your compiler does not recognize
The IEEE signaling call has been removed. That may not be enough.

*****************************************************************************
Any solution?

jain
jain
6 years ago

Hi, trying your tutorial on Ubuntu 14.04. Everything is fine until installing netcdf-fortran. I had to add some flags to the configure:

./configure –prefix=/home/WRF/LIBRARIES/netcdf.4.3.2 FC=gfortran F77=gfortran CC=gcc –enable-shared 2>&1 | tee configure.log

Make works, but make check give me the following errors:make[2]: *** [nf_test] Error 1
make[2]: Leaving directory `/home/piyush/WRF/LIBRARIES/netcdf-fortran-4.4.1/nf_test’
make[1]: *** [check-am] Error 2
make[1]: Leaving directory `/home/piyush/WRF/LIBRARIES/netcdf-fortran-4.4.1/nf_test’
make: *** [check-recursive] Error 1

Any ideas?

Rose
Rose
6 years ago

Thank you for posting this info! It’s been very helpful with getting started with WRF.

I didn’t receive the *.exe, but did receive some fishy lines from the compile log. Would you know what these mean? Thank you!

module_wrfsi_static.f:(.text+0x4a2): undefined reference to `nf_inq_varid_’
module_wrfsi_static.f:(.text+0x500): undefined reference to `nf_get_var_real_’
module_wrfsi_static.f:(.text+0x58d): undefined reference to `nf_close_’
module_wrfsi_static.o: In function `__wrfsi_static_MOD_get_wrfsi_static_dims’:
module_wrfsi_static.f:(.text+0x5e2): undefined reference to `nf_inq_dimid_’
module_wrfsi_static.f:(.text+0x5f6): undefined reference to `nf_inq_dimlen_’
module_wrfsi_static.f:(.text+0x611): undefined reference to `nf_inq_dimid_’
module_wrfsi_static.f:(.text+0x625): undefined reference to `nf_inq_dimlen_’
module_wrfsi_static.f:(.text+0x6c3): undefined reference to `nf_close_’
collect2: error: ld returned 1 exit status
make[2]: [diffwrf] Error 1 (ignored)

Kauan Casarin
Kauan Casarin
6 years ago

Why not configure netcdf with ‘enable-netcdf-4’?
I need netcdf-4 active, how should I proceed?
Tanks

Quamrul
Quamrul
6 years ago

Problem installation of wrfv3.6.1 in ubuntu14.04

Beser
Beser
6 years ago

Hi,

Thanks for clear instruction, but I cannot find bufr.tar.gz from the internet. Can you help me by supplying the required file?

Thanks in advances,

Beser.

mansue said
mansue said
6 years ago

Sir actually my problem is on installation of Intel FORTRAN on Ubuntu 14.10 LTSLTS
Thanks