[Bf-blender-cvs] [e11aead] openvdb: Several fixes and cleanups to the compile process:

Kévin Dietrich noreply at git.blender.org
Mon Jun 15 13:36:00 CEST 2015


Commit: e11aead9e6a04e66d869a27437a51a95297b247d
Author: Kévin Dietrich
Date:   Mon Jun 15 13:31:05 2015 +0200
Branches: openvdb
https://developer.blender.org/rBe11aead9e6a04e66d869a27437a51a95297b247d

Several fixes and cleanups to the compile process:

- disable exceptions in tbb for cycles due to typeid usage
- cleanup SConscript in intern/openvdb, and make others align with
CMakeLists
- import fixes from gooseberry branch by sergey
- fix compilation error when cycles logging is disabled
- avoid unnecessary includes if building without openvdb

===================================================================

M	intern/cycles/CMakeLists.txt
M	intern/cycles/render/volume.cpp
M	intern/cycles/util/util_volume.h
M	intern/openvdb/CMakeLists.txt
M	intern/openvdb/SConscript
M	source/blender/blenkernel/CMakeLists.txt
M	source/blender/blenkernel/SConscript
M	source/blender/blenkernel/intern/smoke.c
M	source/blender/editors/object/CMakeLists.txt
M	source/blender/editors/object/object_modifier.c
M	source/blender/editors/space_view3d/CMakeLists.txt
M	source/blender/editors/space_view3d/SConscript
M	source/blender/editors/space_view3d/drawobject.c
M	source/blender/nodes/CMakeLists.txt
M	source/blender/nodes/SConscript
M	source/blender/nodes/shader/nodes/node_shader_openvdb.c

===================================================================

diff --git a/intern/cycles/CMakeLists.txt b/intern/cycles/CMakeLists.txt
index 6c1264f..010d1d2 100644
--- a/intern/cycles/CMakeLists.txt
+++ b/intern/cycles/CMakeLists.txt
@@ -150,6 +150,7 @@ if(WITH_OPENVDB)
 	add_definitions(-DWITH_OPENVDB)
 	add_definitions(-DOPENVDB_USE_BLOSC)
 	add_definitions(-DDWREAL_IS_DOUBLE=0)
+	add_definitions(-DTBB_USE_EXCEPTIONS=0)
 	include_directories(
 		${OPENVDB_INCLUDE_DIRS}
 	)
diff --git a/intern/cycles/render/volume.cpp b/intern/cycles/render/volume.cpp
index ea15d40..3c907e7 100644
--- a/intern/cycles/render/volume.cpp
+++ b/intern/cycles/render/volume.cpp
@@ -259,11 +259,11 @@ void VolumeManager::device_update(Device *device, DeviceScene *dscene, Scene *sc
 
 #ifdef WITH_OPENVDB
 	for(size_t i = 0; i < scalar_grids.size(); ++i) {
-		VLOG(1) << scalar_grids[i]->getName() << " memory usage: " << scalar_grids[i]->memUsage() / 1024.0f << " kilobytes.\n";
+		VLOG(1) << scalar_grids[i]->getName().c_str() << " memory usage: " << scalar_grids[i]->memUsage() / 1024.0f << " kilobytes.\n";
 	}
 
 	for(size_t i = 0; i < vector_grids.size(); ++i) {
-		VLOG(1) << vector_grids[i]->getName() << " memory usage: " << vector_grids[i]->memUsage() / 1024.0f << " kilobytes.\n";
+		VLOG(1) << vector_grids[i]->getName().c_str() << " memory usage: " << vector_grids[i]->memUsage() / 1024.0f << " kilobytes.\n";
 	}
 #endif
 
diff --git a/intern/cycles/util/util_volume.h b/intern/cycles/util/util_volume.h
index 94a6b2a..b0fcaac 100644
--- a/intern/cycles/util/util_volume.h
+++ b/intern/cycles/util/util_volume.h
@@ -1,7 +1,6 @@
 #ifndef __UTIL_VOLUME_H__
 #define __UTIL_VOLUME_H__
 
-#include "util_map.h"
 #include "util_types.h"
 
 #include "kernel_types.h"
@@ -54,6 +53,8 @@ CCL_NAMESPACE_END
 #	pragma GCC diagnostic pop
 #endif
 
+#include "util_map.h"
+
 CCL_NAMESPACE_BEGIN
 
 #if defined(HAS_CPP11_FEATURES)
diff --git a/intern/openvdb/CMakeLists.txt b/intern/openvdb/CMakeLists.txt
index f49e680..dc0c7a8 100644
--- a/intern/openvdb/CMakeLists.txt
+++ b/intern/openvdb/CMakeLists.txt
@@ -29,7 +29,7 @@ set(INC
 )
 
 set(INC_SYS
-
+	${GLEW_INCLUDE_PATH}
 )
 
 set(SRC
@@ -43,6 +43,7 @@ if(WITH_OPENVDB)
 	)
 
 	list(APPEND INC_SYS
+		${BOOST_INCLUDE_DIR}
 		${OPENEXR_INCLUDE_DIRS}
 		${OPENVDB_INCLUDE_DIRS}
 	)
diff --git a/intern/openvdb/SConscript b/intern/openvdb/SConscript
index 021c6cb..7814746 100644
--- a/intern/openvdb/SConscript
+++ b/intern/openvdb/SConscript
@@ -33,20 +33,19 @@ defs = []
 incs = [
     '.',
     'intern',
-    '../guardedalloc',
-    '../../source/blender/blenkernel',
-    '../../source/blender/blenlib',
-    '../../source/blender/makesdna',
-    '../../source/blender/makesrna',
-    env['BF_OPENVDB_INC'],
-    env['BF_BOOST_INC']
+    env['BF_GLEW_INC']
 ]
 
-incs.append(env['BF_OPENEXR_INC'].split())
+incs = ' '.join(incs)
 
 if env['WITH_BF_OPENVDB']:
     defs.append('WITH_OPENVDB')
-    defs.append('DDF_DEBUG=0')
+    defs.append('OPENVDB_USE_BLOSC')
+
+    incs += ' ' + env['BF_BOOST_INC']
+    incs += ' ' + env['BF_OPENEXR_INC']
+    incs += ' ' + env['BF_OPENVDB_INC']
+
     sources = env.Glob('*.cpp') + env.Glob('intern/*.cpp')
 
 env.BlenderLib ( libname = 'bf_intern_openvdb', sources = sources, includes = Split(incs), defines = defs, libtype=['core'], priority = [364] )
diff --git a/source/blender/blenkernel/CMakeLists.txt b/source/blender/blenkernel/CMakeLists.txt
index 59a2c72..18c2d2d 100644
--- a/source/blender/blenkernel/CMakeLists.txt
+++ b/source/blender/blenkernel/CMakeLists.txt
@@ -45,7 +45,6 @@ set(INC
 	../../../intern/iksolver/extern
 	../../../intern/memutil
 	../../../intern/mikktspace
-	../../../intern/openvdb
 	../../../intern/raskter
 	../../../intern/smoke/extern
 	../../../intern/atomic
@@ -482,6 +481,9 @@ endif()
 if(WITH_OPENVDB)
 	add_definitions(-DWITH_OPENVDB)
 	add_definitions(-DOPENVDB_USE_BLOSC)
+	list(APPEND INC
+		 ../../../intern/openvdb
+	)
 endif()
 
 ## Warnings as errors, this is too strict!
diff --git a/source/blender/blenkernel/SConscript b/source/blender/blenkernel/SConscript
index b8ce537..d0fa273 100644
--- a/source/blender/blenkernel/SConscript
+++ b/source/blender/blenkernel/SConscript
@@ -170,6 +170,7 @@ if env['WITH_BF_FREESTYLE']:
 
 if env['WITH_BF_OPENVDB']:
     defs.append('WITH_OPENVDB')
+    defs.append('OPENVDB_USE_BLOSC')
     incs += ' #/intern/openvdb'
 
 if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'):
diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c
index bd0a140..d4fc415 100644
--- a/source/blender/blenkernel/intern/smoke.c
+++ b/source/blender/blenkernel/intern/smoke.c
@@ -90,7 +90,10 @@
 /* #define USE_SMOKE_COLLISION_DM */
 
 #include "smoke_API.h"
-#include "openvdb_capi.h"
+
+#ifdef WITH_OPENVDB
+#  include "openvdb_capi.h"
+#endif
 
 #ifdef WITH_SMOKE
 
diff --git a/source/blender/editors/object/CMakeLists.txt b/source/blender/editors/object/CMakeLists.txt
index 5f24430..3c4a826 100644
--- a/source/blender/editors/object/CMakeLists.txt
+++ b/source/blender/editors/object/CMakeLists.txt
@@ -34,7 +34,6 @@ set(INC
 	../../windowmanager
 	../../../../intern/guardedalloc
 	../../../../intern/glew-mx
-	../../../../intern/openvdb
 )
 
 set(INC_SYS
@@ -79,4 +78,11 @@ if(WITH_INTERNATIONAL)
 	add_definitions(-DWITH_INTERNATIONAL)
 endif()
 
+if(WITH_OPENVDB)
+	add_definitions(-DWITH_OPENVDB)
+	list(APPEND INC
+		../../../../intern/openvdb
+	)
+endif()
+
 blender_add_lib(bf_editor_object "${SRC}" "${INC}" "${INC_SYS}")
diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c
index e72c8d2..eb751aa 100644
--- a/source/blender/editors/object/object_modifier.c
+++ b/source/blender/editors/object/object_modifier.c
@@ -93,7 +93,10 @@
 #include "WM_types.h"
 
 #include "object_intern.h"
-#include "openvdb_capi.h"
+
+#ifdef WITH_OPENVDB
+#  include "openvdb_capi.h"
+#endif
 
 static void modifier_skin_customdata_delete(struct Object *ob);
 
diff --git a/source/blender/editors/space_view3d/CMakeLists.txt b/source/blender/editors/space_view3d/CMakeLists.txt
index a9b706b..dd1c296 100644
--- a/source/blender/editors/space_view3d/CMakeLists.txt
+++ b/source/blender/editors/space_view3d/CMakeLists.txt
@@ -33,7 +33,6 @@ set(INC
 	../../depsgraph
 	../../../../intern/guardedalloc
 	../../../../intern/glew-mx
-	../../../../intern/openvdb
 	../../../../intern/smoke/extern
 )
 
@@ -92,6 +91,9 @@ endif()
 
 if(WITH_OPENVDB)
 	add_definitions(-DWITH_OPENVDB)
+	list(APPEND INC
+	     ../../../../intern/openvdb
+	)
 endif()
 
 blender_add_lib(bf_editor_space_view3d "${SRC}" "${INC}" "${INC_SYS}")
diff --git a/source/blender/editors/space_view3d/SConscript b/source/blender/editors/space_view3d/SConscript
index 78f2494..d5e36be 100644
--- a/source/blender/editors/space_view3d/SConscript
+++ b/source/blender/editors/space_view3d/SConscript
@@ -66,4 +66,8 @@ if env['WITH_BF_INTERNATIONAL']:
 if env['WITH_BF_FREESTYLE']:
     defs.append('WITH_FREESTYLE')
 
+if env['WITH_BF_OPENVDB']:
+    incs.append('#intern/openvdb')
+    defs.append('WITH_OPENVDB')
+
 env.BlenderLib ( 'bf_editors_space_view3d', sources, incs, defines = defs, libtype=['core'], priority=[40] )
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index b6c75e6..cdf8ae6 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -101,7 +101,9 @@
 #include "WM_api.h"
 #include "BLF_api.h"
 
-#include "openvdb_capi.h"
+#ifdef WITH_OPENVDB
+#  include "openvdb_capi.h"
+#endif
 
 #include "view3d_intern.h"  /* bad level include */
 
diff --git a/source/blender/nodes/CMakeLists.txt b/source/blender/nodes/CMakeLists.txt
index fd247e3..0dab257 100644
--- a/source/blender/nodes/CMakeLists.txt
+++ b/source/blender/nodes/CMakeLists.txt
@@ -39,7 +39,6 @@ set(INC
 	../render/extern/include
 	../../../intern/guardedalloc
 	../../../intern/glew-mx
-	../../../intern/openvdb
 )
 
 set(INC_SYS
@@ -292,6 +291,9 @@ endif()
 if(WITH_OPENVDB)
 	add_definitions(-DWITH_OPENVDB)
 	add_definitions(-DOPENVDB_USE_BLOSC)
+	list(APPEND INC
+	     ../../../intern/openvdb
+	)
 endif()
 
 blender_add_lib(bf_nodes "${SRC}" "${INC}" "${INC_SYS}")
diff --git a/source/blender/nodes/SConscript b/source/blender/nodes/SConscript
index d429600..a41be4b 100644
--- a/source/blender/nodes/SConscript
+++ b/source/blender/nodes/SConscript
@@ -48,7 +48,6 @@ incs = [
     '../imbuf',
     '../makesdna',
     '../makesrna',
-    '../openvdb',
     '../render/extern/include',
     env['BF_ZLIB_INC'],
     ]
diff --git a/source/blender/nodes/shader/nodes/node_shader_openvdb.c b/source/blender/nodes/shader/nodes/node_shader_openvdb.c
index ebbb64f..0b8b996 100644
--- a/source/blender/nodes/shader/nodes/node_shader_openvdb.c
+++ b/source/blender/nodes/shader/nodes/node_shader_openvdb.c
@@ -27,7 +27,9 @@
 
 #include "../node_shader_util.h"
 
-#include "openvdb_capi.h"
+#ifdef WITH_OPENVDB
+#  include "openvdb_capi.h"
+#endif
 
 static bNodeSocketTemplate sh_node_openvdb_in[] = {
     {SOCK_VECTOR, 1, N_("Vector"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_NONE, SOCK_HIDE_VALUE},




More information about the Bf-blender-cvs mailing list