diff --git a/CMakeLists.txt b/CMakeLists.txt index 8fc19fe0..9660f557 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,31 +27,32 @@ ELSE() ENDIF() IF(MSVC) - add_compile_options(/wd4514 /wd4267 $<$:/bigobj>) + add_compile_options(/wd4514 /wd4267 /bigobj) + add_definitions(-D_USE_MATH_DEFINES) ELSE() IF (CMAKE_SYSTEM_PROCESSOR MATCHES "(arm64)|(ARM64)|(aarch64)|(AARCH64)") - add_definitions (-Wall -march=armv8-a -O3) + add_definitions (-march=armv8-a) ELSEIF (CMAKE_SYSTEM_PROCESSOR MATCHES "(arm)|(ARM)|(armhf)|(ARMHF)|(armel)|(ARMEL)") - add_definitions (-Wall -march=armv7-a -O3) + add_definitions (-march=armv7-a) ELSE () - add_definitions (-Wall -march=native -O3) #TODO use correct c++11 def once everybody has moved to gcc 4.7 # for now I even removed std=gnu++0x + add_definitions (-march=native) #TODO use correct c++11 def once everybody has moved to gcc 4.7 # for now I even removed std=gnu++0x ENDIF() + add_definitions ( + -O3 + -Wall + -Wextra + #-Werror + -Wwrite-strings + -Wno-unused-parameter + -fno-strict-aliasing + ) ENDIF() IF(BUILD_POSITION_INDEPENDENT_CODE) add_definitions( -fPIC ) ENDIF() -ADD_DEFINITIONS ( --Wall --Wextra -#-Werror --Wwrite-strings --Wno-unused-parameter --fno-strict-aliasing -) - set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/modules/") find_package(Eigen REQUIRED) set(ADDITIONAL_INCLUDE_DIRS ${EIGEN_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIR}/unsupported) diff --git a/src/absolute_pose/modules/main.cpp b/src/absolute_pose/modules/main.cpp index 7cff9f69..ed0c271a 100644 --- a/src/absolute_pose/modules/main.cpp +++ b/src/absolute_pose/modules/main.cpp @@ -770,7 +770,7 @@ opengv::absolute_pose::modules::upnp_main( { Eigen::Matrix s; upnp_fill_s(quaternion,s); - Eigen::Matrix valueM = s.transpose() * M * s + 2.0 * C * s; + Eigen::Matrix valueM = s.transpose() * M * s + C * s * 2.0; double value = valueM[0] + gamma; std::vector,Eigen::aligned_allocator< std::pair > >::iterator diff --git a/src/math/roots.cpp b/src/math/roots.cpp index f87eb79d..c31b27cf 100644 --- a/src/math/roots.cpp +++ b/src/math/roots.cpp @@ -31,6 +31,7 @@ #include #include +#include std::vector opengv::math::o3_roots( const std::vector & p )