Compiling Radiance 4.0 HEAD on Windows

Today I succeeded in compiling Radiance 4.0 HEAD snapshot on Windows.
I had to make to following modifications to make it work:

*Gendaylit*
To make Gendaylit compile I had to add the following line in:
ray\src\gen\SConscript under the section PROGS = (
*('gendaylit', Split('gendaylit.c sun.c',), ['rtlamps']),

*I changed the following line in: ray\src\common\SConscript*
*RTLAMPS = Split('''fropen.c rexpr.c lamps.c''')*+ [getlibpath]*

*Dctimestep*
To make dctimestep compile I had to add the following line to:
ray\src\common\SConscript under the section # build libraries*:
rtall = env.StaticLibrary(target=radlib('rtall'), source=ALL)**

···

*
I changed in ray\src\util\SConscript
('dctimestep', ['dctimestep.c'],
    *['rtall'])*

(I think that including all library functions for dctimestep probably is way
to much, but I don't know the minimal set to include. This way dctimestep
compiles fine.)

Another problem I ran into:

When compiling tmapluv.c the compiler complained about a variable
declaration that was already declared elsewhere.
tmapluv.c includes tiffio.h, which inturn (on Windows) includes windows.h,
which includes windef.h
In windef.h the the following declaration is made: typedef unsigned char
BYTE
This declaration gives problems with tmapluv.c where BYTE is also declared.

As a workaround I commented typedef unsigned char BYTE out in windef.h.
After that the compiler compiles tmapluv.c
After that the compiles continues, but very soon fails again I then removed
the comments from windef.h and the compiler finally finisches building
Radiance.

Question: is it possible to change the declaration of BYTE in tmapluv.c or
tell the compiler to not include windef.h without producing errors? (I am
not a programmer, so I didn't dare mess with it myself)

For compilation I used:
Radiance 4.0 + latest snapshot of the HEAD archive
MinGW with gcc 4.5.0
Phyton 2.7 + scons 1.3.1
compiler optimalisations: -O3 -march=native (for a core2duo)

I hope this is helpfull.

Best Regards,

Guy

Hi Guy,

Thanks very much for these changes -- what happens if you change the include order in tmapluv.c to put "tiffio.h" above "tmprivat.h"? I think this might resolve the conflict.

Cheers,
-Greg

Hi Greg,

Thanks! That worked + the solution was easier than I thought it could
possibly be!
I also had to do the same trick on tmaptiff.c (put tiffio.h above tmprivat.h)
and on tmapcolrs.c I had to move rtprocess.h also to be also above tmprivat.h

After these changes compiling went like a charm.

Best Regards.

Guy

(No idea how to reply on a message on the mailing list, I hope this works)

···

Hi Guy,

Thanks very much for these changes -- what happens if you change the include order in tmapluv.c to put "tiffio.h" above "tmprivat.h"? I think this might resolve the conflict.

Cheers,
-Greg

Great!

Can someone else verify Guy's suggested changes to the SConscript files. I still have no idea how any of Schorsch's build system is supposed to work, so I'm relying on the mailing list for recommended changes.

Cheers,
-Greg

···

From: Guy Vaessen <[email protected]>
Date: October 3, 2010 12:42:03 PM PDT

Hi Greg,

Thanks! That worked + the solution was easier than I thought it could possibly be!
I also had to do the same trick on tmaptiff.c (put tiffio.h above tmprivat.h)

and on tmapcolrs.c I had to move rtprocess.h also to be also above tmprivat.h

After these changes compiling went like a charm.

Best Regards.

Guy

Hi,

I've managed to install latest HEAD Radiance in Windows 7, after changes
suggested by Guy.
All Radiance programs are compiled correctly.

General procedure for installation I use, is the one described on
Francesco's Wiki page
How to compile Radiance using the MinGW tools and
Scons<http://www.bozzograo.net/radiancewiki/doku.php?id=how_to_compile_radiance_using_the_mingw_tools_and_scons>

So when Radiance site is updated, notes about compilation procedure should
be put on the site and also Windows installation file (for those who don't
want to compile files manually).

Cheers,
Marija

···

On Sun, Oct 3, 2010 at 11:19 PM, Gregory J. Ward <[email protected]>wrote:

Great!

Can someone else verify Guy's suggested changes to the SConscript files. I
still have no idea how any of Schorsch's build system is supposed to work,
so I'm relying on the mailing list for recommended changes.

Cheers,
-Greg

Hello,

Thanks for trying. And I am glad that everything compiled correctly,
however:

For Gendaylit you also need a library file called: 'perezlum.cal'

I added this also to ray\scr\gen\SConscript the line should be:
LIBFILES = Split('illum.cal rev.cal skybright.cal glaze1.cal glaze2.cal
perezlum.cal')

This way the file perezlum.cal is also copied when doing a scons install and
Radiance will be able to interpreted and use the output of Gendaylit.

Best Regards,

Guy

Hi,

I've managed to install latest HEAD Radiance in Windows 7, after changes
suggested by Guy.
All Radiance programs are compiled correctly.

General procedure for installation I use, is the one described on
Francesco's Wiki page
How to compile Radiance using the MinGW tools and
Scons<http://www.bozzograo.net/radiancewiki/doku.php?id=how_to_compile_radiance_using_the_mingw_tools_and_scons>

So when Radiance site is updated, notes about compilation procedure should
be put on the site and also Windows installation file (for those who don't
want to compile files manually).

Cheers,
Marija

Hi,

One more note:
platform/*.cfg files should be updated so that installation paths aren't
"c:\radiance3.6" or so.

For example next can be changed:
[install]
RAD_BASEDIR: c:\radiance4.0
RAD_BINDIR: bin
RAD_RLIBDIR: lib
RAD_MANDIR: man

···

+
after installation user has to set RAYPATH environment variable to Radiance
libraries' path.
Maybe it can be done from Scons script (if somebody knows how it can be
done).

Marija