Compiling wgrib2
Compiling wgrib2 is easy on a linux system.
1) Download ftp://ftp.cpc.ncep.noaa.gov/wd51we/wgrib2/wgrib2.tgz
2) untar wgrib2.tgz: tar -xzvf wgrib2.tgz (use gnu tar)
3) cd to main directory: cd grib2
4) set the C compiler to use: export CC=gcc (bash)
5) set the fortran compiler to use: export FC=gfortran (bash)
6) compile: make (must use gnu make)
note: you may have to install gcc and gfortran
Compiling wgrib2 with IPOLATES is easy on a linux system.
1) Download ftp://ftp.cpc.ncep.noaa.gov/wd51we/wgrib2/wgrib2.tgz
2) untar wgrib2.tgz: tar -xzvf wgrib2.tgz (use gnu tar)
3) cd to main directory: cd grib2
4) edit makefile and change USE_IPOLATES=0 to USE_IPOLATES=1
5) set the C compiler to use: export CC=gcc (bash)
6) set the fortran compiler to use: export FC=gfortran (bash)
7) compile: make (must use gnu make)
note: you make have to install gcc and gfortran
Compiling wgrib2 is easy on a unix system.
1) Download ftp://ftp.cpc.ncep.noaa.gov/wd51we/wgrib2/wgrib2.tgz
2) untar wgrib2.tgz: gunzip wgrib2.tgz ; tar -xvf wgrib2.tar
3) cd to main directory: cd grib2
4) set the C compiler to use: export CC=(name of C compiler) (sh)
5) set the fortran compiler to use: export FC=(name of fortran compiler) (sh)
6) compile: make (use gnu make)
Compiling wgrib2 with clang and gfortran for IPOLATES (wgrib2 v1.9.8+)
1) Download ftp://ftp.cpc.ncep.noaa.gov/wd51we/wgrib2/wgrib2.tgz
2) untar wgrib2.tgz: gunzip wgrib2.tgz ; tar -xvf wgrib2.tar
3) cd to main directory: cd grib2
4) edit makefile and change USE_IPOLATES=0 to USE_IPOLATES=1
6) set the C compiler to use: export CC=clang (bash)
6) set the fortran compiler to use: export FC=gfortran -fplugin=dragonegg
7) compile: make (use gnu make)
Comments:
- For Cygwin, use the linux instructions
- Using the included g2clib is strongly recommended (wgrib2 v0.1.9.7a or earlier)
- If you use the official g2clib, USE_G2CLIB=0 is recommended for wgrib2 v0.1.9.8+)
- Using IPOLATES with UNIX is not difficult for a person with the right skills.
- Intel and the Portland compilers are not compatible with the Jasper library and are disabled in the makefile
wgrib2 compile questions
Question: Why doesn't the Intel and Portland compilers work with wgrib2?
Answer: The Jasper libraries compile but produce zero-data jpeg2000 files.
I tried using the instructions from the Intel dev web site but they didn't work.
I tried the debian updates to the Jasper library and they also didn't help.
After spending too much time on this problem, I figured that icc isn't that
important when I can use gcc, openncc and clang on X86 machines.
Question: Why do you build japser with the following flags?
--disable-libjpeg --disable-opengl
Answer:
Libjpeg is not needed by wgrib2. The makefile should work when
the system doesn't have libjpeg installed.
Opengl is not needed by wgrib2. Makefile should still work when the
system doesn't have opengl installed.
The wgrib2 makefile compiles the libraries in a manner optimized for wgrib2.
The libraries are not meant for general use. For example, the netcdf library
doesn't have a fortran interface because I want the makefile to
work if a user lacks a fortran compiler.
Why don't you make netcdf4 the default netcdf package?
Answer:
The Netcdf4/hdf libraries are very big and the end result is a long
download time and a large executable. Netcdf3 files can be read by
a netcdf4 client. However, many people routinely compile with netcdf4.
|