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

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

On Thu, 27 Nov 2003, Radim Blazek wrote:

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

Here is what I have for IRIX (MIPS processor) though it is a good few
weeks now since I re-compiled 5.7:

/* Architecture: mips-sgi-irix6.2 */

/* Native machine sizes */
#define NATIVE_DOUBLE 8
#define NATIVE_FLOAT 4
#define NATIVE_LONG 4
#define NATIVE_INT 4
#define NATIVE_SHORT 2
#define NATIVE_CHAR 1

/* Native machine byte orders */
#define DOUBLE_ORDER 1
#define FLOAT_ORDER 1
#define LONG_ORDER 1
#define INT_ORDER 1
#define SHORT_ORDER 1

/* Translation matrices from big endian to native */

/* Double format: */
static int dbl_cnvrt = {0, 1, 2, 3, 4, 5, 6, 7};

/* Float format : */
static int flt_cnvrt = {0, 1, 2, 3};

/* Long format : */
static int lng_cnvrt = {0, 1, 2, 3};

/* Int format : */
static int int_cnvrt = {0, 1, 2, 3};

/* Short format : */
static int shrt_cnvrt = {0, 1};

On Nov 27, 2003, at 9:13 AM, Radim Blazek wrote:

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?

I tried setting DYLD_LIBRARY_PATH, with the same resulting error. I've never had to set this variable building other programs on OSX.

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)

Here is the error now:

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, byte_order = 0
   Written: -32768
   Read : 0
ERROR in read/write portable short, byte_order = 0
   Written: -12345
   Read : -57
ERROR in read/write portable short, byte_order = 0
   Written: 12345
   Read : 57
ERROR in read/write portable short, byte_order = 0
   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

See requested files attached.

Thanks for the help.

(attachments)

osx_compile.tar.gz (803 Bytes)