Libmv: Add an option to disable schur specializations build-time
authorSergey Sharybin <sergey.vfx@gmail.com>
Wed, 1 Oct 2014 05:59:43 +0000 (11:59 +0600)
committerSergey Sharybin <sergey.vfx@gmail.com>
Thu, 2 Oct 2014 07:01:34 +0000 (13:01 +0600)
This way folks with few ram or those who wants to hack into Ceres
code might compile Blender much faster.

CMakeLists.txt
build_files/scons/tools/btools.py
extern/libmv/third_party/ceres/CMakeLists.txt
extern/libmv/third_party/ceres/SConscript
extern/libmv/third_party/ceres/bundle.sh

index 2cabeb69e4bd43b754151468e507ff418d5e62fd..b3918214f8c4c3bda413a13d8fc5bf59c383aafb 100644 (file)
@@ -244,6 +244,7 @@ option(WITH_LZMA          "Enable best LZMA compression, (used for pointcache)"
 
 # Camera/motion tracking
 option(WITH_LIBMV         "Enable libmv structure from motion library" ON)
+option(WITH_LIBMV_SCHUR_SPECIALIZATIONS "Enable fixed-size schur specializations." ON)
 
 # Freestyle
 option(WITH_FREESTYLE     "Enable Freestyle (advanced edges rendering)" ON)
index 5a09e07b3b334ef3490dea4a585d315c942f7efa..ac3ba9b4f094fd95dc3e4c690e53a1263c13089f 100644 (file)
@@ -176,7 +176,7 @@ def validate_arguments(args, bc):
             'WITH_BF_OIIO', 'WITH_BF_STATICOIIO', 'BF_OIIO', 'BF_OIIO_INC', 'BF_OIIO_LIB', 'BF_OIIO_LIB_STATIC', 'BF_OIIO_LIBPATH',
             'WITH_BF_OCIO', 'WITH_BF_STATICOCIO', 'BF_OCIO', 'BF_OCIO_INC', 'BF_OCIO_LIB', 'BF_OCIO_LIB_STATIC', 'BF_OCIO_LIBPATH',
             'WITH_BF_BOOST', 'WITH_BF_STATICBOOST', 'BF_BOOST', 'BF_BOOST_INC', 'BF_BOOST_LIB', 'BF_BOOST_LIB_INTERNATIONAL', 'BF_BOOST_LIB_STATIC', 'BF_BOOST_LIBPATH',
-            'WITH_BF_LIBMV',
+            'WITH_BF_LIBMV', 'WITH_BF_LIBMV_SCHUR_SPECIALIZATIONS',
             'WITH_BF_CYCLES_OSL', 'WITH_BF_STATICOSL', 'BF_OSL', 'BF_OSL_INC', 'BF_OSL_LIB', 'BF_OSL_LIBPATH', 'BF_OSL_LIB_STATIC', 'BF_OSL_COMPILER',
             'WITH_BF_LLVM', 'WITH_BF_STATICLLVM', 'BF_LLVM', 'BF_LLVM_LIB', 'BF_LLVM_LIBPATH', 'BF_LLVM_LIB_STATIC', 'BF_PROGRAM_LINKFLAGS'
             ]
@@ -556,6 +556,7 @@ def read_opts(env, cfg, args):
         (BoolVariable('WITH_BF_LZMA', 'Enable best LZMA pointcache compression', True)),
 
         (BoolVariable('WITH_BF_LIBMV', 'Enable libmv structure from motion library', True)),
+        (BoolVariable('WITH_LIBMV_SCHUR_SPECIALIZATIONS', 'Enable fixed-size schur specializations', True)),
 
         (BoolVariable('WITH_BF_COMPOSITOR', 'Enable the tile based nodal compositor', True)),
     ) # end of opts.AddOptions()
index a349d3fca2695cd56b96e9f66a9a2d21072a01a2..0ca888f6393aed350e98afc3eebf35a1b2c4f4fc 100644 (file)
@@ -262,7 +262,7 @@ set(SRC
        internal/ceres/wall_time.h
 )
 
-if(TRUE)
+if(WITH_LIBMV_SCHUR_SPECIALIZATIONS)
        list(APPEND SRC
                internal/ceres/generated/partitioned_matrix_view_2_2_2.cc
                internal/ceres/generated/partitioned_matrix_view_2_2_3.cc
@@ -301,6 +301,8 @@ if(TRUE)
                internal/ceres/generated/schur_eliminator_4_4_4.cc
                internal/ceres/generated/schur_eliminator_4_4_d.cc
        )
+else()
+       add_definitions(-DCERES_RESTRICT_SCHUR_SPECIALIZATION)
 endif()
 
 if(WIN32)
index a8a50dbbf7d02578c02f8d8e9d9d4c4a21283cf0..44869c88d0bb436f931195eb150073da5783ea42 100644 (file)
@@ -13,9 +13,12 @@ src = []
 defs = []
 
 src += env.Glob('internal/ceres/*.cc')
-src += env.Glob('internal/ceres/generated/schur_eliminator_d_d_d.cc')
-src += env.Glob('internal/ceres/generated/partitioned_matrix_view_d_d_d.cc')
-src += env.Glob('internal/ceres/generated/*.cc')
+if env['WITH_BF_LIBMV_SCHUR_SPECIALIZATIONS']:
+    src += env.Glob('internal/ceres/generated/*.cc')
+else:
+    src += env.Glob('internal/ceres/generated/schur_eliminator_d_d_d.cc')
+    src += env.Glob('internal/ceres/generated/partitioned_matrix_view_d_d_d.cc')
+    defs.append('CERES_RESTRICT_SCHUR_SPECIALIZATION')
 
 defs.append('CERES_HAVE_PTHREAD')
 defs.append('CERES_NO_SUITESPARSE')
index 89b32416e229acf4c3ff8805b3d5e4b9a8fc5134..0679840e1261eb609886eb40340dc870f99e3965 100755 (executable)
@@ -138,10 +138,12 @@ ${sources}
 ${headers}
 )
 
-if(TRUE)
+if(WITH_LIBMV_SCHUR_SPECIALIZATIONS)
        list(APPEND SRC
 ${generated_sources}
        )
+else()
+       add_definitions-DCERES_RESTRICT_SCHUR_SPECIALIZATION)
 endif()
 
 if(WIN32)
@@ -214,9 +216,12 @@ src = []
 defs = []
 
 $src
-src += env.Glob('internal/ceres/generated/schur_eliminator_d_d_d.cc')
-src += env.Glob('internal/ceres/generated/partitioned_matrix_view_d_d_d.cc')
-src += env.Glob('internal/ceres/generated/*.cc')
+if env['WITH_BF_LIBMV_SCHUR_SPECIALIZATIONS']:
+    src += env.Glob('internal/ceres/generated/*.cc')
+else:
+    src += env.Glob('internal/ceres/generated/schur_eliminator_d_d_d.cc')
+    src += env.Glob('internal/ceres/generated/partitioned_matrix_view_d_d_d.cc')
+    defs.append('CERES_RESTRICT_SCHUR_SPECIALIZATION')
 
 defs.append('CERES_HAVE_PTHREAD')
 defs.append('CERES_NO_SUITESPARSE')