[gradsusr] Ubuntu/debian package and KML lines/polygons

Jennifer Adams jma at cola.iges.org
Fri Jul 6 13:13:18 EDT 2012


Hi, Julian -- 
Version 2 of the udunits library has not been vetted for use with GrADS -- there is no reason to expect it to work. GrADS uses the udunits library in a very limited way (as part of the sdfopen interface), and there has been no need to upgrade to a newer version because we don't need any new features and the old version has worked reliably for years. Unfortunately, old versions of libraries often become hard to build and use as operating systems and compilers change, and then they're not supported anymore at all and that's when we're stuck with an undesired need to upgrade. We may be reaching that point with udunits, but I'm not going to upgrade to udunits2 until I'm sure I have absolutely no other options. 

In the meanwhile, the pre-compiled GrADS binaries are statically linked with udunits-1.11 and so should not need to interact with the local version of udunits at all. The error message you're getting, that udunits.dat is missing, might be fixed by grabbing that file out of this tarball (ftp://cola.gmu.edu/grads/data2.tar.gz) and placing it in the directory where all your font and map files are located (the directory pointed to by the environment variable GADDIR). 

If that fails, then you could try this trick: create a descriptor file for your NOMADS GFS data URL, provide all the axis information that GrADS needs so that you bypass the sdfopen interface entirely, then maybe you won't get those udunits error messages. 

There were a lot of bug fixes and changes to the GIS interface between versions 2.0.a9 and 2.0.1. For best results, try very hard to get the newer version working. 
--Jennifer


On Jul 5, 2012, at 3:52 PM, Julian Scarfe wrote:

> The latest available Ubuntu/Debian package for GrADS is 2.0.a9.  I was using it on some NOMADS GFS data.  It creates beautiful georeferenced TIFF file, but when I attempt to use the KML line output, it crashes with a buffer overflow.
> 
> If I use the pre-built 2.0.1 from COLA on that SDF, it doesn't seem to work with the Ubuntu udunits package (which is libudunits2-0, and doesn't seem to have a udunits.dat, only .xml data files).
> 
> If I use 2.0.1 on the example data, it doesn't seem to need udunits, and I can create beautiful KML polygons (which are very cool!). 2.0.a9 still crashes on the same data. That leads me to believe that the bug was fixed between 2.0.a9 and 2.0.1 (makes sense, it was an alpha!).
> 
> Unfortunately, building GrADS (with all its dependencies) on Ubuntu is well beyond my skills.  So is there a 2.0.1 Ubuntu/Debian package out there please?  Or is there a workaround to get the pre-built 2.0.1 from COLA working with udunits on Ubuntu?
> 
> Thanks
> 
> Julian
> 
> --- gory details ---
> 
> Grid Analysis and Display System (GrADS) Version 2.0.a9
> ...
> Config: v2.0.a9 little-endian readline printim grib2 netcdf hdf4-sds hdf5 opendap-grids geotiff shapefile
> ...
> ga-> sdfopen http://nomads.ncep.noaa.gov:9090/dods/gfs/gfs20120704/gfs_18z
> Scanning self-describing file:  http://nomads.ncep.noaa.gov:9090/dods/gfs/gfs20120704/gfs_18z
> SDF file http://nomads.ncep.noaa.gov:9090/dods/gfs/gfs20120704/gfs_18z is open as file 1
> LON set to 0 360 
> LAT set to -90 90 
> LEV set to 1000 1000 
> Time values set: 2012:7:4:18 2012:7:4:18 
> E set to 1 1 
> ga-> set lat 40 60
> LAT set to 40 60 
> ga-> set lon -10 10
> LON set to -10 10 
> ga-> set gxout contour
> ga-> d tmp2m
> Contouring: 282 to 302 interval 2 
> ga-> set gxout kml
> ga-> set kml test1
> KML output file names: 
> test1.tif (TIFF image) 
> test1.kml (KML text file) 
> KML output type: image
> ga-> d tmp2m
> Created TIFF image file test1.tif
>   and complementary KML file test1.kml
> ga-> set kml -ln test2
> KML output file name: 
> test2.kml (KML text file)
> KML output type: contour lines
> ga-> d tmp2m
> Contouring: 282 to 302 interval 2 
> *** buffer overflow detected ***: grads terminated
> ======= Backtrace: =========
> /lib/i386-linux-gnu/libc.so.6(__fortify_fail+0x45)[0xb6e9bdd5]
> /lib/i386-linux-gnu/libc.so.6(+0xfebaa)[0xb6e9abaa]
> /lib/i386-linux-gnu/libc.so.6(+0xfe483)[0xb6e9a483]
> /lib/i386-linux-gnu/libc.so.6(__snprintf_chk+0x37)[0xb6e9a347]
> grads(gxclvert+0x54)[0x805ec74]
> grads(gakml+0x5f3)[0x809b7a3]
> grads(gaplot+0x4a5)[0x809cf05]
> grads(gadspl+0x5b8)[0x80e7558]
> grads(gacmd+0x1922)[0x80e5d02]
> grads(main+0x5ee)[0x805264e]
> /lib/i386-linux-gnu/libc.so.6(__libc_start_main+0xf3)[0xb6db54d3]
> grads[0x8052be9]
> ======= Memory map: ========
> 08048000-08117000 r-xp 00000000 08:06 395232     /usr/bin/grads
> ...
> 
> 
> Grid Analysis and Display System (GrADS) Version 2.0.1
> Copyright (c) 1988-2011 by Brian Doty and the
> Institute for Global Environment and Society (IGES)
> GrADS comes with ABSOLUTELY NO WARRANTY
> See file COPYRIGHT for more information
> 
> Config: v2.0.1 little-endian readline printim grib2 netcdf hdf4-sds hdf5 opendap-grids,stn geotiff shapefile
> Issue 'q config' command for more detailed configuration information
> Landscape mode? ('n' for portrait):  
> GX Package Initialization: Size = 11 8.5 
> ga-> sdfopen http://nomads.ncep.noaa.gov:9090/dods/gfs/gfs20120704/gfs_18z
> Scanning self-describing file:  http://nomads.ncep.noaa.gov:9090/dods/gfs/gfs20120704/gfs_18z
> udunits(3): Couldn't open units database "/usr/local/lib/grads/udunits.dat": No such file or directory
> gadsdf: UDUNITS package initialization failure.
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr

--
Jennifer M. Adams
IGES/COLA
4041 Powder Mill Road, Suite 302
Calverton, MD 20705
jma at cola.iges.org



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20120706/6e0721eb/attachment-0003.html 


More information about the gradsusr mailing list