Hi Guy, Randolph, et al.:

Guy of course I recall your recent post on compiling Radiance for Windows with 
scons. Great work, a great follow-up to all the hard work Francesco Anselmo did 
years ago to get a MinGW compile. My post was in no way meant to trivialize the 
work you and others are doing.  What we are looking to do at NREL is to create 
a cmake environment that is easy to maintain, that would provide nightly builds 
of Radiance for Windows, with a dashboard environment that would allow us to 
stay on top of any new changes to the code base (that seem to be coming fast 
and furious lately (a good thing)). I have been using Radiance for a ling time, 
but I can still remember the bleeding edge pain I went through in the mid 90's 
trying to learn UNIX sysadmin skills before I ever got to run oconv. I think a 
reliable repository for Windows binaries of the complete Radiance suite that 
keeps pace with development (which is very active these days) is important and 
novel. It also in no way means the scons work you have done is irrelevant. 

Randolph, I'm sorry but I simply don't agree with you on your assessment of 
cmake. Internally, we are using cmake to keep pace with an agile development 
cycle involving a couple dozen software engineers, working on cross platform 
(Win/Mac/Linux) builds of our analysis platform. The idiot typing this email is 
able to maintain binaries on his OSX systems, and the Windows systems he has 
running on his VMs, with minimal knowledge of cmake. It's a big system, but it 
allows experts to allow novices to do expert things, and everywhere in between, 
developers of all stripes have access to source code and cross platform 
functionality that encourages participation. 

Our intent is to offer a couple of alternatives here. 

- Rob
____________________________
From: [email protected] 
[[email protected]] On Behalf Of Guy Vaessen 
[[email protected]]
Sent: Wednesday, November 10, 2010 1:43 PM
To: [email protected]
Subject: [Radiance-dev] Re: Python Radiance Package

I have posted this before to the mailing list, I know it is not nice to double 
post but since there are still some questions on the Scons scripts I re-posted 
everything (in one large message, with a fix or two):

This is my procedure to compile Radiance 40 HEAD with Scons:
If something is not working let me know then I can look into it.

General procedure for installation, 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

For compilation I used:
Radiance 4.0 from http://radsite.lbl.gov/radiance/dist/rad4R0all.tar.gz 
(Includes auxiliary files)
+ latest HEAD archive from 
http://www.radiance-online.org/software/snapshots/radiance-HEAD.tgz
MinGW with gcc 4.5.0
Python 2.7 + scons 1.3.1 (You might also have to set the PATH variable to 
Python and Scons)

Extract Radiance 4.0 and HEAD and place HEAD files over Radiance 4.0 files 
overwriting the old ones.
Extracting can be done with the tools listed on the radiancewiki site mentioned 
above.
or possibly also with winzip or 7-zip.

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

Change 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'])

For Gendaylit you also need a library files called: 'perezlum.cal 
coeff_perez.dat defangle.dat'

Add this to ray\scr\gen\SConscript the line should be:
LIBFILES = Split('illum.cal rev.cal skybright.cal glaze1.cal glaze2.cal 
perezlum.cal coeff_perez.dat defangle.dat')

Check if: progs.append(prog)
is present before this line in ray\scr\gen\SConscript:
prog = env.Program(target=os.path.join('$RAD_BUILDBIN', 'mksource'),

When compiling tmapluv.c the compiler complains about a variable
declaration that is already declared elsewhere, to solve this:

Change the include order in these files (ray\src\common\):
tmapluv.c to put "tiffio.h" above "tmprivat.h"
tmaptiff.c to put "tiffio.h" above "tmprivat.h"
tmapcolrs.c to put "rtprocess.h" above "tmprivat.h"

To compile mgf2meta:
Change in ray\scr\cv\SConscript
# meta targets
prog = env.Program(target=rbin('mgf2meta'), source=['mgf2meta.c'],
        CPPPATH=env.get('CPPPATH', []) + [os.path.join('#src','meta')],
        LIBS=['meta','rtmath','rtcont','rtmem','rterror','mgf'] + mlib)
env.Append(RAD_BININSTALL=[env.Install(env['RAD_BINDIR'], prog)])

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

Open cmd window on Windows
Change to ray dir
type: scons build
And after a successful build
type: scons install

+
after installation user has to set RAYPATH environment variable to Radiance
libraries' path.
and the PATH environment variable to Radiance bin path

For those of you interested in compiling ra_tiff and normtiff for Windows, 
below are the instructions on how it could be done.

Tools:
Get tiff-3.9.4.zip from ftp://ftp.remotesensing.org/pub/libtiff/
Get MinGW + MSYS shell from http://www.mingw.org/

To open a MSYS shell: Go to C:\msys\1.0\msys.bat (or where you installed MSYS)

Original instructions from:
http://www.gaia-gis.it/spatialite-2.4.0/mingw_how_to.html#libtiff
Only step 5 should be enough to compile libtiff (since we do not use libz nor 
libjpeg)
To make it work with Radiance I had to modify the procedure a bit:

    download the latest sources: tiff-3.9.4.zip
    uncompress this zip-file
    then open an MSYS shell

cd tiff-3.9.4
./configure --enable-static --enable-logluv --disable-shared --disable-cxx 
--disable-jpeg --disable-zlib --disable-pixarlog
make
make install-strip

Copy the file libtiff.a from C:\msys\1.0\local\lib to C:\..\..\ray\src\lib   
(where ..\..\ points to where you extracted the Radiance source files)

To build ra_tiff add these lines to ray\src\px\SConscript:

ra_tiff = env.Program(target=radbin('ra_tiff'), source=['ra_tiff.c'],
    LIBS=['libtiff','rtpic','rtio','rtmem'] + mlib)
progs.append(ra_tiff)


In a similar way normtiff can be build:

Add this line to \ray\src\common\SConscript after the section # build libraries:

rtall = env.StaticLibrary(target=radlib('rtall'), source=ALL)

To build normtiff add these lines to ray\src\px\SConscript:

normtiff = env.Program(target=radbin('normtiff'),source=['normtiff.c'],
    LIBS=['libtiff','rtall'] + mlib)
progs.append(normtiff)

Then proceed with building Radiance with scons.

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

Reply via email to