diff --git a/build/SConscript.configure b/build/SConscript.configure index 394984ad..a516a83b 100644 --- a/build/SConscript.configure +++ b/build/SConscript.configure @@ -68,11 +68,11 @@ vars.Add('MSVC_VERSION', 'MS Visual C++ compiler version') vars.Add('QTDIR', 'Qt installation directory') try: - env = Environment(options=vars, ENV = os.environ, tools=['default', 'qt4'], toolpath=['#data']) + env = Environment(options=vars, ENV = os.environ, tools=['default', 'qt4', 'icl12'], toolpath=['#data/scons']) print 'Checking for Qt 4.x... yes' hasQt = True except Exception: - env = Environment(options=vars, ENV = os.environ, tools=['default']) + env = Environment(options=vars, ENV = os.environ, tools=['default', 'icl12'], toolpath=['#data/scons']) print 'Unable to detect a Qt installation -- not building the GUI!' hasQt = False diff --git a/build/config-darwin-universal.py b/build/config-darwin-universal.py index 672db3ad..384b25f6 100644 --- a/build/config-darwin-universal.py +++ b/build/config-darwin-universal.py @@ -1,5 +1,6 @@ BUILDDIR = '#build/release' CXX = 'g++' +CC = 'gcc' CXXFLAGS = ['-arch', 'i386', '-arch', 'x86_64', '-mmacosx-version-min=10.5', '-march=nocona', '-msse2', '-mfpmath=sse', '-ftree-vectorize', '-funsafe-math-optimizations', '-fno-rounding-math', '-fno-signaling-nans', '-fomit-frame-pointer', '-isysroot', '/Developer/SDKs/MacOSX10.5.sdk', '-O3', '-Wall', '-g', '-pipe', '-DMTS_DEBUG', '-DSINGLE_PRECISION', '-DMTS_SSE', '-DMTS_HAS_COHERENT_RT', '-fopenmp', '-fstrict-aliasing', '-fsched-interblock', '-freorder-blocks'] LINKFLAGS = ['-framework', 'OpenGL', '-framework', 'Cocoa', '-arch', 'i386', '-arch', 'x86_64', '-mmacosx-version-min=10.5', '-Wl,-syslibroot,/Developer/SDKs/MacOSX10.5.sdk'] BASEINCLUDE = ['#include'] diff --git a/build/config-darwin-x86.py b/build/config-darwin-x86.py index cec0a085..9e36f5a2 100644 --- a/build/config-darwin-x86.py +++ b/build/config-darwin-x86.py @@ -1,5 +1,6 @@ BUILDDIR = '#build/release' CXX = 'g++' +CC = 'gcc' CXXFLAGS = ['-arch', 'i386', '-mmacosx-version-min=10.5', '-march=nocona', '-msse2', '-mfpmath=sse', '-ftree-vectorize', '-funsafe-math-optimizations', '-fno-rounding-math', '-fno-signaling-nans', '-fomit-frame-pointer', '-isysroot', '/Developer/SDKs/MacOSX10.5.sdk', '-O3', '-Wall', '-g', '-pipe', '-DMTS_DEBUG', '-DSINGLE_PRECISION', '-DMTS_SSE', '-DMTS_HAS_COHERENT_RT', '-fopenmp', '-fstrict-aliasing', '-fsched-interblock', '-freorder-blocks'] LINKFLAGS = ['-framework', 'OpenGL', '-framework', 'Cocoa', '-arch', 'i386', '-mmacosx-version-min=10.5', '-Wl,-syslibroot,/Developer/SDKs/MacOSX10.5.sdk'] BASEINCLUDE = ['#include'] diff --git a/build/config-darwin-x86_64.py b/build/config-darwin-x86_64.py index 864f0af5..d8c535ab 100644 --- a/build/config-darwin-x86_64.py +++ b/build/config-darwin-x86_64.py @@ -1,5 +1,6 @@ BUILDDIR = '#build/release' CXX = 'g++' +CC = 'gcc' CXXFLAGS = ['-arch', 'x86_64', '-mmacosx-version-min=10.5', '-march=nocona', '-msse2', '-mfpmath=sse', '-ftree-vectorize', '-funsafe-math-optimizations', '-fno-rounding-math', '-fno-signaling-nans', '-isysroot', '/Developer/SDKs/MacOSX10.5.sdk', '-O3', '-Wall', '-g', '-pipe', '-DMTS_DEBUG', '-DSINGLE_PRECISION', '-DMTS_SSE', '-DMTS_HAS_COHERENT_RT', '-fopenmp', '-fstrict-aliasing', '-fsched-interblock', '-freorder-blocks'] LINKFLAGS = ['-framework', 'OpenGL', '-framework', 'Cocoa', '-arch', 'x86_64', '-mmacosx-version-min=10.5', '-Wl,-syslibroot,/Developer/SDKs/MacOSX10.5.sdk'] BASEINCLUDE = ['#include'] diff --git a/build/config-icl11-win32.py b/build/config-icl12-msv2010-win32.py similarity index 59% rename from build/config-icl11-win32.py rename to build/config-icl12-msv2010-win32.py index 969c7d3c..0faf9a59 100644 --- a/build/config-icl11-win32.py +++ b/build/config-icl12-msv2010-win32.py @@ -1,27 +1,27 @@ BUILDDIR = '#build/release' CXX = 'icl' -GCC = 'icl' -CXXFLAGS = ['/nologo', '/O3', '/Qipo', '/QxSSSE3', '/QaxSSE4.2,SSE4.1', '/fp:fast=2', '/D', 'WIN32', '/W3', '/EHsc', '/GS-', '/GL', '/MD', '/D', 'MTS_DEBUG', '/D', 'SINGLE_PRECISION', '/D', 'MTS_SSE', '/D', 'MTS_HAS_COHERENT_RT', '/D', '_CONSOLE', '/D', 'NDEBUG', '/Qopenmp'] +CC = 'icl' +LINK = 'xilink' +CXXFLAGS = ['/nologo', '/O3', '/Qipo', '/Qprec-div-', '/QxSSE2', '/QaxSSE3,SSE4.2', '/fp:fast=2', '/D', 'WIN32', '/W3', '/EHsc', '/GS-', '/MD', '/D', 'MTS_DEBUG', '/D', 'SINGLE_PRECISION', '/D', 'MTS_SSE', '/D', 'MTS_HAS_COHERENT_RT', '/D', '_CONSOLE', '/D', 'NDEBUG', '/Qopenmp'] SHCXXFLAGS = CXXFLAGS TARGET_ARCH = 'x86' -MSVC_VERSION = '9.0' -LINK = 'xilink' -LINKFLAGS = ['/nologo', '/SUBSYSTEM:CONSOLE', '/MACHINE:X86', '/FIXED:NO', '/OPT:REF', '/OPT:ICF', '/NODEFAULTLIB:LIBCMT'] +MSVC_VERSION = '10.0' +LINKFLAGS = ['/nologo', '/SUBSYSTEM:CONSOLE', '/MACHINE:X86', '/FIXED:NO', '/OPT:REF', '/OPT:ICF', '/LTCG', '/NODEFAULTLIB:LIBCMT', '/MANIFEST'] BASEINCLUDE = ['#include', '#dependencies/windows/include'] -BASELIB = ['pthreadVCE2', 'msvcrt', 'ws2_32', 'libmmds'] +BASELIB = ['pthreadVCE2', 'msvcrt', 'ws2_32'] OEXRINCLUDE = ['#dependencies/windows/include/OpenEXR'] OEXRFLAGS = ['/D', 'OPENEXR_DLL'] OEXRLIB = ['IlmImf', 'IlmThread', 'zlib1', 'Half'] BOOSTINCLUDE = ['#dependencies'] -BOOSTLIB = ['boost_system-vc90-mt-1_44', 'boost_filesystem-vc90-mt-1_44'] +BOOSTLIB = ['boost_system-vc100-mt-1_44', 'boost_filesystem-vc100-mt-1_44'] COLLADAINCLUDE = ['#dependencies/windows/include/colladadom', '#dependencies/windows/include/colladadom/1.4'] -COLLADALIB = ['libcollada14dom21'] +COLLADALIB = ['libcollada14dom23'] XERCESLIB = ['xerces-c_3'] PNGLIB = ['libpng13'] JPEGLIB = ['jpeg62'] GLLIB = ['opengl32', 'glu32', 'glew32mx', 'gdi32', 'user32'] GLFLAGS = ['/D', 'GLEW_MX'] -BASELIBDIR = ['#dependencies/windows/lib32', '#dependencies/windows/lib32/vc90'] +BASELIBDIR = ['#dependencies/windows/lib32', '#dependencies/windows/lib32/vc100'] SHLIBPREFIX = 'lib' SHLIBSUFFIX = '.dll' PROGSUFFIX = '.exe' diff --git a/build/config-icl11-win64.py b/build/config-icl12-msv2010-win64.py similarity index 58% rename from build/config-icl11-win64.py rename to build/config-icl12-msv2010-win64.py index c7be8ee2..a80a22b7 100644 --- a/build/config-icl11-win64.py +++ b/build/config-icl12-msv2010-win64.py @@ -1,28 +1,27 @@ BUILDDIR = '#build/release' CXX = 'icl' -GCC = 'icl' -CXXFLAGS = ['/nologo', '/O3', '/Qipo', '/QxSSSE3', '/QaxSSE4.2,SSE4.1', '/fp:fast=2', '/D', 'WIN32', '/D', 'WIN64', '/W3', '/EHsc', '/GS-', '/GL', '/MD', '/D', 'MTS_DEBUG', '/D', 'SINGLE_PRECISION', '/D', 'MTS_SSE', '/D', 'MTS_HAS_COHERENT_RT', '/D', '_CONSOLE', '/D', 'NDEBUG', '/Qopenmp'] +CC = 'icl' +LINK = 'xilink' +CXXFLAGS = ['/nologo', '/O3', '/Qipo', '/Qprec-div-', '/QxSSE2', '/QaxSSE3,SSE4.2', '/fp:fast=2', '/D', 'WIN32', '/D', 'WIN64', '/W3', '/EHsc', '/GS-', '/MD', '/D', 'MTS_DEBUG', '/D', 'SINGLE_PRECISION', '/D', 'MTS_SSE', '/D', 'MTS_HAS_COHERENT_RT', '/D', '_CONSOLE', '/D', 'NDEBUG', '/Qopenmp'] SHCXXFLAGS = CXXFLAGS TARGET_ARCH = 'x86_64' -MSVC_VERSION = '9.0' -LINK = 'xilink' -LINKFLAGS = ['/nologo', '/SUBSYSTEM:CONSOLE', '/MACHINE:X64', '/FIXED:NO', '/OPT:REF', '/OPT:ICF', '/NODEFAULTLIB:LIBCMT'] +MSVC_VERSION = '10.0' +LINKFLAGS = ['/nologo', '/SUBSYSTEM:CONSOLE', '/MACHINE:X64', '/FIXED:NO', '/OPT:REF', '/OPT:ICF', '/LTCG', '/NODEFAULTLIB:LIBCMT', '/MANIFEST'] BASEINCLUDE = ['#include', '#dependencies/windows/include'] -BASELIB = ['pthreadVCE2', 'msvcrt', 'ws2_32', 'libmmds'] -QTDIR = 'C:\\Qt64' +BASELIB = ['pthreadVCE2', 'msvcrt', 'ws2_32'] OEXRINCLUDE = ['#dependencies/windows/include/OpenEXR'] OEXRFLAGS = ['/D', 'OPENEXR_DLL'] OEXRLIB = ['IlmImf', 'IlmThread', 'zlib1', 'Half'] BOOSTINCLUDE = ['#dependencies'] -BOOSTLIB = ['boost_system-vc90-mt-1_44', 'boost_filesystem-vc90-mt-1_44'] +BOOSTLIB = ['boost_system-vc100-mt-1_44', 'boost_filesystem-vc100-mt-1_44'] COLLADAINCLUDE = ['#dependencies/windows/include/colladadom', '#dependencies/windows/include/colladadom/1.4'] -COLLADALIB = ['libcollada14dom21'] +COLLADALIB = ['libcollada14dom23'] XERCESLIB = ['xerces-c_3'] PNGLIB = ['libpng13'] JPEGLIB = ['jpeg62'] GLLIB = ['opengl32', 'glu32', 'glew32mx', 'gdi32', 'user32'] GLFLAGS = ['/D', 'GLEW_MX'] -BASELIBDIR = ['#dependencies/windows/lib64', '#dependencies/windows/lib64/vc90'] +BASELIBDIR = ['#dependencies/windows/lib64', '#dependencies/windows/lib64/vc100'] SHLIBPREFIX = 'lib' SHLIBSUFFIX = '.dll' PROGSUFFIX = '.exe' diff --git a/build/config-linux-debug.py b/build/config-linux-debug.py index 485f6958..4f492ce5 100644 --- a/build/config-linux-debug.py +++ b/build/config-linux-debug.py @@ -1,5 +1,6 @@ BUILDDIR = '#build/debug' CXX = 'g++' +CC = 'gcc' CXXFLAGS = ['-O0', '-Wall', '-g', '-pipe', '-march=nocona', '-msse2', '-ftree-vectorize', '-mfpmath=sse', '-funsafe-math-optimizations', '-fno-rounding-math', '-fno-signaling-nans', '-fomit-frame-pointer', '-DMTS_DEBUG', '-DSINGLE_PRECISION', '-DMTS_SSE', '-DMTS_HAS_COHERENT_RT', '-fopenmp'] LINKFLAGS = [] SHLINKFLAGS = ['-rdynamic', '-shared', '-fPIC'] diff --git a/build/config-linux.py b/build/config-linux.py index 108101d7..7a5f6d4f 100644 --- a/build/config-linux.py +++ b/build/config-linux.py @@ -1,5 +1,6 @@ BUILDDIR = '#build/release' CXX = 'g++' +CC = 'gcc' CXXFLAGS = ['-O3', '-Wall', '-g', '-pipe', '-march=nocona', '-msse2', '-ftree-vectorize', '-mfpmath=sse', '-funsafe-math-optimizations', '-fno-rounding-math', '-fno-signaling-nans', '-fomit-frame-pointer', '-DMTS_DEBUG', '-DSINGLE_PRECISION', '-DMTS_SSE', '-DMTS_HAS_COHERENT_RT', '-fopenmp'] LINKFLAGS = [] SHLINKFLAGS = ['-rdynamic', '-shared', '-fPIC'] diff --git a/build/config-msvc2008-win32-debug.py b/build/config-msvc2008-win32-debug.py index d2148931..750ced5b 100644 --- a/build/config-msvc2008-win32-debug.py +++ b/build/config-msvc2008-win32-debug.py @@ -1,6 +1,6 @@ BUILDDIR = '#build/debug' CXX = 'cl' -GCC = 'cl' +CC = 'cl' # /Ox=optimize for speed, global optimizations, intrinsic functions, favor fast code, frame pointer omission # /EHsc=C++ exceptions, /fp:fast=Enable reasonable FP optimizations, /GS-=No buffer security checks, /GL=whole program optimizations # To include debug information add '/Z7' to CXXFLAGS and '/DEBUG' to LINKFLAGS diff --git a/build/config-msvc2008-win32.py b/build/config-msvc2008-win32.py index 2c419496..cae74ae1 100644 --- a/build/config-msvc2008-win32.py +++ b/build/config-msvc2008-win32.py @@ -1,6 +1,6 @@ BUILDDIR = '#build/release' CXX = 'cl' -GCC = 'cl' +CC = 'cl' # /Ox=optimize for speed, global optimizations, intrinsic functions, favor fast code, frame pointer omission # /EHsc=C++ exceptions, /fp:fast=Enable reasonable FP optimizations, /GS-=No buffer security checks, /GL=whole program optimizations # To include debug information add '/Z7' to CXXFLAGS and '/DEBUG' to LINKFLAGS diff --git a/build/config-msvc2008-win64-debug.py b/build/config-msvc2008-win64-debug.py index dbb19fa0..4d4d664f 100644 --- a/build/config-msvc2008-win64-debug.py +++ b/build/config-msvc2008-win64-debug.py @@ -1,6 +1,6 @@ BUILDDIR = '#build/debug' CXX = 'cl' -GCC = 'cl' +CC = 'cl' # /Ox=optimize for speed, global optimizations, intrinsic functions, favor fast code, frame pointer omission # /EHsc=C++ exceptions, /fp:fast=Enable reasonable FP optimizations, /GS-=No buffer security checks, /GL=whole program optimizations # To include debug information add '/Z7' to CXXFLAGS and '/DEBUG' to LINKFLAGS diff --git a/build/config-msvc2008-win64.py b/build/config-msvc2008-win64.py index c61bff5f..9a97bf68 100644 --- a/build/config-msvc2008-win64.py +++ b/build/config-msvc2008-win64.py @@ -1,6 +1,6 @@ BUILDDIR = '#build/release' CXX = 'cl' -GCC = 'cl' +CC = 'cl' # /Ox=optimize for speed, global optimizations, intrinsic functions, favor fast code, frame pointer omission # /EHsc=C++ exceptions, /fp:fast=Enable reasonable FP optimizations, /GS-=No buffer security checks, /GL=whole program optimizations # To include debug information add '/Z7' to CXXFLAGS and '/DEBUG' to LINKFLAGS diff --git a/build/config-msvc2010-win32-debug.py b/build/config-msvc2010-win32-debug.py index 520d5eb7..fd3bc299 100644 --- a/build/config-msvc2010-win32-debug.py +++ b/build/config-msvc2010-win32-debug.py @@ -1,6 +1,6 @@ BUILDDIR = '#build/debug' CXX = 'cl' -GCC = 'cl' +CC = 'cl' # /Ox=optimize for speed, global optimizations, intrinsic functions, favor fast code, frame pointer omission # /EHsc=C++ exceptions, /fp:fast=Enable reasonable FP optimizations, /GS-=No buffer security checks, /GL=whole program optimizations # To include debug information add '/Z7' to CXXFLAGS and '/DEBUG' to LINKFLAGS diff --git a/build/config-msvc2010-win32.py b/build/config-msvc2010-win32.py index 225fbfab..5b04fcd9 100644 --- a/build/config-msvc2010-win32.py +++ b/build/config-msvc2010-win32.py @@ -1,6 +1,6 @@ BUILDDIR = '#build/release' CXX = 'cl' -GCC = 'cl' +CC = 'cl' # /Ox=optimize for speed, global optimizations, intrinsic functions, favor fast code, frame pointer omission # /EHsc=C++ exceptions, /fp:fast=Enable reasonable FP optimizations, /GS-=No buffer security checks, /GL=whole program optimizations # To include debug information add '/Z7' to CXXFLAGS and '/DEBUG' to LINKFLAGS diff --git a/build/config-msvc2010-win64-debug.py b/build/config-msvc2010-win64-debug.py index 3bfddec0..8a1541c5 100644 --- a/build/config-msvc2010-win64-debug.py +++ b/build/config-msvc2010-win64-debug.py @@ -1,6 +1,6 @@ BUILDDIR = '#build/debug' CXX = 'cl' -GCC = 'cl' +CC = 'cl' # /Ox=optimize for speed, global optimizations, intrinsic functions, favor fast code, frame pointer omission # /EHsc=C++ exceptions, /fp:fast=Enable reasonable FP optimizations, /GS-=No buffer security checks, /GL=whole program optimizations # To include debug information add '/Z7' to CXXFLAGS and '/DEBUG' to LINKFLAGS diff --git a/build/config-msvc2010-win64.py b/build/config-msvc2010-win64.py index baca291f..2902ffb2 100644 --- a/build/config-msvc2010-win64.py +++ b/build/config-msvc2010-win64.py @@ -1,6 +1,6 @@ BUILDDIR = '#build/release' CXX = 'cl' -GCC = 'cl' +CC = 'cl' # /Ox=optimize for speed, global optimizations, intrinsic functions, favor fast code, frame pointer omission # /EHsc=C++ exceptions, /fp:fast=Enable reasonable FP optimizations, /GS-=No buffer security checks, /GL=whole program optimizations # To include debug information add '/Z7' to CXXFLAGS and '/DEBUG' to LINKFLAGS diff --git a/data/scons/icl12.py b/data/scons/icl12.py new file mode 100644 index 00000000..53889ef5 --- /dev/null +++ b/data/scons/icl12.py @@ -0,0 +1,115 @@ +import os, sys, subprocess, copy, re + +def get_output(script, args = None, shellenv = None): + if sys.platform == 'win32': + cmdLine = '"%s" %s & set' % (script, (args if args else '')) + shell = False + elif sys.platform.startswith('linux'): + cmdLine = 'source "%s" %s ; set' % (script, (args if args else '')) + shell = True + else: + raise Exception("Unsuported OS type: " + sys.platform) + + popen = subprocess.Popen(cmdLine, shell=shell, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=shellenv) + + # Use the .stdout and .stderr attributes directly because the + # .communicate() method uses the threading module on Windows + # and won't work under Pythons not built with threading. + stdout = popen.stdout.read() + if popen.wait() != 0: + raise IOError(popen.stderr.read()) + + output = stdout + return output + + +def parse_output(output, keep = None): + ret={} #this is the data we will return + + ## parse everything + reg=re.compile('(\\w*)=(.*)', re.I) + for line in output.splitlines(): + m=reg.match(line) + if m: + if keep is not None: + #see if we need to filter out data + k=m.group(1) + if k in keep: + ret[k]=m.group(2)#.split(os.pathsep) + else: + # take everything + ret[m.group(1)]=m.group(2)#.split(os.pathsep) + + #see if we need to filter out data + if keep is not None: + pass + + return ret + +def normalize_env(shellenv, keys): + """Given a dictionary representing a shell environment, add the variables + from os.environ needed for the processing of .bat files; the keys are + controlled by the keys argument. + + It also makes sure the environment values are correctly encoded. + + Note: the environment is copied""" + normenv = {} + if shellenv: + if sys.platform=='win32': + for k in shellenv.keys(): + normenv[k] = copy.deepcopy(shellenv[k]).encode('mbcs') + + for k in keys: + if os.environ.has_key(k): + normenv[k] = os.environ[k] + + return normenv + +def get_script_env(env,script,args=None,vars=None): + ''' + this function returns a dictionary of all the data we want to merge + or process in some other way. + ''' + if sys.platform=='win32': + nenv = normalize_env(env['ENV'], ['COMSPEC']) + else: + nenv = normalize_env(env['ENV'], []) + output = get_output(script,args,nenv) + vars = parse_output(output, vars) + + return vars + + +def merge_script_vars(env,script,args=None,vars=None): + ''' + This merges the data retieved from the script in to the Enviroment + by prepending it. + script is the name of the script, args is optional arguments to pass + vars are var we want to retrieve, if None it will retieve everything found + ''' + shell_env=get_script_env(env,script,args,vars) + for k, v in shell_env.iteritems(): + env.PrependENVPath(k, v, delete_existing=1) + +def generate(env): + if env['TARGET_ARCH'] == 'x86': + arch = 'ia32' + elif env['TARGET_ARCH'] == 'x86_64': + arch = 'ia32_intel64' + else: + raise Exception('Unknown architecture!') + + if env['MSVC_VERSION'] == '9.0': + vsrelease = 'vs2008' + elif env['MSVC_VERSION'] == '10.0': + vsrelease = 'vs2010' + else: + raise Exception('Unknown version of visual studio!') + + icpp_path = os.environ.get('ICPP_COMPOSER2011') + merge_script_vars(env, os.path.join(icpp_path, 'bin/iclvars.bat'), arch + ' ' + vsrelease) + +def exists(env): + return 'ICPP_COMPOSER2011' in os.environ + diff --git a/data/qt4.py b/data/scons/qt4.py similarity index 100% rename from data/qt4.py rename to data/scons/qt4.py diff --git a/doc/compiling.tex b/doc/compiling.tex index bfa967f8..3338bd6d 100644 --- a/doc/compiling.tex +++ b/doc/compiling.tex @@ -25,12 +25,12 @@ build/config-linux.py build/config-darwin-x86_64.py build/config-darwin-x86.py build/config-darwin-universal.py -build/config-icl11-win32.py -build/config-icl11-win64.py build/config-msvc2008-win32.py build/config-msvc2008-win64.py build/config-msvc2010-win32.py build/config-msvc2010-win64.py +build/config-icl12-msvc2010-win32.py +build/config-icl12-msvc2010-win64.py \end{shell} Usually, you will not have to make any modification to this fine, but sometimes a few minor