[GRASS5] GRASS and libc2.2/libc2.3 portability problem

Markus Neteler neteler at itc.it
Sat Jan 10 17:44:18 EST 2004

It seems that I discovered a small (?) portability problem in GRASS 5.3/5.7:

- GRASS compiled on Redhat9/GLIBC_2.3 as network installation (NFS)
- using this GRASS binary on Redhat7/GLIBC_2.2 leads to an error:

baez:lib[264.8] ldd libgrass_gis.so
./libgrass_gis.so: /lib/libc.so.6: version `GLIBC_2.3' not found (required by ./libgrass_gis.so)
         libgrass_datetime.so => /mpa_sw/ssi/BIO/software/GRASS5.3/grass5bin_cvs/grass53/lib/libgrass_datetime.so (0x40089000)
         libz.so.1 => /usr/lib/libz.so.1 (0x40091000)
         libm.so.6 => /lib/libm.so.6 (0x400ae000)
         libc.so.6 => /lib/libc.so.6 (0x400d1000)
         /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)
baez:lib[265.9] pwd
baez:lib[266.10] ls -la /lib/libc.so.6
 lrwxrwxrwx    1 root     root 13 Jan  7 10:26 /lib/libc.so.6 -> libc-2.2.4.so

A quick web seach:
"> The problem is related to glibc.  Anything on redhat9 with a glibc >=
> glibc-2.3.2-11.9 is causing the problems.  Actually, any stock glibc
> from atleast 2.3.0 and on is causing problems.
> glibc is no longer exporting ctype_b.
> The offending line of code in netcdf is in libsrc/string.c.
> The line is:  
>    if(!isalnum(ch))

Now I checked libgis:

grep isalnum *.c
parser.c:               if (!isalnum(*p) && !strchr(normal, *p))

A global search:
find . -type f -name "*.c" -exec grep -l isalnum {} \;

In the mail above is suggestion to use (untested):

  if(!isalnum((unsigned char)ch))

Certainly I prefer to leave this to an expert. Anything we
can do to avoid this portability problem?



More information about the grass-dev mailing list