DINEOF for Windows

From GHER

Jump to: navigation, search

The DINEOF can be build under Windows using MinGW and MSYS (http://www.mingw.org/). The official MinGW compilers support only Fortran 77, therefore we are using the MinGW compiler from http://gcc.gnu.org/wiki/GFortranBinariesWindows which includes gcc and gfortran 4.3.0.

Contents

Requirements

mingw-get install gcc fortran mingw32-make msys-base msys-wget msys-m4

If you don't have wget, you can use your web browser for downloading. The MSYS home directory is in C:\MinGW\msys\1.0\home\<your username>


Start MSYS shell and set PATH

export PATH=/c/MinGW/bin:$PATH
which gfortran gcc make

Compiling NetCDF

Make a directory without space

mkdir /tmp/Alex
cd /tmp/Alex

Download and decompress netcdf:

wget ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-4.5.0.tar.gz
tar -zxvf netcdf-4.5.0.tar.gz 
cd netcdf-4.5.0
./configure  --disable-netcdf-4  --disable-dap  > config.log
make > make.log
make check > check.log
make install


wget ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-fortran-4.4.4.tar.gz
tar -zxvf netcdf-fortran-4.4.4.tar.gz 
cd netcdf-fortran-4.4.4
./configure > config.log

Compiling ARPACK

ARPACK can be downloaded from http://www.caam.rice.edu/software/ARPACK/. If you use wget, you can download them with:

wget http://www.caam.rice.edu/software/ARPACK/SRC/patch.tar.gz
wget http://www.caam.rice.edu/software/ARPACK/SRC/arpack96.tar.gz

In UTIL/second.f, we removed the line 'EXTERNAL ETIME'. Otherwise you will see error messages complaining about undefined reference to `etime_'.

cd $HOME
which make gfortran
tar -xzvf arpack96.tar.gz
tar -xzvf patch.tar.gz
cd ARPACK
mv UTIL/second.f UTIL/second.f.bak
grep -v EXTERNAL UTIL/second.f.bak > UTIL/second.f
#make FC=gfortran FFLAGS= MAKE=make ARPACKLIB=$HOME/ARPACK/libarpack.a lib
make FC=gfortran FFLAGS= MAKE=make ARPACKLIB=/tmp/Alex/libarpack.a HOME=/tmp/Alex lib

Compiling DINEOF

Download, extract dineof and go into the dineof folder. You can either modify the makefile variables OS, FORT, NETCDF_INC, NETCDF_LIB and ARPACK_LIB in the files Makefile and Compiler/mingw-gfortran.mk or define these variables at the command line:

make OS=mingw FORT=gfortran NETCDF_INC=$HOME/netcdf/include NETCDF_LIB=$HOME/netcdf/lib ARPACK_LIB=$HOME/ARPACK STATIC=ON
Personal tools