Openmvg: running .exe problem

Created on 10 Apr 2018  ·  13Comments  ·  Source: openMVG/openMVG

I have configured openMVG for many times in different computer.
But this time there is a problem when running the program.
Giving the parameters each program need and there is always a exception.
exception

0x000000013F1F9615 处(位于 openMVG_main_SfMInit_ImageListing.exe 中)引发的异常: 0xC000001D: Illegal Instruction。
0x000000013F1F9615 处有未经处理的异常(在 openMVG_main_SfMInit_ImageListing.exe 中): 0xC000001D: Illegal Instruction。

The Chinese in picture means a exception occurred.

And each exception is in different strange places in code.
For example (the bold text is the exception line)
in openMVG_main_ComputeMatches:

int main(int argc, char **argv)
{
  CmdLine cmd;
  std::string sSfM_Data_Filename;
  std::string sMatchesDirectory = "";
  std::string sGeometricModel = "f";
  **float fDistRatio = 0.8f;**
  int iMatchingVideoMode = -1;
......

in openMVG_main_SfMInit_ImageListing:
int main(int argc, char **argv)
{
......
  std::string sPriorWeights;
  **std::pair<bool, Vec3> prior_w_info(false, Vec3(1.0,1.0,1.0));**
  int i_User_camera_model = PINHOLE_CAMERA_RADIAL3;
  bool b_Group_camera_model = true;
  int i_GPS_XYZ_method = 0;
  double focal_pixels = -1.0;
......

I do some experiment and confused to find that each "float" or "double" will cause a exception(not sure)?
I move the exception line down and see 
in openMVG_main_SfMInit_ImageListing:
int main(int argc, char **argv)
{
......
  std::string sPriorWeights;

  int i_User_camera_model = PINHOLE_CAMERA_RADIAL3;
  bool b_Group_camera_model = true;
  int i_GPS_XYZ_method = 0;
  **double focal_pixels = -1.0;**    //exception here!!!!!!!!
  std::pair<bool, Vec3> prior_w_info(false, Vec3(1.0,1.0,1.0));  **//move to here**
......

I build a empty program and use float or double with no exception.
I think my vs2015 is working.

my cmake:

Checking for C++11 compiler
Checking for C++11 compiler - available
Eigen 3.3.4 found (include: D:/openMVS/openMVG/src/third_party/eigen)
Failed to find Ceres - Found Eigen dependency, but the version of Eigen found (3.3.4) does not exactly match the version of Eigen Ceres was compiled with (3.2.10). This can cause subtle bugs by triggering violations of the One Definition Rule. See the Wikipedia article http://en.wikipedia.org/wiki/One_Definition_Rule for more details
Flann 1.8.4 found (include: D:/openMVS/openMVG/src/third_party/flann/src/cpp/flann)
CoinUtils 2.10.13 found (include: D:/openMVS/openMVG/src/dependencies/osi_clp/CoinUtils/src)
Clp 1.16.10 found (include: D:/openMVS/openMVG/src/dependencies/osi_clp/Clp/src)
Osi 0.107.8 found (include: D:/openMVS/openMVG/src/dependencies/osi_clp/Osi/src/Osi)
Lemon 1.3 found (include: D:/openMVS/openMVG/src/third_party/lemon/lemon)
Could NOT find PythonInterp (missing: PYTHON_EXECUTABLE) 
Could NOT find Wget (missing: WGET_EXECUTABLE) 
Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE) 
Could NOT find Ghostscript (missing: GHOSTSCRIPT_EXECUTABLE) 
Could NOT find GLPK (missing: GLPK_LIBRARY GLPK_INCLUDE_DIR GLPK_PROPER_VERSION_FOUND) (Required is at least version "4.33")
Could NOT find ILOG (missing: ILOG_CPLEX_LIBRARY ILOG_CPLEX_INCLUDE_DIR) 
Could NOT find COIN (missing: COIN_INCLUDE_DIR COIN_CBC_LIBRARY COIN_CBC_SOLVER_LIBRARY COIN_CGL_LIBRARY COIN_CLP_LIBRARY COIN_COIN_UTILS_LIBRARY COIN_OSI_LIBRARY COIN_OSI_CBC_LIBRARY COIN_OSI_CLP_LIBRARY) 
Could NOT find SOPLEX (missing: SOPLEX_LIBRARY SOPLEX_INCLUDE_DIR) 
CMake Warning (dev) at third_party/ceres-solver/CMakeLists.txt:40 (project):
  Policy CMP0048 is not set: project() command manages VERSION variables.
  Run "cmake --help-policy CMP0048" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.

  The following variable(s) would be set to empty:

    Ceres_VERSION
    Ceres_VERSION_MAJOR
    Ceres_VERSION_MINOR
    Ceres_VERSION_PATCH
    Ceres_VERSION_TWEAK
This warning is for project developers.  Use -Wno-dev to suppress it.


   ===============================================================
   Ceres-solver configuration.
   ===============================================================
Detected Ceres version: 1.13.0 from D:/openMVS/openMVG/src/third_party/ceres-solver/include/ceres/version.h
Eigen 3.3.4 found (include: D:/openMVS/openMVG/src/third_party/eigen)
-- Found Eigen version 3.3.4: D:/openMVS/openMVG/src/third_party/eigen

   ===============================================================
   Disabling the use of Eigen as a sparse linear algebra library.
   This does not affect the covariance estimation algorithm 
   which can still use the EIGEN_SPARSE_QR algorithm.
   ===============================================================

-- Building without LAPACK.
-- Building without SuiteSparse.
-- Found CXSparse in: ../cxsparse/Include, building with CXSparse.
-- Google Flags disabled; no tests or tools will be built!
-- Compiling minimal glog substitute into Ceres.
-- Using minimal glog substitute (include): internal/ceres/miniglog
-- Building with OpenMP.
Looking for C++ include unordered_map
Looking for C++ include unordered_map - found
Performing Test HAVE_UNORDERED_MAP_IN_STD_NAMESPACE
Performing Test HAVE_UNORDERED_MAP_IN_STD_NAMESPACE - Success
-- Found unordered_map/set in std namespace.
Looking for C++ include memory
Looking for C++ include memory - found
Performing Test HAVE_SHARED_PTR_IN_STD_NAMESPACE
Performing Test HAVE_SHARED_PTR_IN_STD_NAMESPACE - Success
-- Found shared_ptr in std namespace using <memory> header.
-- Building Ceres as a static library.
Enabling CERES_NO_LAPACK in Ceres config.h
Enabling CERES_NO_SUITESPARSE in Ceres config.h
Enabling CERES_USE_OPENMP in Ceres config.h
Enabling CERES_STD_UNORDERED_MAP in Ceres config.h
Enabling CERES_MSVC_USE_UNDERSCORE_PREFIXED_BESSEL_FUNCTIONS in Ceres config.h
-- Do not build any example.
   ===============================================================
   Ceres-solver configuration end.
   ===============================================================
CMake Warning at third_party/eigen/CMakeLists.txt:67 (message):
  EIGEN_INCLUDE_INSTALL_DIR is deprecated.  Use INCLUDE_INSTALL_DIR instead.



Configured Eigen 3.3.4

CMake Deprecation Warning at openMVG_Samples/describe_and_match_GUI/CMakeLists.txt:8 (cmake_policy):
  The OLD behavior for policy CMP0025 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.


** Found Qt5, GUI modules will be build
CMake Deprecation Warning at software/ui/SfM/control_points_registration/CMakeLists.txt:12 (cmake_policy):
  The OLD behavior for policy CMP0020 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.


Could NOT find Sphinx (missing: SPHINX_EXECUTABLE) 
Sphinx need to be installed to generate the sphinx documentation
Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE) 
Doxygen need to be installed to generate the doxygen documentation


** OpenMVG version: 1.3.0
** Build Shared libs: OFF
** Build OpenMVG tests: OFF
** Build OpenMVG softwares: ON
** Build OpenMVG documentation: ON
** Build OpenMVG samples applications: ON
** Build OpenMVG openGL examples: OFF
** Enable code coverage generation: OFF
** Enable OpenMP parallelization: ON
** Build OpenCV+OpenMVG samples programs: OFF
** Use OpenCV SIFT features: OFF


CEREAL: (internal)
EIGEN: 3.3.4 (internal)
CERES: 1.13.0 (internal)
FLANN: 1.8.4 (internal)
LIBTIFF:  (internal)
LIBPNG:  (internal)
LIBJPEG (internal)
CLP: 1.16.10 (internal)
COINUTILS: 2.10.13 (internal)
OSI: 0.107.8 (internal)
LEMON: 1.3 (internal)


Configuring done
Generating done

Most helpful comment

I order to better understand what's going on can you please tell me more about your system (CPU, OS, if your are using a VM or not)?

FYI: Those two lines enable CPU detection and trigger compiler intrinsic optimization (SSE, AVX) if your CPU can use them.

All 13 comments

I looked into your CMake file and found out some errors about Eigen.
So I am wondering which version of CMake you use and have you ever installed eigen on your computer before?

cmake:
cmake-3.11.0-rc4-win64-x64
I want to use openMVG and openMVS. OpenMVS needs eigen so I have installed it.
So the openMVG use my eigen instead of the eigen in third_party?

It will be better for openMVG to use internal version of thrid library, especially for eigen, which may lead to some unknown problems.
Maybe you can remove the installed eigen and build openMVG again.

I use openMVG intern Eigen and fail again.

@xuhuanzhimeng

  • Can you try to compile the unit test and run them?

    • In your cmake make OpenMVG_BUILD_TESTS=ON and run the target tests
  • In order to debug you can try to compile in debug and better understand the reason of the crash.

  • Can you try the develop branch to see if you still have the error?

@pmoulon
I make OpenMVG_BUILD_TESTS=ON and do ALL_BUILD and INSTALL ,finally RUN_TESTS in debug mode.
But all test failed.
1> Test project D:/openMVS/build/openMVG
1> Start 1: openMVG_test_Camera_IO
1> 1/76 Test #1: openMVG_test_Camera_IO ...................................Exception: Illegal 19.46 sec
1> Start 2: openMVG_test_Camera_Pinhole
1> 2/76 Test #2: openMVG_test_Camera_Pinhole ..............................
Exception: Illegal 5.21 sec
1> Start 3: openMVG_test_Camera_Pinhole_Radial
1> 3/76 Test #3: openMVG_test_Camera_Pinhole_Radial .......................Exception: Illegal 1.25 sec
1> Start 4: openMVG_test_Camera_Pinhole_Brown
1> 4/76 Test #4: openMVG_test_Camera_Pinhole_Brown ........................
Exception: Illegal 1.01 sec
1> Start 5: openMVG_test_Camera_Pinhole_Fisheye
1> 5/76 Test #5: openMVG_test_Camera_Pinhole_Fisheye ......................Exception: Illegal 1.42 sec
1> Start 6: openMVG_test_Camera_Spherical
1> 6/76 Test #6: openMVG_test_Camera_Spherical ............................
Exception: Illegal 0.89 sec
1> Start 7: openMVG_test_Camera_Subset_Parametrization
1> 7/76 Test #7: openMVG_test_Camera_Subset_Parametrization ...............Exception: Illegal 0.89 sec
1> Start 8: openMVG_test_exif_IO
1> 8/76 Test #8: openMVG_test_exif_IO .....................................
Exception: Illegal 2.00 sec
1> Start 9: openMVG_test_ParseDatabase
1> 9/76 Test #9: openMVG_test_ParseDatabase ...............................Exception: Illegal 0.84 sec
1> Start 10: openMVG_test_features
1> 10/76 Test #10: openMVG_test_features ....................................
Exception: Illegal 1.00 sec
......
Now I will try develop branch...

ok, please let me know what is happening with the develop branch.

The same problem again with the develop branch.
I even re-install my window7 system but still go wrong.
But I can succeed in other computer. Now I consider something wrong with my PC...

It can be due to a strange optimization from the compiler.
Can you try to comment those two lines:

AutodetectHostArchitecture()
OptimizeForArchitecture()

Here
https://github.com/openMVG/openMVG/blob/master/src/CMakeLists.txt#L111

I am amazed to find it works by comment those two lines though I don't know what those two lines means!
Thank you very much!!!
I try all kind of methods but all failed.

Thank you for helping solve this problem!!!

I order to better understand what's going on can you please tell me more about your system (CPU, OS, if your are using a VM or not)?

FYI: Those two lines enable CPU detection and trigger compiler intrinsic optimization (SSE, AVX) if your CPU can use them.

Sorry for delay.
CPU:
Intel(R) Pentium(R) CPU G2030 @ 3.00GHz 3.00 GHz
OS:
win7 64bit sp1
no VM

Thx. The auto detection should work fine.
Either way we got a fix (disable the automatic intrinsic optimization).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

glbsalazar picture glbsalazar  ·  7Comments

yonelay11 picture yonelay11  ·  5Comments

treyfortmuller picture treyfortmuller  ·  5Comments

yuancaimaiyi picture yuancaimaiyi  ·  4Comments

ghost picture ghost  ·  3Comments