Sun5.8 build balks early

Hello,

[first post to -dev group, tell me if I'm off base here]

I am building the most recent HEAD release under Sun 5.8:

uname -a
SunOS fxbb085u21.engin.umich.edu 5.8 Generic_108528-23 sun4u sparc

with the Sun cc compiler:

cc -V

And, after a few warnings:

···

cc: Sun WorkShop 6 update 2 C 5.3 2001/05/15

-----------
cc -I/usr/openwin/include -L/usr/openwin/lib -DNOSTEREO -DMC -O -DSPEED=80
-c -o mesh.o mesh.c
"mesh.c", line 323: warning: assignment type mismatch:
        pointer to function(pointer to char) returning unsigned long "="
pointer to function(pointer
to struct {int fl, array[3] of unsigned long xyz, long norm, array[2] of
unsigned short uv}) retur
ning unsigned long
"mesh.c", line 324: warning: assignment type mismatch:
        pointer to function(pointer to const char, pointer to const char)
returning int "=" pointer
to function(pointer to struct {int fl, array[3] of unsigned long xyz,
long norm, array[2] of unsign
ed short uv}, pointer to struct {int fl, array[3] of unsigned long xyz,
long norm, array[2] of unsi
gned short uv}) returning int
-----------
cc -I/usr/openwin/include -L/usr/openwin/lib -DNOSTEREO -DMC -O -DSPEED=80
-c -o caldefn.o caldefn.c
"caldefn.c", line 708: warning: integer overflow detected: op "<<"
"caldefn.c", line 711: warning: integer overflow detected: op "<<"
"caldefn.c", line 712: warning: integer overflow detected: op "<<"
-----------

I get the first actual error:

-----------
cc -I/usr/openwin/include -L/usr/openwin/lib -DNOSTEREO -DMC -O -DSPEED=80
-c -o unix_process.o unix_process.c
"./vfork.h", line 12: identifier redeclared: fork
        current : function() returning int
        previous: function(void) returning long : "/usr/include/unistd.h",
line 245
cc: acomp failed for unix_process.c
make: *** [unix_process.o] Error 2
-----------

Then I start getting massive amounts of undefined symbol errors
like this, the first one:

-----------
cc -DMDIR=\"/tmp/ray/lib/meta/\" -O -DSPEED=80 -I/usr/openwin/include
-L/usr/openwin/lib -DNOSTEREO -DMC -I../common -L../lib -o meta2tga
meta2tga.o rplot.o plot.o mfio.o syscalls.o misc.o \
palloc.o -lrt -lm
Undefined first referenced
symbol in file
freestr plot.o
error meta2tga.o
savestr rplot.o
ld: fatal: Symbol referencing errors. No output written to meta2tga
make: *** [meta2tga] Error 1
-----------

So, I changed the last line in common/vfork.h to read
extern long vfork();
That seemed to work.

Then, when I build, it gets past that error, but encounters some
"ld: fatal: Symbol referencing errors" in a few other places
(normtiff and dev/x11.hdi).

I end up with 75 files in the bin directory, so it's almost a
working distribution.

What can I do to get the last few things built?

Is this kind of thing a bug, or can it, should it be fixed?

How can I continue to help with this?

Thanks!

Mark

Mark Stock wrote:

[first post to -dev group, tell me if I'm off base here]

Right on topic!

I am building the most recent HEAD release under Sun 5.8:

uname -a
SunOS fxbb085u21.engin.umich.edu 5.8 Generic_108528-23 sun4u sparc

with the Sun cc compiler:

cc -V
cc: Sun WorkShop 6 update 2 C 5.3 2001/05/15

And, after a few warnings:
[...]
I get the first actual error:

-----------
cc -I/usr/openwin/include -L/usr/openwin/lib -DNOSTEREO -DMC -O -DSPEED=80
-c -o unix_process.o unix_process.c
"./vfork.h", line 12: identifier redeclared: fork
        current : function() returning int
        previous: function(void) returning long : "/usr/include/unistd.h",
line 245
cc: acomp failed for unix_process.c
make: *** [unix_process.o] Error 2
-----------

Your compiler appears to be particularly picky about redundant
function declarations.

Then I start getting massive amounts of undefined symbol errors

Those are just follow up errors, because the above resulted in
an incomplete or missing librt.a.

So, I changed the last line in common/vfork.h to read
extern long vfork();
That seemed to work.

Kind of a coincidence that you stumbled over this, but I had a
beef with the use of vfork() in Radiance for a while, and would
like to use this occasion to vote for its elimination.

In the early days there might have been valid reason to consider
vfork(). But today there are more reasons against it. For one,
modern virtual memory systems have rendered it unnecessary, as
fork() is now using copy on write. And then, Radiance uses
vfork() in a way it was never meant to be used.

The specified semantics of vfork() are quite different to fork().
In practise, most systems simply implement is as an alias to
fork(). But on those systems where it is implemented according to
the full specification (currently only netBSD as far as I know),
Radiance will crash and burn.

The vfork() specs make it dangerous for the child to call any
other functions between the vfork() and a following execve() or
exit(). Everything happening in between may have effects on
*both* the parent and child process. Most uses of vfork() in
Radiance are therefore a time bomb waiting to explode in someones
face.

While your current compile troubles are only an unrelated side
effect, they would also disappear if we fixed the real problem.

Then, when I build, it gets past that error, but encounters some
"ld: fatal: Symbol referencing errors" in a few other places
(normtiff and dev/x11.hdi).

Can't say anything about those without seeing the specific names.

-schorsch

···

--
Georg Mischler -- simulations developer -- schorsch at schorsch com
+schorsch.com+ -- lighting design tools -- http://www.schorsch.com/

Hi Mark,

Thanks for the bug report. I just made a change that should fix the fork() redeclaration error on tomorrow's HEAD, which caused the main library build to fail and subsequently all the link operations in your build on Solaris.

The warnings can safely be ignored, and there's not much I can do about them, anyway.

-Greg

···

From: Mark Stock <[email protected]>
Date: Mon Nov 10, 2003 7:44:14 AM US/Pacific

Hello,

[first post to -dev group, tell me if I'm off base here]

I am building the most recent HEAD release under Sun 5.8:

uname -a
SunOS fxbb085u21.engin.umich.edu 5.8 Generic_108528-23 sun4u sparc
...

Excellent, thank you. I can usually ignore the warnings, but
I included them on the chance that they helped find the source
of the Error. The remaining Errors that I have on compile are:

···

-------------
cc -I../common -L../lib -O -DSPEED=80 -I/usr/openwin/include
-L/usr/openwin/lib -DNOSTEREO -DMC -o normtiff normtiff.o -lrt -ltiff -lm
Undefined first referenced
symbol in file
uv_encode ../lib/librt.a(tmapluv.o)
uv_decode ../lib/librt.a(tmapluv.o)
ld: fatal: Symbol referencing errors. No output written to normtiff
make: *** [normtiff] Error 1
-------------

librt.a seemed to build with no problems. It seems that uv_encode
and uv_decode only appear in common/tiffio.h, but that's as far
as I can get.

The only other error is here:

-------------
cc -I../common -L../lib -O -DSPEED=80 -I/usr/openwin/include
-L/usr/openwin/lib -DNOSTEREO -DMC -o
/usr/contrib/radiance/bin2/dev/x11.hdi rhdisp.o rhdisp2
.o viewbeams.o \
rhd_x11.o rhd_qtree.o rhd_qtree2r.o rhd_ctab.o holo.o -lrt -lX11 -lm
Undefined first referenced
symbol in file
nanosleep rhd_x11.o
ld: fatal: Symbol referencing errors. No output written to
/usr/contrib/radiance/bin2/dev/x11.hdi
make: *** [/usr/contrib/radiance/bin2/dev/x11.hdi] Error 1
-------------

Any suggestions?

Mark

On Mon, 10 Nov 2003, Greg Ward wrote:

Hi Mark,

Thanks for the bug report. I just made a change that should fix the
fork() redeclaration error on tomorrow's HEAD, which caused the main
library build to fail and subsequently all the link operations in your
build on Solaris.

The warnings can safely be ignored, and there's not much I can do about
them, anyway.

-Greg

> From: Mark Stock <[email protected]>
> Date: Mon Nov 10, 2003 7:44:14 AM US/Pacific
>
> Hello,
>
> [first post to -dev group, tell me if I'm off base here]
>
> I am building the most recent HEAD release under Sun 5.8:
>
> uname -a
> SunOS fxbb085u21.engin.umich.edu 5.8 Generic_108528-23 sun4u sparc
> ...

_______________________________________________
Radiance-dev mailing list
[email protected]
http://www.radiance-online.org/mailman/listinfo/radiance-dev

Hi Mark,

I don't have any direct solutions to your other build problems, but I can offer some suggestions for you to try:

From: Mark Stock <[email protected]>
Date: Mon Nov 10, 2003 1:23:09 PM US/Pacific

Excellent, thank you. I can usually ignore the warnings, but
I included them on the chance that they helped find the source
of the Error. The remaining Errors that I have on compile are:

-------------
cc -I../common -L../lib -O -DSPEED=80 -I/usr/openwin/include
-L/usr/openwin/lib -DNOSTEREO -DMC -o normtiff normtiff.o -lrt -ltiff -lm
Undefined first referenced
symbol in file
uv_encode ../lib/librt.a(tmapluv.o)
uv_decode ../lib/librt.a(tmapluv.o)
ld: fatal: Symbol referencing errors. No output written to normtiff
make: *** [normtiff] Error 1
-------------

librt.a seemed to build with no problems. It seems that uv_encode
and uv_decode only appear in common/tiffio.h, but that's as far
as I can get.

These functions are defined in the newer version of the TIFF library, but probably not the standard one that's distributed with your system. Most likely, the replacement libtiff.a is not getting installed in the ray/src/lib directory after being built in ray/src/rt/tiff/libtiff. If the latter directory is missing, it is probably because you forgot to install the overlay. If it's there and the file ray/src/rt/tiff/libtiff/libtiff.a is present, then it's a known bug in the install program under Solaris, for which I have no fix but to manually move the file "ray/src/rt/tiff/libtiff/libtiff.a" to the "ray/src/lib/" directory and rerunning "rmake install" in ray/src/px/.

The only other error is here:

-------------
cc -I../common -L../lib -O -DSPEED=80 -I/usr/openwin/include
-L/usr/openwin/lib -DNOSTEREO -DMC -o
/usr/contrib/radiance/bin2/dev/x11.hdi rhdisp.o rhdisp2
.o viewbeams.o \
rhd_x11.o rhd_qtree.o rhd_qtree2r.o rhd_ctab.o holo.o -lrt -lX11 -lm
Undefined first referenced
symbol in file
nanosleep rhd_x11.o
ld: fatal: Symbol referencing errors. No output written to
/usr/contrib/radiance/bin2/dev/x11.hdi
make: *** [/usr/contrib/radiance/bin2/dev/x11.hdi] Error 1
-------------

Any suggestions?

On some systems, the nanosleep() function is part of a real-time library, which may have the unfortunate, conflicting name of librt.a. To link to it, you can add /usr/lib/librt.a to the cc link line above and see if that works. Again, I don't have a fix for this at the moment.

-Greg

> From: Mark Stock <[email protected]>
> Date: Mon Nov 10, 2003 1:23:09 PM US/Pacific
>
> cc -I../common -L../lib -O -DSPEED=80 -I/usr/openwin/include
> -L/usr/openwin/lib -DNOSTEREO -DMC -o normtiff normtiff.o -lrt -ltiff
> -lm
> Undefined first referenced
> symbol in file
> uv_encode ../lib/librt.a(tmapluv.o)
> uv_decode ../lib/librt.a(tmapluv.o)
> ld: fatal: Symbol referencing errors. No output written to normtiff
> make: *** [normtiff] Error 1

These functions are defined in the newer version of the TIFF library,
but probably not the standard one that's distributed with your system.
Most likely, the replacement libtiff.a is not getting installed in the
ray/src/lib directory after being built in ray/src/rt/tiff/libtiff. If
the latter directory is missing, it is probably because you forgot to
install the overlay. If it's there and the file
ray/src/rt/tiff/libtiff/libtiff.a is present, then it's a known bug in
the install program under Solaris, for which I have no fix but to
manually move the file "ray/src/rt/tiff/libtiff/libtiff.a" to the
"ray/src/lib/" directory and rerunning "rmake install" in ray/src/px/.

I suppose you meant ray/src/px/tiff/libtiff (and not /rt/). I found
the libtiff.a there. I also found it in ray/lib, but not in ray/src/lib.

I copied it into there, did the rmake, and I have 114 programs in
my bin now. Cool.

> cc -I../common -L../lib -O -DSPEED=80 -I/usr/openwin/include
> -L/usr/openwin/lib -DNOSTEREO -DMC -o
> /usr/contrib/radiance/bin2/dev/x11.hdi rhdisp.o rhdisp2
> .o viewbeams.o \
> rhd_x11.o rhd_qtree.o rhd_qtree2r.o rhd_ctab.o holo.o -lrt -lX11 -lm
> Undefined first referenced
> symbol in file
> nanosleep rhd_x11.o
> ld: fatal: Symbol referencing errors. No output written to
> /usr/contrib/radiance/bin2/dev/x11.hdi
> make: *** [/usr/contrib/radiance/bin2/dev/x11.hdi] Error 1

On some systems, the nanosleep() function is part of a real-time
library, which may have the unfortunate, conflicting name of librt.a.
To link to it, you can add /usr/lib/librt.a to the cc link line above
and see if that works. Again, I don't have a fix for this at the
moment.

I added "/usr/lib/librt.so" just before the "-lrt" entry, and
it built.

Then I did the "rmake install" to put thing where they belong and
now I have 120 files in my bin. Yay!

Mark

···

On Mon, 10 Nov 2003, Greg Ward wrote: