[gradsusr] Problems compiling on Ubuntu 16.04

Jennifer M Adams jadams21 at gmu.edu
Fri Jan 4 10:40:46 EST 2019


I am putting this thread back into the forum, for the sake of keeping the archives relevant. Please see comments inline. 

> On Jan 4, 2019, at 1:01 AM, Stephen Woodbridge <stephenwoodbridge37 at gmail.com> wrote:
> 
> Take 2 on build on Ubuntu. I've done a bunch of work to try and build from source. I checked all the supplibs versions against the standard ubuntu 16.04 packages and with a couple of exceptions most packages have slightly higher versions. Here is how things stackup:
> 
> package         supplibs        ubuntu
> readline        5.0     <       5.2 & 6.3
> ncurses         5.7     <       6.0
I don’t think the versions of these matter that much to GrADS

> zlib            1.2.8   =       1.2.8
Good

> libpng          1.5.12  >       1.2.8
You definitely need libpng15 — Cairo won’t work right with libpng12. Make sure that the grib2 library is also linked with libpng15. 

> jpeg            6b      ?       8c
I am surprised there’s a new jpeg version … that 6b has been around for a long time. Not sure if it matters, but I would stick with 6b.

> gd              2.0.34  <       2.1.1           libgd-dev
I sometimes have to uptick the gd version to get it to compile on newer OS versions, but have never tried version 2.1*. This is easy to build from source, just make sure you’re using consistent versions of png and jpeg with all these supplibs. 

> jasper          1.900.1 =       1.900.1
This lib is needed to read some grib2 products from NCEP. You definitely need to build this with 
ftp://cola.gmu.edu/grads/Supplibs/2.2/src/jasper-1.900.1-14ubuntu3.2.debian.tar.gz

> g2clib          1.6.0   >       1.4.0           libgrib2c-dev
Use ftp://cola.gmu.edu/grads/Supplibs/2.2/src/g2clib-1.6.0.tar.gz

> udunits         1.11.7  <       2.2.20
Udunits2 will not work with GrADS. 

> hdf             4.2r3   <       4.3.10
Does it really matter? I don’t know of any new data that is delivered in hdf4. If you don’t need it, don’t bother. 

> hdf5            1.8.11  <       1.8.16
This is probably ok as long as it’s compatible with your netcdf version

> curl            7.35.0  <       7.47.0 libcurl4-gnutls-dev
Fine. Make sure it’s ssl-enabled

> netcdf          4.3.3   <       4.4.0
This is probably ok as long as it’s compatible with your hdf5 version

> tiff            3.8.2   <       4.0.6
> geotiff         1.2.5   <       1.4.1
I haven’t vetted these newer versions, but they’ll probably be fine

> shapelib        1.2.10  <       1.3.0
Fine, unless the API changed in 1.3.  I haven’t looked.

> dap             3.7.8   <       3.15.1
> gadap           2.0     !       ---             I can live without this
I don’t know of any GDS servers that are distributing station data, so no need to bother with dap or gadap


> xml2            2.9.0   <       2.9.3
> xrender         0.9.6   <       0.9.9
> pkgconfig       0.23    <       0.29.1
> pixman          0.34.0  >       0.33.6
> freetype        2.4.10  <       2.6.1
> fontconfig      2.9.0   <       2.11.94
> cairo           1.14.10 >       1.14.6
These are probably all fine, so you can use the system versions. Saves you a lot of fuss to avoid building Cairo from source. Just make sure it uses libpng15.

> 
> And I'm using this script to configure:
> 
> #!/bin/sh
> LIB=/usr/lib/x86_64-linux-gnu
> ./configure \
>   --with-geotiff-libdir=$LIB \
>   --with-hdf4-libdir=$LIB \
>   --with-hdf5-include=/usr/include/hdf5/serial/ \
>   --with-hdf5-libdir=/usr/lib/x86_64-linux-gnu/hdf5/serial/ \
>   --with-udunits-libdir=$LIB \
>   --with-netcdf-include=/usr/include \
>   --with-netcdf-libdir=$LIB

Don’t use these --with-* switches unless the libraries do not exist in $SUPPLIBS

> 
> And I've gotten this far with configure:
> 
>   +-------------------------------+
>   |                               |
>   |  GrADS will be built with:    |
>   |                               |
>   |  - GUI disabled               |
>   |  + READLINE enabled           |
>   |  + GEOTIFF enabled            |
>   |  + SHAPEFILE enabled          |
>   |  + GD enabled                 |
>   |  + CAIRO enabled              |
>   |  + GRIB2 enabled              |
>   |  - HDF4 disabled              |
>   |  + HDF5 enabled               |
>   |  - NETCDF disabled            |
>   |  - OPeNDAP disabled           |
>   |                               |
>   +-------------------------------+
> 
> I think your configure script might be broken or I'm missing something because in config.log (attached), there is a gap between lines 18050 and 18647 which is where curl gets checked for and other things and that never shows up in the configure output (config.out attached). And since it does not get checked for it is not set as available and netcdf fails to be checked because that is a dependency.
> 
> Also when I run make on the configured directory it fails with:
> 
> # make
> Making all in src
> make[1]: Entering directory '/home/woodbri/work/grads/grads-2.2.1/src'
> make  all-am
> make[2]: Entering directory '/home/woodbri/work/grads/grads-2.2.1/src'
> /bin/bash ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.  -I. -I..//include   -g -O2 -rdynamic -c -o libgxpGD_la-gxprintGD.lo `test -f 'gxprintGD.c' || echo './'`gxprintGD.c
> libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I. -I..//include -g -O2 -rdynamic -c gxprintGD.c  -fPIC -DPIC -o .libs/libgxpGD_la-gxprintGD.o
> /bin/bash ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.  -I. -I..//include   -g -O2 -rdynamic -c -o libgxpGD_la-gxGD.lo `test -f 'gxGD.c' || echo './'`gxGD.c
> libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I. -I..//include -g -O2 -rdynamic -c gxGD.c  -fPIC -DPIC -o .libs/libgxpGD_la-gxGD.o
> /bin/bash ../libtool  --tag=CC   --mode=link gcc  -g -O2 -rdynamic -version-info 1:0:1 -L/usr/lib/x86_64-linux-gnu -o libgxpGD.la -rpath /home/woodbri/work/grads/grads-2.2.1/lib libgxpGD_la-gxprintGD.lo libgxpGD_la-gxGD.lo -L..//lib -L/usr/lib/x86_64-linux-gnu  -lgd -lm
> ../libtool: line 6000: cd: ..//lib: No such file or directory
> libtool: link: cannot determine absolute directory name of `..//lib'
> Makefile:711: recipe for target 'libgxpGD.la' failed
> make[2]: *** [libgxpGD.la] Error 1
> make[2]: Leaving directory '/home/woodbri/work/grads/grads-2.2.1/src'
> Makefile:610: recipe for target 'all' failed
> make[1]: *** [all] Error 2
> make[1]: Leaving directory '/home/woodbri/work/grads/grads-2.2.1/src'
> Makefile:458: recipe for target 'all-recursive' failed
> make: *** [all-recursive] Error 1
> 
> I think this is because the build environment is expecting SUPPLIBS to be set and would normally set INCLUDE=../supplibs but since supplibs is not set I'm getting ..//include instead of ../supplibs/include.

You should set the $SUPPLIBS environment variable and and use the --enable-dyn-supplibs switch with the configure script so it will look beyond supplibs for the ones you didn’t build.  I think that should help with the netcdf problem. The “--with-*” options are good to help the configure macros find what they need.


> Overall, I think this should build on Ubuntu with some tweaking of the configure script.
Try with the options and environment changes mentioned above. You may also need to tweak your $CFLAGS (" -fPIC” may be necessary), and don’t forget your friends:  
PKG_CONFIG = $SUPPLIBS/bin/pkg-config
PKG_CONFIG_PATH = $SUPPLIBS/lib/pkgconfig

> 
> Oh yeah, I solved the libpng15 problem by copying them from your supplibs/lib dir in my /usr/lib/x86_64-linux-gnu directory and it seems to be happy with that.
Ok, but if you have any problems, libpng15 is easy to build from source. It may matter that it was built on a different unix flavor.

> I haven't figured out why it is failing to find hdf4 files, but I look at that more tomorrow.
I wouldn’t worry about hdf4 unless you have some old data you want to look at.

> Thank you for your patience and support, it is really appreciated.
You’ve got this! 
—Jennifer








More information about the gradsusr mailing list