Scons script updates for MinGW compile of 4.0

Here are some changes to make to the Scons scripts, to get 4.0 to
compile on Windows using MinGW. These were compiled on Windows 7, but
it should work for XP as well.

···

************
This one was previously reported on the dev-list.
/ray/build_utils/find_libs.py

Change:
v = env.FindFile('Verdana.fnt', './lib')

to:
v = env.FindFile('Veerdana.fnt', './lib')
***********

***********
Add some new files to the script:
/ray/src/rt/SConscript

Change:
  duphead = env.Object(source="duphead.c")
  persist = env.Object(source="persist.c")
  ambio = env.Object(source="ambio.c")

to:
  duphead = env.Object(source="duphead.c")
  persist = env.Object(source="persist.c")
  ambio = env.Object(source="ambio.c")
  rayfifo = env.Object(source="rayfifo.c")
  raypwin = env.Object(source="raypwin.c")
  raycalls = env.Object(source="raycalls.c")

Change:
rtsrc = ['rtrace.c', duphead, persist, rtmain]

to:
rtsrc = ['rtrace.c', duphead, persist, rtmain, rayfifo, raypwin, raycalls]
************

*********
I couldn't figure out how to cleanly set the tools environment from
win32 (which uses the Microsoft Visual Studio compiler) to mingw.
I made this crude change to the main Sconscript, please tell me the
proper way to force it to use the mingw environment:
/ray/SConstruct

Change:
# Set up build environment
-env = Environment()

to:
# Set up build environment
env = Environment(tools = ['mingw'])
*********

Christian

**************
Christian Kohler, [email protected], (510) 486-5040, http://windows.lbl.gov ,
Windows & Daylighting Research Group, Lawrence Berkeley National Laboratory
1 Cyclotron Rd, Berkeley, California, 94720, USA

Hi Christian, All:

I just checked in the changes you recommended along with a new compatibility module for timegm() that Ling tested for me. I hope it all works, but I have no way to try it out. Could someone give it a go? The HEAD should update by tomorrow (Friday).

Cheers,
-Greg

···

From: Christian Kohler <[email protected]>
Date: May 21, 2010 5:22:41 PM PDT

Here are some changes to make to the Scons scripts, to get 4.0 to
compile on Windows using MinGW. These were compiled on Windows 7, but
it should work for XP as well.

************
This one was previously reported on the dev-list.
/ray/build_utils/find_libs.py

Change:
v = env.FindFile('Verdana.fnt', './lib')

to:
v = env.FindFile('Veerdana.fnt', './lib')
***********

***********
Add some new files to the script:
/ray/src/rt/SConscript

Change:
duphead = env.Object(source="duphead.c")
persist = env.Object(source="persist.c")
ambio = env.Object(source="ambio.c")

to:
duphead = env.Object(source="duphead.c")
persist = env.Object(source="persist.c")
ambio = env.Object(source="ambio.c")
rayfifo = env.Object(source="rayfifo.c")
raypwin = env.Object(source="raypwin.c")
raycalls = env.Object(source="raycalls.c")

Change:
rtsrc = ['rtrace.c', duphead, persist, rtmain]

to:
rtsrc = ['rtrace.c', duphead, persist, rtmain, rayfifo, raypwin, raycalls]
************

*********
I couldn't figure out how to cleanly set the tools environment from
win32 (which uses the Microsoft Visual Studio compiler) to mingw.
I made this crude change to the main Sconscript, please tell me the
proper way to force it to use the mingw environment:
/ray/SConstruct

Change:
# Set up build environment
-env = Environment()

to:
# Set up build environment
env = Environment(tools = ['mingw'])
*********

Christian

Hi,

I've just tried latest HEAD version installation on Windows XP, SP3, and
have next errors:

···

###############

F:\Instalacije\ray>C:\Python26\Scripts\scons build
scons: Reading SConscript files ...
Detected platform "win32" (nt).
Reading configuration "platform\mingw.cfg"

scons: warning: The Options class is deprecated; use the Variables class
instead
.
File "F:\Instalacije\ray\SConstruct", line 9, in set_opts
Checking for C library GL... no
Checking for TIFFInitSGILog() in C library tiff... no
TypeError: can only concatenate list (not "str") to list:
  File "F:\Instalacije\ray\SConstruct", line 81:
    SConscript(os.path.join('src', 'common', 'SConscript'))
  File
"C:\Python26\Lib\site-packages\scons-1.3.0\SCons\Script\SConscript.py", l
ine 616:
    return apply(method, args, kw)
  File
"C:\Python26\Lib\site-packages\scons-1.3.0\SCons\Script\SConscript.py", l
ine 553:
    return apply(_SConscript, [self.fs,] + files, subst_kw)
  File
"C:\Python26\Lib\site-packages\scons-1.3.0\SCons\Script\SConscript.py", l
ine 262:
    exec _file_ in call_stack[-1].globals
  File "F:\Instalacije\ray\src\common\SConscript", line 47:
    ALL = RTSCENE + RTPIC + STD + RTNET + env.get('RAD_COMPAT',[])

Also it doesn't want to start building if supplementary files aren't
included (previous version of Scons script build and installed even without
lib files).

#####

What I have tried to do:
****
If I replace line:
opts = Options(OPTFILE, ARGUMENTS) with
opts = Variables(OPTFILE, ARGUMENTS)
only depreciation warning is removed, and the rest of the error remains.

******
For error in line 81, I've tried to replace this path string with list in
SConscript(), but the same errors again.

****
Comment out line 81. I've got next error during building:
F:\Instalacije\ray>C:\Python26\Scripts\scons build
scons: Reading SConscript files ...
Detected platform "win32" (nt).
Reading configuration "platform\mingw.cfg"
Checking for C library GL... (cached) no
Checking for TIFFInitSGILog() in C library tiff... (cached) no
meta
cv
gen
ot
rt
  File "F:\Instalacije\ray\src\rt\SConscript", line 21

    raycalls = env.Object(source="raycalls.c')

                                             ^

SyntaxError: EOL while scanning string literal

****
Yse old SConstruct file from 25th May instead of current one.
The same error as previous one:
...
SyntaxError: EOL while scanning string literal

################

I'm using Python 2.6 and installed scons 1.3.0

Any ideas?

Marija

Hi,

I've just tried latest HEAD version installation on Windows XP, SP3, and
have next errors:

File "F:\Instalacije\ray\src\common\SConscript", line 47:
ALL = RTSCENE + RTPIC + STD + RTNET + env.get('RAD_COMPAT',[])

I'd say env.get('RAD_COMPAT') returns a string instead of a string
wrapped in a list. Try to add a print statement before this line to
see the value of RAD_COMPAT (and possibly all the other vars). Once
you know which value is not a list you can either search where it get
set (wrongly) or modify the above line to something like

ALL = RTSCENE + RTPIC + STD + RTNET + [env.get('RAD_COMPAT',"")]

or similar.

What I have tried to do:
****
If I replace line:
opts = Options(OPTFILE, ARGUMENTS) with
opts = Variables(OPTFILE, ARGUMENTS)
only depreciation warning is removed, and the rest of the error remains.

The error is raised by the Python interpreter in the "ALL = ..." line
above. Modifying "opts=" will have no effect here.

******
For error in line 81, I've tried to replace this path string with list in
SConscript(), but the same errors again.
****

The error is not in line 81; it's in line 47. It just get's passed up
through the stack until it reaches the top level function SConscript()
in line 47 where the Python interpreter complains.

Comment out line 81. I've got next error during building:

[...]

File "F:\Instalacije\ray\src\rt\SConscript", line 21

raycalls = env\.Object\(source=&quot;raycalls\.c&#39;\)

                                         ^

SyntaxError: EOL while scanning string literal

Mix of double and single quotes around "raycalls.c"

Regards,
Thomas

···

On Wed, Jun 2, 2010 at 12:29 PM, Marija Velickovic <[email protected]> wrote:

Thanks Thomas,

When I looked at the error better, you were completely right that error is
in line 47.

Anyway, I've changed this line and also another problem with quotes
+ added one line in header.c file to include "timegm.c" file.

So all 4 files are in attachment, so please Greg or someone else please
check them and include in CVS repository:

   - ray/SConstruct
   - ray/src/common/SConscript
   - ray/src/common/header.c
   - ray/src/rt/SConscript

After this changes, building goes flowless.
Installation is still problematic because there are the same files in
ray/lib and ray/src/gen, like this error below:

SConstruct (2.82 KB)

SConscript (3.52 KB)

header.c (6.74 KB)

SConscript (3.5 KB)

···

#############
Install file: "src\gen\clockface.hex" as
"C:\radiance3.6a\share\lib\clockface.he
x"
scons: *** [C:\radiance3.6a\share\lib\clockface.hex] AssertionError :
Installing
source ['src\\gen\\clockface.hex', 'lib\\clockface.hex'] into target
['C:\\radi
ance3.6a\\share\\lib\\clockface.hex']: target and source lists must have
same le
ngth.
Traceback (most recent call last):
  File "C:\Python26\Lib\site-packages\scons-1.3.0\SCons\Action.py", line
1050, i
n execute
    result = self.execfunction(target=target, source=rsources, env=env)
  File "C:\Python26\Lib\site-packages\scons-1.3.0\SCons\Tool\install.py",
line 7
9, in installFunc
    "Installing source %s into target %s: target and source lists must have
same
length."%(map(str, source), map(str, target))
AssertionError: Installing source ['src\\gen\\clockface.hex',
'lib\\clockface.he
x'] into target ['C:\\radiance3.6a\\share\\lib\\clockface.hex']: target and
sour
ce lists must have same length.
scons: building terminated because of errors.

##############
Since no knowledge of Scons, I can't go deeper in this error for the moment.

Thanks again,
Marija