diff options
Diffstat (limited to 'extern')
-rw-r--r-- | extern/bullet2/src/BulletCollision/BroadphaseCollision/btQuantizedBvh.h | 4 | ||||
-rw-r--r-- | extern/bullet2/src/BulletSoftBody/btSoftBodyConcaveCollisionAlgorithm.h | 4 | ||||
-rw-r--r-- | extern/bullet2/src/SConscript | 2 | ||||
-rw-r--r-- | extern/carve/SConscript | 2 | ||||
-rwxr-xr-x | extern/carve/bundle.sh | 2 | ||||
-rw-r--r-- | extern/carve/patches/mingw_w64.patch | 13 | ||||
-rw-r--r-- | extern/libmv/SConscript | 2 | ||||
-rwxr-xr-x | extern/libmv/bundle.sh | 2 | ||||
-rw-r--r-- | extern/libmv/libmv-capi.cpp | 7 | ||||
-rw-r--r-- | extern/libmv/libmv-capi.h | 2 | ||||
-rw-r--r-- | extern/libmv/libmv/numeric/numeric.h | 2 | ||||
-rw-r--r-- | extern/libmv/libmv/simple_pipeline/modal_solver.cc | 10 | ||||
-rw-r--r-- | extern/libmv/patches/mingw_w64_support.patch | 58 | ||||
-rw-r--r-- | extern/libmv/third_party/glog/src/windows/port.cc | 3 | ||||
-rw-r--r-- | extern/libmv/third_party/glog/src/windows/port.h | 2 |
15 files changed, 93 insertions, 22 deletions
diff --git a/extern/bullet2/src/BulletCollision/BroadphaseCollision/btQuantizedBvh.h b/extern/bullet2/src/BulletCollision/BroadphaseCollision/btQuantizedBvh.h index aa30d43a025..51b27afe686 100644 --- a/extern/bullet2/src/BulletCollision/BroadphaseCollision/btQuantizedBvh.h +++ b/extern/bullet2/src/BulletCollision/BroadphaseCollision/btQuantizedBvh.h @@ -78,8 +78,10 @@ ATTRIBUTE_ALIGNED16 (struct) btQuantizedBvhNode int getTriangleIndex() const { btAssert(isLeafNode()); + unsigned int x=0; + unsigned int y = (~(x&0))<<(31-MAX_NUM_PARTS_IN_BITS); // Get only the lower bits where the triangle index is stored - return (m_escapeIndexOrTriangleIndex&~((~0)<<(31-MAX_NUM_PARTS_IN_BITS))); + return (m_escapeIndexOrTriangleIndex&~(y)); } int getPartId() const { diff --git a/extern/bullet2/src/BulletSoftBody/btSoftBodyConcaveCollisionAlgorithm.h b/extern/bullet2/src/BulletSoftBody/btSoftBodyConcaveCollisionAlgorithm.h index a6ea33717bc..f311419d4a8 100644 --- a/extern/bullet2/src/BulletSoftBody/btSoftBodyConcaveCollisionAlgorithm.h +++ b/extern/bullet2/src/BulletSoftBody/btSoftBodyConcaveCollisionAlgorithm.h @@ -45,7 +45,9 @@ struct btTriIndex int getTriangleIndex() const { // Get only the lower bits where the triangle index is stored - return (m_PartIdTriangleIndex&~((~0)<<(31-MAX_NUM_PARTS_IN_BITS))); + unsigned int x = 0; + unsigned int y = (~(x&0))<<(31-MAX_NUM_PARTS_IN_BITS); + return (m_PartIdTriangleIndex&~(y)); } int getPartId() const { diff --git a/extern/bullet2/src/SConscript b/extern/bullet2/src/SConscript index fa00ad7bc2e..f59bcba9fa6 100644 --- a/extern/bullet2/src/SConscript +++ b/extern/bullet2/src/SConscript @@ -11,7 +11,7 @@ if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'): defs += ' WIN32 NDEBUG _WINDOWS' #cflags += ['/MT', '/W3', '/GX', '/O2', '/Op'] cflags += ['/MT', '/W3', '/GX', '/Og', '/Ot', '/Ob1', '/Op', '/G6', '/O3', '/EHcs'] -elif env['OURPLATFORM'] in ('win32-mingw', 'linuxcross'): +elif env['OURPLATFORM'] in ('win32-mingw', 'linuxcross', 'win64-mingw'): defs += ' NDEBUG' cflags += ['-O2'] elif env['OURPLATFORM'] in ('linux', 'freebsd4', 'freebsd5'): diff --git a/extern/carve/SConscript b/extern/carve/SConscript index e2f3c814e2e..1ba67e51327 100644 --- a/extern/carve/SConscript +++ b/extern/carve/SConscript @@ -14,7 +14,7 @@ incs = ['include'] if env['WITH_BF_BOOST']: if env['OURPLATFORM'] not in ('win32-vc', 'win64-vc'): # Boost is setting as preferred collections library in the Carve code when using MSVC compiler - if env['OURPLATFORM'] != 'win32-mingw': + if env['OURPLATFORM'] not in ('win32-mingw', 'win64-mingw'): defs.append('HAVE_BOOST_UNORDERED_COLLECTIONS') defs.append('CARVE_SYSTEM_BOOST') diff --git a/extern/carve/bundle.sh b/extern/carve/bundle.sh index e68b2c7e90e..881367fe687 100755 --- a/extern/carve/bundle.sh +++ b/extern/carve/bundle.sh @@ -114,7 +114,7 @@ incs = ['include'] if env['WITH_BF_BOOST']: if env['OURPLATFORM'] not in ('win32-vc', 'win64-vc'): # Boost is setting as preferred collections library in the Carve code when using MSVC compiler - if env['OURPLATFORM'] != 'win32-mingw': + if env['OURPLATFORM'] not in ('win32-mingw', 'win64-mingw'): defs.append('HAVE_BOOST_UNORDERED_COLLECTIONS') defs.append('CARVE_SYSTEM_BOOST') diff --git a/extern/carve/patches/mingw_w64.patch b/extern/carve/patches/mingw_w64.patch new file mode 100644 index 00000000000..26a30be84c3 --- /dev/null +++ b/extern/carve/patches/mingw_w64.patch @@ -0,0 +1,13 @@ +Index: bundle.sh +=================================================================== +--- bundle.sh (revision 45912) ++++ bundle.sh (working copy) +@@ -114,7 +114,7 @@ + if env['WITH_BF_BOOST']: + if env['OURPLATFORM'] not in ('win32-vc', 'win64-vc'): + # Boost is setting as preferred collections library in the Carve code when using MSVC compiler +- if env['OURPLATFORM'] != 'win32-mingw': ++ if env['OURPLATFORM'] not in ('win32-mingw', 'win64-mingw'): + defs.append('HAVE_BOOST_UNORDERED_COLLECTIONS') + + defs.append('CARVE_SYSTEM_BOOST') diff --git a/extern/libmv/SConscript b/extern/libmv/SConscript index fbcd92503d8..fbb6ee36f85 100644 --- a/extern/libmv/SConscript +++ b/extern/libmv/SConscript @@ -34,7 +34,7 @@ incs = '. ../Eigen3' incs += ' ' + env['BF_PNG_INC'] incs += ' ' + env['BF_ZLIB_INC'] -if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'): +if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'): incs += ' ./third_party/glog/src/windows ./third_party/glog/src/windows/glog' if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'): incs += ' ./third_party/msinttypes' diff --git a/extern/libmv/bundle.sh b/extern/libmv/bundle.sh index a34e45a38b0..30d08cd680a 100755 --- a/extern/libmv/bundle.sh +++ b/extern/libmv/bundle.sh @@ -248,7 +248,7 @@ incs = '. ../Eigen3' incs += ' ' + env['BF_PNG_INC'] incs += ' ' + env['BF_ZLIB_INC'] -if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'): +if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'): incs += ' ./third_party/glog/src/windows ./third_party/glog/src/windows/glog' if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'): incs += ' ./third_party/msinttypes' diff --git a/extern/libmv/libmv-capi.cpp b/extern/libmv/libmv-capi.cpp index 3f697d487b6..6c20d76eeac 100644 --- a/extern/libmv/libmv-capi.cpp +++ b/extern/libmv/libmv-capi.cpp @@ -460,7 +460,7 @@ libmv_Reconstruction *libmv_solveReconstruction(libmv_Tracks *tracks, int keyfra return (libmv_Reconstruction *)libmv_reconstruction; } -struct libmv_Reconstruction *libmv_solveModal(struct libmv_Tracks *tracks, int refine_intrinsics, double focal_length, +struct libmv_Reconstruction *libmv_solveModal(struct libmv_Tracks *tracks, double focal_length, double principal_x, double principal_y, double k1, double k2, double k3, reconstruct_progress_update_cb progress_update_callback, void *callback_customdata) { @@ -488,11 +488,6 @@ struct libmv_Reconstruction *libmv_solveModal(struct libmv_Tracks *tracks, int r libmv::ModalSolver(normalized_tracks, reconstruction, &update_callback); - if (refine_intrinsics) { - libmv_solveRefineIntrinsics((libmv::Tracks *)tracks, intrinsics, reconstruction, - refine_intrinsics, progress_update_callback, callback_customdata); - } - progress_update_callback(callback_customdata, 1.0, "Finishing solution"); libmv_reconstruction->tracks = *(libmv::Tracks *)tracks; libmv_reconstruction->error = libmv::EuclideanReprojectionError(*(libmv::Tracks *)tracks, *reconstruction, *intrinsics); diff --git a/extern/libmv/libmv-capi.h b/extern/libmv/libmv-capi.h index f72a72d494b..bccc4706832 100644 --- a/extern/libmv/libmv-capi.h +++ b/extern/libmv/libmv-capi.h @@ -68,7 +68,7 @@ int libmv_refineParametersAreValid(int parameters); struct libmv_Reconstruction *libmv_solveReconstruction(struct libmv_Tracks *tracks, int keyframe1, int keyframe2, int refine_intrinsics, double focal_length, double principal_x, double principal_y, double k1, double k2, double k3, reconstruct_progress_update_cb progress_update_callback, void *callback_customdata); -struct libmv_Reconstruction *libmv_solveModal(struct libmv_Tracks *tracks, int refine_intrinsics, double focal_length, +struct libmv_Reconstruction *libmv_solveModal(struct libmv_Tracks *tracks, double focal_length, double principal_x, double principal_y, double k1, double k2, double k3, reconstruct_progress_update_cb progress_update_callback, void *callback_customdata); int libmv_reporojectionPointForTrack(struct libmv_Reconstruction *libmv_reconstruction, int track, double pos[3]); diff --git a/extern/libmv/libmv/numeric/numeric.h b/extern/libmv/libmv/numeric/numeric.h index ad707fb76f2..d2cadf4b579 100644 --- a/extern/libmv/libmv/numeric/numeric.h +++ b/extern/libmv/libmv/numeric/numeric.h @@ -33,7 +33,7 @@ #include <Eigen/QR> #include <Eigen/SVD> -#if _WIN32 || __APPLE__ || __FreeBSD__ +#if (defined(_WIN32) || defined(__APPLE__) || defined(__FreeBSD__)) && !defined(__MINGW64__) void static sincos (double x, double *sinx, double *cosx) { *sinx = sin(x); *cosx = cos(x); diff --git a/extern/libmv/libmv/simple_pipeline/modal_solver.cc b/extern/libmv/libmv/simple_pipeline/modal_solver.cc index ede0071dc64..bb49b30dbce 100644 --- a/extern/libmv/libmv/simple_pipeline/modal_solver.cc +++ b/extern/libmv/libmv/simple_pipeline/modal_solver.cc @@ -91,19 +91,15 @@ void ModalSolver(Tracks &tracks, ProjectMarkerOnSphere(marker, X); - points.push_back(R * point->X); + points.push_back(point->X); reference_points.push_back(X); } } } if (points.size()) { - Mat3 dR = Mat3::Identity(); - - // Find rigid delta transformation from previous image to current image - RigidRegistration(reference_points, points, dR); - - R *= dR; + // Find rigid delta transformation to current image + RigidRegistration(reference_points, points, R); } reconstruction->InsertCamera(image, R, Vec3::Zero()); diff --git a/extern/libmv/patches/mingw_w64_support.patch b/extern/libmv/patches/mingw_w64_support.patch new file mode 100644 index 00000000000..360287e81c2 --- /dev/null +++ b/extern/libmv/patches/mingw_w64_support.patch @@ -0,0 +1,58 @@ +Index: bundle.sh +=================================================================== +--- bundle.sh (revision 45912) ++++ bundle.sh (working copy) +@@ -248,7 +248,7 @@ + incs += ' ' + env['BF_PNG_INC'] + incs += ' ' + env['BF_ZLIB_INC'] + +-if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'): ++if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'): + incs += ' ./third_party/glog/src/windows ./third_party/glog/src/windows/glog' + if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'): + incs += ' ./third_party/msinttypes' +Index: libmv/numeric/numeric.h +=================================================================== +--- libmv/numeric/numeric.h (revision 45912) ++++ libmv/numeric/numeric.h (working copy) +@@ -33,7 +33,7 @@ + #include <Eigen/QR> + #include <Eigen/SVD> + +-#if _WIN32 || __APPLE__ || __FreeBSD__ ++#if (defined(_WIN32) || defined(__APPLE__) || defined(__FreeBSD__)) && !defined(__MINGW64__) + void static sincos (double x, double *sinx, double *cosx) { + *sinx = sin(x); + *cosx = cos(x); +Index: third_party/glog/src/windows/port.cc +=================================================================== +--- third_party/glog/src/windows/port.cc (revision 45912) ++++ third_party/glog/src/windows/port.cc (working copy) +@@ -55,6 +55,8 @@ + return _vsnprintf(str, size-1, format, ap); + } + ++// MinGW64 defines ++#ifndef __MINGW64__ + int snprintf(char *str, size_t size, const char *format, ...) { + va_list ap; + va_start(ap, format); +@@ -62,3 +64,4 @@ + va_end(ap); + return r; + } ++#endif +Index: third_party/glog/src/windows/port.h +=================================================================== +--- third_party/glog/src/windows/port.h (revision 45912) ++++ third_party/glog/src/windows/port.h (working copy) +@@ -120,7 +120,9 @@ + #define DEFAULT_TEMPLATE_ROOTDIR ".." + + // ----------------------------------- SYSTEM/PROCESS ++#ifndef __MINGW64__ + typedef int pid_t; ++#endif + #define getpid _getpid + + // ----------------------------------- THREADS diff --git a/extern/libmv/third_party/glog/src/windows/port.cc b/extern/libmv/third_party/glog/src/windows/port.cc index bfa6e70afbb..58e28b026c0 100644 --- a/extern/libmv/third_party/glog/src/windows/port.cc +++ b/extern/libmv/third_party/glog/src/windows/port.cc @@ -55,6 +55,8 @@ int safe_vsnprintf(char *str, size_t size, const char *format, va_list ap) { return _vsnprintf(str, size-1, format, ap); } +// MinGW64 defines +#ifndef __MINGW64__ int snprintf(char *str, size_t size, const char *format, ...) { va_list ap; va_start(ap, format); @@ -62,3 +64,4 @@ int snprintf(char *str, size_t size, const char *format, ...) { va_end(ap); return r; } +#endif diff --git a/extern/libmv/third_party/glog/src/windows/port.h b/extern/libmv/third_party/glog/src/windows/port.h index abfcf65384c..72e3906f82f 100644 --- a/extern/libmv/third_party/glog/src/windows/port.h +++ b/extern/libmv/third_party/glog/src/windows/port.h @@ -120,7 +120,9 @@ extern int safe_vsnprintf(char *str, size_t size, #define DEFAULT_TEMPLATE_ROOTDIR ".." // ----------------------------------- SYSTEM/PROCESS +#ifndef __MINGW64__ typedef int pid_t; +#endif #define getpid _getpid // ----------------------------------- THREADS |