Cannot build Radiance 4.1a on Windows XP SP2 - beginner

Hi,

This is the first open source project that I am attempting to build. I am new to Python development and a hobby user of C and C++.

I've used a post from Randolph Fritz, http://www.radiance-online.org/pipermail/radiance-dev/2011-February/001109.html , to download latest HEAD files.
I've downloaded Auxiliary library files from http://www.radiance-online.org/software/non-cvs/rad4R1supp.tar.gz

All the files were downloaded on 2011-01-18.

I've downloaded Radiance binaries from http://www.bozzograo.net/radiance/index.php?module=Downloads&func=display&lid=22 , but the fact that the disclaimer states that some "useful programs" are not available, deters me, as a complete Radiance beginner, to consider that binary.

I've tried several different approaches and I am stumped as to what the problem could be.

1. The following error appears:
C:\Ray\ray>scons
scons: Reading SConscript files ...
Detected platform "win32" (nt).
Reading configuration "platform\mingw.cfg"
TypeError: sequence item 0: expected string, function found:
File "C:\Ray\ray\SConstruct", line 57:
load_plat.load_plat(env, ARGUMENTS, platform=None)
File "C:\Ray\ray\build_utils\load_plat.py", line 78:
read_plat(env, args, pfn)
File "C:\Ray\ray\build_utils\load_plat.py", line 12:
cfig.read(fn)
File "C:\Python27\lib\ConfigParser.py", line 297:
self._read(fp, filename)
File "C:\Python27\lib\ConfigParser.py", line 546:
options[name] = '\n'.join(val)

    C:\\Ray\\ray>

Where C:\Ray is where I've download the HEAD files

2. I've tried to debug this program but with my limited knowledge of Python, I cannot get the line cfig.read(fn) in load_plat.py

to read the mingw.cfg file.

I've ran

print os\.path\.isfile\(fn\) \#the file exists
print os\.path\.realpath\(fn\) \#Returns this correctly: C:\\Ray\\ray\\platform\\mingw\.cfg

before cfig.read(fn) and both output expected result
I've tried also cfig.read('c:\\Ray\\ray\\platform\\mingw.cfg') but that also fails (e.g. the file is not read and is ignored.)

Finally I've inserted

print cfig.sections()

statement after the line cfig.read(fn), to check if the file is open. In all cases it returns an empty string.

In fact when 'print' statement is used with code:
# XXX Check that basedir exists.
for k in ['RAD_BINDIR', 'RAD_RLIBDIR', 'RAD_MANDIR']:
if (env.has_key('RAD_BASEDIR') and env.has_key(k)
and not os.path.isabs(env[k])):
env[k] = os.path.join(env['RAD_BASEDIR'],env[k])

The "if statement" is never processed as env.has_key('RAD_BASEDIR') returns False.

3. My platform is:

Windows XP, Service Pack 2

Python 2.7.2
MinGW:
MINGWBASEDIR=C:\MinGW
gcc version 4.6.1 (GCC)
gcc version 4.6.1 (GCC)
GNU gdb (GDB) 7.3.1
GNU ld (GNU Binutils) 2.21.53.20110804
GNU windres (GNU Binutils) 2.21.53.20110804
GNU dlltool (GNU Binutils) 2.21.53.20110804
GNU Make 3.82
#define __MINGW32_VERSION 3.20
#define __W32API_VERSION 3.17

MSYS 1.0
Scons 2.1.0 r5357

My Environment path is configured to include MinGW, MSYS, Python27, Python27/Scripts directories.

Any help in solving this issue is appreciated.

Thank you

Peja

This is something of a headache. I don't think the SCONS build system is working at all anymore -- does anyone use it? Some folks at NREL hired Kitware to replace it with a newer cmake cross-platform build system that is (mostly) ready at this stage. Rob Guglielmetti will probably chime in with the latest status on that project.

Meanwhile, you should feel free to use the binaries from Francesco you found to begin with. They may not be complete in the sense that there are a few missing programs, but much of what you need to run Radiance is there.

Please don't spend any of your time trying to repair the SCONS system. We really should remove it from the repository. Can I get people's opinions on that?

Best,
-Greg

···

From: Predrag Popovic <[email protected]>
Date: January 21, 2012 10:39:02 AM PST

Hi,

This is the first open source project that I am attempting to build. I am new to Python development and a hobby user of C and C++.
I've used a post from Randolph Fritz, http://www.radiance-online.org/pipermail/radiance-dev/2011-February/001109.html , to download latest HEAD files.
I've downloaded Auxiliary library files from http://www.radiance-online.org/software/non-cvs/rad4R1supp.tar.gz

All the files were downloaded on 2011-01-18.

I've downloaded Radiance binaries from http://www.bozzograo.net/radiance/index.php?module=Downloads&func=display&lid=22 , but the fact that the disclaimer states that some "useful programs" are not available, deters me, as a complete Radiance beginner, to consider that binary.

I've tried several different approaches and I am stumped as to what the problem could be.

1. The following error appears:
    C:\Ray\ray>scons
        scons: Reading SConscript files ...
        Detected platform "win32" (nt).
        Reading configuration "platform\mingw.cfg"
        TypeError: sequence item 0: expected string, function found:
          File "C:\Ray\ray\SConstruct", line 57:
            load_plat.load_plat(env, ARGUMENTS, platform=None)
          File "C:\Ray\ray\build_utils\load_plat.py", line 78:
            read_plat(env, args, pfn)
          File "C:\Ray\ray\build_utils\load_plat.py", line 12:
            cfig.read(fn)
          File "C:\Python27\lib\ConfigParser.py", line 297:
            self._read(fp, filename)
          File "C:\Python27\lib\ConfigParser.py", line 546:
            options[name] = '\n'.join(val)

        C:\Ray\ray>

Where C:\Ray is where I've download the HEAD files

2. I've tried to debug this program but with my limited knowledge of Python, I cannot get the line cfig.read(fn) in load_plat.py
to read the mingw.cfg file.

I've ran
    print os.path.isfile(fn) #the file exists
    print os.path.realpath(fn) #Returns this correctly: C:\Ray\ray\platform\mingw.cfg

before cfig.read(fn) and both output expected result
I've tried also cfig.read('c:\\Ray\\ray\\platform\\mingw.cfg') but that also fails (e.g. the file is not read and is ignored.)

Finally I've inserted
print cfig.sections()
statement after the line cfig.read(fn), to check if the file is open. In all cases it returns an empty string.

In fact when 'print' statement is used with code:
# XXX Check that basedir exists.
    for k in ['RAD_BINDIR', 'RAD_RLIBDIR', 'RAD_MANDIR']:
        if (env.has_key('RAD_BASEDIR') and env.has_key(k)
                and not os.path.isabs(env[k])):
            env[k] = os.path.join(env['RAD_BASEDIR'],env[k])

The "if statement" is never processed as env.has_key('RAD_BASEDIR') returns False.

3. My platform is:
Windows XP, Service Pack 2
Python 2.7.2
MinGW:
    MINGWBASEDIR=C:\MinGW
    gcc version 4.6.1 (GCC)
    gcc version 4.6.1 (GCC)
    GNU gdb (GDB) 7.3.1
    GNU ld (GNU Binutils) 2.21.53.20110804
    GNU windres (GNU Binutils) 2.21.53.20110804
    GNU dlltool (GNU Binutils) 2.21.53.20110804
    GNU Make 3.82
    #define __MINGW32_VERSION 3.20
    #define __W32API_VERSION 3.17
MSYS 1.0
Scons 2.1.0 r5357

My Environment path is configured to include MinGW, MSYS, Python27, Python27/Scripts directories.

Any help in solving this issue is appreciated.

Thank you

Peja

Although Scons 1.3.1 (the old version!) is still able to compile Radiance
4.2a, I do think it's time for the Scons build system to be removed.
If you're new to Radiance I would go for some precompiled binaries to run
Radiance as they also set the right environment variables in Windows.

If I remember correctly the NREL/CMAKE build system has some additional
features planned/implemented compared to the Scons/MinGW system. (rvu for
Windows), although I haven't seen it yet.
So it would be nice to hear the latest status of that project.

Best Regards,

Guy

Thank you for quick responses Greg and Guy. It's nice to see an active community.

I've tried using binary packages with tutorial (http://radsite.lbl.gov/radiance/refer/tutorial.html#Intro), but would
like to be able to see the scene that I've described using the
interactive viewer rview. This is what motivated me to compile the source code.

I've managed to compile and install Radiance but without qtrvu. qtrvu did not compile as I did not have QT4 libraries on my computer at the time. I am working on resolving this now.

My understanding from the mailing list is that qtrvu is an alternative to rview for users without Unix/X11 support. Is that correct?

I've read in many posts that old-versions of SCons were required, but most posts were dating back from 2010 and before. It thought that since active development was still being done, that later SCons versions may have been supported. Thank you for clarification Guy.

In compiling Radiance 4.1a, without qtrvu, I ran into 2 problems: SCons and an Error in "rtcontrib.c"

1.SCons 2.1.0 Resolution to the problem I mentioned in my original post: Replace #cfig = ConfigParser.ConfigParser(env.Dictionary()) statement found on line 11, load_plat.py
with
cfig = ConfigParser.ConfigParser()

Removing env.Dictionary() does not cause any adverse effects - but someone else may correct me here

2.'ssize_t' variable name in "rtcontrib.c" conflicts with 'ssize_t' in mingw....include/sys/types.h
Since 'ssize_t' is found in 3 places and only in "rtcontrib.c", I've changed the variable to 'sSize_t'

This allowed the compilation to finish without errors.

From C:\MingW\include\sys\types.h

#ifndef _SSIZE_T_
#define _SSIZE_T_
typedef int _ssize_t;

#ifndef _NO_OLDNAMES
typedef _ssize_t ssize_t;

AND

Here's the error:
gcc -o src\util\rtcontrib.o -c -O2 -D_WIN32 -DMINGW -DNDEBUG -D_CONSOLE -D_MBCS -DHDSUF=.exe -Dfseeko=fseek -Isrc\common src\util\rtcontrib.c
src\util\rtcontrib.c:20:14: error: conflicting types for 'ssize_t'
c:\mingw\bin\../lib/gcc/mingw32/4.6.1/../../../../include/sys/types.h:118:18: note: previous declaration of 'ssize_t' was here
src\util\rtcontrib.c: In function 'main':
src\util\rtcontrib.c:412:3: warning: passing argument 2 of 'execv' from incompatible pointer type [enabled by default]
c:\mingw\bin\../lib/gcc/mingw32/4.6.1/../../../../include/process.h:118:42: note: expected 'const char * const*' but argument is of type 'char **'
scons: *** [src\util\rtcontrib.o] Error 1
scons: building terminated because of errors.

After changing ssize_t to sSize_t, here's the "affected" part of the output:

gcc -o src\util\rtcontrib.o -c -O2 -D_WIN32 -DMINGW -DNDEBUG -D_CONSOLE -D_MBCS -DHDSUF=.exe -Dfseeko=fseek -Isrc\common src\util\rtcontrib.c
src\util\rtcontrib.c: In function 'main':
src\util\rtcontrib.c:412:3: warning: passing argument 2 of 'execv' from incompatible pointer type [enabled by default]
c:\mingw\bin\../lib/gcc/mingw32/4.6.1/../../../../include/process.h:118:42: note: expected 'const char * const*' but argument is of type 'char **'
gcc -o src\util\setscan.o -c -O2 -D_WIN32 -DMINGW -DNDEBUG -D_CONSOLE -D_MBCS -DHDSUF=.exe -Dfseeko=fseek -Isrc\common src\util\setscan.c

···

________________________________
From: Guy Vaessen <[email protected]>
To: [email protected]
Sent: Saturday, January 21, 2012 6:22 PM
Subject: [Radiance-dev] Cannot build Radiance 4.1a on Windows XP SP2 - beginner

Although Scons 1.3.1 (the old version!) is still able to compile Radiance 4.2a, I do think it's time for the Scons build system to be removed.
If you're new to Radiance I would go for some precompiled binaries to run Radiance as they also set the right environment variables in Windows.

If I remember correctly the NREL/CMAKE build system has some additional features planned/implemented compared to the Scons/MinGW system. (rvu for Windows), although I haven't seen it yet.
So it would be nice to hear the latest status of that project.

Best Regards,

Guy

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

That's fantastic to hear.

Thank you for the answer Rob.

Peja

···

________________________________
From: Rob Guglielmetti <[email protected]>
To: Predrag Popovic <[email protected]>; code development <[email protected]>
Sent: Sunday, January 22, 2012 1:20 PM
Subject: Re: [Radiance-dev] Cannot build Radiance 4.1a on Windows XP SP2 - beginner

On Jan 22, 2012, at 10:58 AM, Predrag Popovic wrote:

I've managed to compile and install Radiance but without qtrvu. qtrvu did not compile as I did not have QT4 libraries on my computer at the time. I am working on resolving this now.

My understanding from the mailing list is that qtrvu is an alternative to rview for users without Unix/X11 support. Is that correct?

Exactly. We (NREL) wanted to be able to offer the full set of Radiance tools, and felt that rvu was an essential piece of the pie. It's important to be able to see your exported Radiance geometry in a native Radiance tool, so you know that everything translated correctly.

As I said in my previous post, we hope to release these binary installers very soon, hopefully sometime this week.

- Rob

Yes, I agree.

They don't work on any platform at this point--they're of historical interest only.

Randolph

···

On 2012-01-22 17:32:02 +0000, Guglielmetti, Robert said:

I agree with Guy and Greg, the Scons system could probably go away.