Compilation on Solaris 8 SPARC

Hello:

I'm having difficulty getting Radiance complied on Solaris 8. (Note: I
successfully compiled and generated test images on SuSE Linux 8.0)

The system is an Enterprise250, 2x400MHz processors with 1GB RAM and gigs of
available storage. It's running Solaris 8, 07/01 Release, with the latest
8_Recommended patch cluster (Kernel version: SunOS 5.8 Generic 108528-14
February 2002)

I have all GNU tools from the Solaris Companion CD installed, (gcc & gmake).

I have tried running ./makeall install two different ways without success,
and I've tried each way using both the default directories (/usr/local/....)
and my preferred directories (/usr/local/radiance/bin
/usr/local/radiance/lib)

1. Using the Solaris cc and make, virtually nothing works. I get the
'language optional package not installed' error on pretty much every instance
of cc being invoked. I decided that it was probably better to pursue the GNU
route, so...

2. Using gcc and gmake, my rmake file is as follows:

#!/bin/sh
exec gmake "SPECIAL=ogl" \
        "OPT=-O -DSPEED=80" \
        "MACH=-DALIGN=double -I/usr/openwin/include -L/usr/openwin/lib
-DNOSTEREO
-DDCL_ATOF -DBIGMEM" \
        ARCH=sun "COMPAT=bmalloc.o strcmp.o getpagesize.o" \
        INSTDIR=/usr/local/radiance/bin \
        LIBDIR=/usr/local/radiance/lib \
        CC=gcc "$@" -f Rmakefile

...and I've set $RAYPATH to .:/usr/local/radiance/lib all to no avail. Some
things compile and install, but I get at least one instance of the following:

error.c:37: `sys_nerr' undeclared (first use in this function)
error.c:37: (Each undeclared identifier is reported only once
error.c:37: for each function it appears in.)
error.c:38: `sys_errlist' undeclared (first use in this function)
gmake: *** [error.o] Error 1

...and more importantly, pretty much all of the applications fail in the
following manner:

gcc -I../common -L../lib -O -DSPEED=80 -DALIGN=double -I/usr/openwin/include
-L/usr/openwin/lib -DNOSTEREO -DDCL_ATOF -DBIGMEM -c -o psign.o psign.c
gcc -I../common -L../lib -O -DSPEED=80 -DALIGN=double -I/usr/openwin/include
-L/usr/openwin/lib -DNOSTEREO -DDCL_ATOF -DBIGMEM -o psign psign.o -lrt -lm
Undefined first referenced
symbol in file
fputformat psign.o
bmalloc psign.o
uniftext psign.o
printargs psign.o
setcolr psign.o
newheader psign.o
proptext psign.o
error psign.o
fwritecolrs psign.o
getfont psign.o
squeeztext psign.o
ld: fatal: Symbol referencing errors. No output written to psign
collect2: ld returned 1 exit status
gmake: *** [psign] Error 1

gmake: *** [rhinfo] Error 1
gcc -I../common -L../lib -O -DSPEED=80 -DALIGN=double -I/usr/openwin/include
-L/usr/openwin/lib -DNOSTEREO -DDCL_ATOF -DBIGMEM -c -o rhdisp.o rhdisp.c
rhdisp.c: In function `disp_wait':
rhdisp.c:168: structure has no member named `_IO_read_end'
rhdisp.c:168: structure has no member named `_IO_read_ptr'
rhdisp.c:170: structure has no member named `_IO_read_end'
rhdisp.c:170: structure has no member named `_IO_read_ptr'
gmake: *** [rhdisp.o] Error 1

So at the end it says, in either irony or understatement 'There were some
errors'.

I read Greg's posting about the libtiff issues with compiling on Solaris 8.
Following those instructions allows me to get the px stuff compiled, but the
rest of the program is my biggest headache right now.

Am I going down the wrong path by using gcc & gmake?
What else do I need to do to make this work? I desperately need to make this
work in the next few days so that I can test the other elements of the system
and meet my deadline (Radfront, ArrisCAD integration, rendering throught the
Sun Grid Engine on 30 SunBlade 100 workstations).

Thanks in advance for any assistance. I'm looking forward to making a bunch
of architects very, very happy....

···

--
Len Laughridge
Director of Information Technology
Kitchen & Associates Architectural Services, PA

Hi Len,

I'm sorry to hear you're still having compile problems. For some reason, your version of the GNU-C headers doesn't include a definition of sys_errlist or sys_nerr, which causes the compile of error.c to fail in src/common, and subsequently the main Radiance library doesn't get built. The build all falls apart after that, as you noticed....

You will have to manually edit the src/common/error.c file with a plain text editor and change the following lines near the top from:

#ifndef __GNUC__
extern char *sys_errlist[]; /* system error list */
extern int sys_nerr; /* number of system errors */
#endif

to:

extern char *sys_errlist[]; /* system error list */
extern int sys_nerr; /* number of system errors */

(I.e., take off the surrounding precompiler # statements.) After saving the file, rerun "makeall install". I'm hoping the build will work after that, assuming this was the only problem.

-Greg

Greg:

Thanks for the response, but the same thing happened using the gcc/gmake
configuration in my previous post. Any ideas?

···

On Wednesday 05 June 2002 11:01 am, Greg Ward wrote:

I'm sorry to hear you're still having compile problems.

--
Len Laughridge
Director of Information Technology
Kitchen & Associates Architectural Services, PA

Greg Ward wrote:

Hi Len,

I'm sorry to hear you're still having compile problems. For some
reason, your version of the GNU-C headers doesn't include a definition
of sys_errlist or sys_nerr, which causes the compile of error.c to fail
in src/common, and subsequently the main Radiance library doesn't get
built. The build all falls apart after that, as you noticed....

You will have to manually edit the src/common/error.c file with a plain
text editor and change the following lines near the top from:

> #ifndef __GNUC__
> extern char *sys_errlist[]; /* system error list */
> extern int sys_nerr; /* number of system errors */
> #endif

to:

> extern char *sys_errlist[]; /* system error list */
> extern int sys_nerr; /* number of system errors */

(I.e., take off the surrounding precompiler # statements.) After saving
the file, rerun "makeall install". I'm hoping the build will work after
that, assuming this was the only problem.

Is there any particular reason why you're avoiding the standard
function strerror() from string.h here? As far as I understand
the documentation, sys_errlist and sys_nerr aren't really meant
for direct access by user code. Or do we really still have to
take pre-ANSI implementations into account? If so, which ones?

Speaking more generally, I'd like to put in a strong vote for
ansifying Radiance completely. Even though this might look like a
highly tedious task (and probably is), I'd expect it to uncover
and eliminate at least a one or two dozen subtle bugs throughout
the code. In the long run, it would make all future development a
lot easier. Of course, if Radiance were to be put on public CVS
later this year, there's no reason why you would have to make
this conversion yourself...

-schorsch

···

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