[GRASS5] Re: [GRASSLIST:1899] ERROR in read/write portable short

Radim Blazek blazek at itc.it
Thu Nov 27 09:13:42 EST 2003


On Wednesday 26 November 2003 20:38, you wrote:
> I think I have everything configured properly for an OSX build,
> however, I get the following errors. Any ideas? I scanned the list
> archives, but did not find anything helpful:
>
> cd OBJ.powerpc-apple-darwin7.0.0;
> LD_LIBRARY_PATH=:/usr/local/src/grass57_exp_2003_11_22/dist.powerpc-
> apple-darwin7.0.0/lib ./test
> ERROR in read/write portable short
>    Written: -32768
>    Read   : 0
> ERROR in read/write portable short
>    Written: -12345
>    Read   : -57
> ERROR in read/write portable short
>    Written: 12345
>    Read   : 57
> ERROR in read/write portable short
>    Written: 32767
>    Read   : -1
> make[3]: *** [OBJ.powerpc-apple-darwin7.0.0/test] Error 1
> make[2]: *** [subdirs] Error 1
> make[1]: *** [subdirs] Error 1
> make: *** [default] Error 1

I read in the list, that LD_LIBRARY_PATH does not work on MacOSX,
and DYLD_LIBRARY_PATH should be used instead. Did you set 
DYLD_LIBRARY_PATH to /usr/local/src/grass57_exp_2003_11_22/dist.powerpc-apple-darwin7.0.0/lib
before somehow? Otherwise it should not work. 
Do you have 5.7 only? Are you sure that 5.0 libraries are not 
used (are not in DYLD_LIBRARY_PATH) instead of 5.7 libraries?
Try also 
ldd /usr/local/src/grass57_exp_2003_11_22/lib/vector/diglib/OBJ.powerpc-apple-darwin7.0.0/test

On little endian 
   dec     hex
-32768 = 00 80
-12345 = C7 CF 
 12345 = 39 30
 32767 = FF 7F

dec     hex
  0 =    00
-57 = FF C7
 57 =    39
 -1 = FF FF

So it seems that 2. byte is lost.

This will be a bug in diglib, it was developed on intel and probably never run on Power PC. 
I updated grass51/lib/vector/diglib/test.c so that it prints byte order also,
please update from cvs or download from web
http://freegis.org/cgi-bin/viewcvs.cgi/*checkout*/grass51/lib/vector/diglib/test.c?rev=1.7&content-type=text/plain
then recompile diglib and send us your new error report (should include " ... byte_order = ... "),
usr/local/src/grass57_exp_2003_11_22/dist.powerpc-apple-darwin7.0.0/include/portable.h and
usr/local/src/grass57_exp_2003_11_22/lib/vector/diglib/test.tmp (gzipped)

By chance, anybody knows how long type 'short' is on Power PC, and which endian.

Paul, you have 5.7 compiled on some non intel platforms, can you send us your 
portable.h files for those machines also?


Radim




More information about the grass-dev mailing list