OSX : update build scripts for updated openCollada libs + ray tracing optimization...
authorDamien Plisson <damien.plisson@yahoo.fr>
Sat, 30 Jan 2010 19:07:48 +0000 (19:07 +0000)
committerDamien Plisson <damien.plisson@yahoo.fr>
Sat, 30 Jan 2010 19:07:48 +0000 (19:07 +0000)
OpenCollada new version (721) lib has additional lib files to link with.

Added BF_RAY_OPTIMIZATION option in CMake (as the one in scons) for building SIMD optimized ray tracing code.

CMakeLists.txt
config/darwin-config.py
source/blender/render/CMakeLists.txt

index 71830870d03bbdc47e960af92e85d313c465327a..ccd0fcee7c23ed6c4a6b9781edb6a889f9df811d 100644 (file)
@@ -88,6 +88,8 @@ ELSE()
        OPTION(WITH_OPENMP        "Enable OpenMP (has to be supported by the compiler)" OFF)
 ENDIF()
 
+OPTION(WITH_BF_RAYOPTIMIZATION "Enable use of SIMD (SSE) optimizations for the raytracer" OFF) 
+
 IF (APPLE)
        OPTION(WITH_COCOA         "Use Cocoa framework instead of deprecated Carbon" ON)
        OPTION(USE_QTKIT          "Use QtKit instead of Carbon quicktime (needed for having partial quicktime for 64bit)" OFF)
@@ -558,7 +560,7 @@ IF(APPLE)
                SET(OPENCOLLADA ${LIBDIR}/opencollada)
                SET(OPENCOLLADA_INC ${OPENCOLLADA}/include)
                SET(OPENCOLLADA_LIBPATH ${OPENCOLLADA}/lib)
-               SET(OPENCOLLADA_LIB "OpenCOLLADASaxFrameworkLoader -lOpenCOLLADAFramework -lOpenCOLLADABaseUtils -lOpenCOLLADAStreamWriter -lMathMLSolver -lGeneratedSaxParser -lUTF -lxml2" )
+               SET(OPENCOLLADA_LIB "OpenCOLLADASaxFrameworkLoader -lOpenCOLLADAFramework -lOpenCOLLADABaseUtils -lOpenCOLLADAStreamWriter -lMathMLSolver -lGeneratedSaxParser -lUTF -lxml2 -lbuffer -lftoa" )
                #pcre is bundled with openCollada
                #SET(PCRE ${LIBDIR}/pcre)
                #SET(PCRE_LIBPATH ${PCRE}/lib)
index 53b75d455bf02551d3cb09dddfcc3f6e15c10b10..4b2d39f60fbcf75630f8457c7ffd65a6bdab7d53 100644 (file)
@@ -73,6 +73,12 @@ LIBDIR = '${LCGDIR}'
 ###################          Dependency settings           ##################
 #############################################################################
 
+#Defaults openMP to true if compiler (currently only gcc 4.2) handles it
+if CC == 'gcc-4.2':
+    WITH_BF_OPENMP = True  # multithreading for fluids, cloth and smoke
+else:
+    WITH_BF_OPENMP = False
+
 # enable ffmpeg  support
 WITH_BF_FFMPEG = True  # -DWITH_FFMPEG
 FFMPEG_PRECOMPILED = True
@@ -120,8 +126,6 @@ else:
                BF_PYTHON_LINKFLAGS = ['-u', '__dummy']+BF_PYTHON_LINKFLAGS
 
        
-WITH_BF_OPENMP = '0'  # multithreading for fluids, cloth and smoke ( only works with ICC atm )
-
 WITH_BF_OPENAL = True
 #different lib must be used  following version of gcc
 # for gcc 3.3
@@ -264,17 +268,20 @@ BF_COLLADA_INC = '${BF_COLLADA}'
 BF_COLLADA_LIB = 'bf_collada'
 BF_OPENCOLLADA = LIBDIR + '/opencollada'
 BF_OPENCOLLADA_INC = '${BF_OPENCOLLADA}/include'
-BF_OPENCOLLADA_LIB = 'OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils OpenCOLLADAStreamWriter MathMLSolver GeneratedSaxParser UTF xml2'
+BF_OPENCOLLADA_LIB = 'OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils OpenCOLLADAStreamWriter MathMLSolver GeneratedSaxParser UTF xml2 buffer ftoa'
 BF_OPENCOLLADA_LIBPATH = LIBDIR + '/opencollada'
 BF_PCRE = LIBDIR + '/opencollada'
 BF_PCRE_LIB = 'pcre'
-BF_PCRE_LIBPATH = '${BF_PCRE}/lib'
+#BF_PCRE_LIBPATH = '${BF_PCRE}/lib' #use OSX dynlib version of pcre
 #BF_EXPAT = '/usr'
 #BF_EXPAT_LIB = 'expat'
 #BF_EXPAT_LIBPATH = '/usr/lib'
 
 #Ray trace optimization
-WITH_BF_RAYOPTIMIZATION = False
+if MACOSX_ARCHITECTURE == 'x86_64' or MACOSX_ARCHITECTURE == 'i386':
+    WITH_BF_RAYOPTIMIZATION = True
+else:
+    WITH_BF_RAYOPTIMIZATION = False
 if MACOSX_ARCHITECTURE == 'i386':
     BF_RAYOPTIMIZATION_SSE_FLAGS = ['-msse']
 elif MACOSX_ARCHITECTURE == 'x86_64':
@@ -340,15 +347,9 @@ if MACOSX_ARCHITECTURE == 'x86_64':
        REL_CFLAGS = REL_CFLAGS+['-mssse3']
        REL_CCFLAGS = REL_CCFLAGS+['-mssse3']
 
-##BF_DEPEND = True
-##
-##AR = ar
-##ARFLAGS = ruv
-##ARFLAGSQUIET = ru
-##
-#C_WARN = ['-Wdeclaration-after-statement']
-
 CC_WARN = ['-Wall']
+C_WARN = ['-Wno-char-subscripts', '-Wpointer-arith', '-Wcast-align', '-Wdeclaration-after-statement', '-Wno-unknown-pragmas']
+CXX_WARN = ['-Wno-invalid-offsetof', '-Wno-sign-compare']
 
 ##FIX_STUBS_WARNINGS = -Wno-unused
 
index 40f697c7776d5859acb4e0ebb790d0e36c76e4be..c396e3fc534138173ceb548e2de4e87a2e4f743d 100644 (file)
@@ -54,6 +54,10 @@ IF(APPLE)
        ENDIF(CMAKE_OSX_ARCHITECTURES MATCHES "i386" OR CMAKE_OSX_ARCHITECTURES MATCHES "x86_64")
 ENDIF(APPLE)
 
+IF(WITH_BF_RAYOPTIMIZATION)
+       ADD_DEFINITIONS(-D__SSE__)
+ENDIF(WITH_BF_RAYOPTIMIZATION)
+
 #TODO
 #if env['OURPLATFORM']=='linux2':
 #    cflags='-pthread'