Ceres Solver project generated without error but Visual Studio build fails

613 views
Skip to first unread message

Max

unread,
Oct 31, 2018, 10:07:21 AM10/31/18
to Ceres Solver
I am trying to install Ceres Solver on Windows 64 bit, any format that works would be fine for me but the Visual Studio project for building Ceres fails. Can anyone give me a clue as to where things have gone wrong? I have looked for someone with a similar issue on this group and looked at the error messages but I can't make any progress from here. Here is the Cmake file for the configuration:

"Selecting Windows SDK version to target Windows 10.0.17134.

Detected Ceres version: 1.14.0 from C:/ceres/ceres/include/ceres/version.h

No preference for use of exported Eigen CMake configuration set, and no hints for include directory provided. Defaulting to preferring an installed/exported Eigen CMake configuration if available.

Failed to find installed Eigen CMake configuration, searching for Eigen build directories exported with CMake.

Failed to find an installed/exported CMake configuration for Eigen, will perform search for installed Eigen components.

-- Found Eigen version 3.3.5: C:\ceres\eigen

-- Enabling use of Eigen as a sparse linear algebra library.

-- Building without LAPACK.

-- Building without SuiteSparse.

-- Building without CXSparse.

-- Google Flags disabled; no tests or tools will be built!

No preference for use of exported glog CMake configuration set, and no hints for include/library directories provided. Defaulting to preferring an installed/exported glog CMake configuration if available.

Found installed version of glog: C:/Users/mboul/Documents/Maxime/Documents/WorkProjects/Bassem-Projects/SpectrumStudy/Spectrum-Quantitativ-Study/Dialog-ALS-SIMPLISM-MFC-NN/Dialog-ALS-SIMPLISM-MFC/Ceres/glog

Detected glog version: 0.3.5

-- Found Google Log (glog). Assuming glog was NOT built with gflags support as gflags was not found. If glog was built with gflags, please set the gflags search locations such that it can be found by Ceres. Otherwise, Ceres may fail to link due to missing gflags symbols.

-- 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.

Performing Test CXX11_MATH_FUNCTIONS_FOUND

Performing Test CXX11_MATH_FUNCTIONS_FOUND - Success

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

Compiling Ceres using C++11. This will result in a version

of Ceres that will require the use of C++11 in client code.

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

-- Building Ceres as a static library.

Enabling CERES_USE_EIGEN_SPARSE in Ceres config.h

Enabling CERES_NO_LAPACK in Ceres config.h

Enabling CERES_NO_SUITESPARSE in Ceres config.h

Enabling CERES_NO_CXSPARSE in Ceres config.h

Enabling CERES_USE_CXX11 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

-- Build the examples.

Configuring done

Generating done"


And here are some FAILED notices that pop up when I try to build:


"5>                         BeforeClean;
7>                                   AdditionalDependencies=..\lib\Debug\ceres-debug.lib;C:\Users\mboul\Documents\Maxime\Documents\WorkProjects\Bassem-Projects\SpectrumStudy\Spectrum-Quantitativ-Study\Dialog-ALS-SIMPLISM-MFC-NN\Dialog-ALS-SIMPLISM-MFC\Ceres\glog\Debug\glogd.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;comdlg32.lib;advapi32.lib
9>Done building target "Link" in project "helloworld_analytic_diff.vcxproj" -- FAILED.: (TargetId:81)"


"OriginalItemSpec=C:\ceres\ceres\builddir\internal\ceres\ceres.vcxproj
6>                   CurrentSolutionConfigurationContents = <SolutionConfiguration>
9>Build FAILED."


"PSModulePath = C:\Program Files\WindowsPowerShell\Modules;C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules
7>Build FAILED."


"Task "VCMessage" skipped, due to false condition; ('$(DesignTimeBuild)'!='true' and '$(VCInstallDir)'=='' and '$(UseEnv)' != 'true' and ('$(TargetFrameworkVersion)'=='v3.5' or '$(TargetFrameworkVersion)'=='v3.0' or '$(TargetFrameworkVersion)'=='v2.0' )) was evaluated as (''!='true' and 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\'=='' and '' != 'true' and ('v4.0'=='v3.5' or 'v4.0'=='v3.0' or 'v4.0'=='v2.0' )).
6>Done building target "Link" in project "curve_fitting_c.vcxproj" -- FAILED.: (TargetId:81)"


"Done building target "Link" in project "curve_fitting.vcxproj" -- FAILED.: (TargetId:241)"


… 


Resulting in:


"16>------ Skipped Build: Project: INSTALL, Configuration: Debug Win32 ------
16>Project not selected to build for this solution configuration
========== Build: 3 succeeded, 10 failed, 0 up-to-date, 3 skipped =========="



Alex Stewart

unread,
Nov 1, 2018, 1:51:30 PM11/1/18
to ceres-...@googlegroups.com
What are the actual build errors?  The summaries you posted don’t show what the error is, merely that something failed.

-Alex

--
You received this message because you are subscribed to the Google Groups "Ceres Solver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ceres-solver...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ceres-solver/51d535fc-eccc-4004-9f0f-3a9d2b90d92f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

haleh mohammadion

unread,
Nov 2, 2018, 8:18:36 AM11/2/18
to Ceres Solver
Did you resolve this problem ? today I had the problem the same as you , I work my whole day to resolve this issue.

haleh mohammadion

unread,
Nov 2, 2018, 8:21:54 AM11/2/18
to Ceres Solver
 First you didn't configure with CMAKE successfully since there is 

- Found Google Log (glog). Assuming glog was NOT built with gflags support as gflags was not found. If glog was built with gflags, please set the gflags search locations such that it can be found by Ceres. Otherwise, Ceres may fail to link due to missing gflags symbols.

it means that it couldn't find the gflag successfully in order to resolve this issue , it is better to built gflag before glog , then it will automatically be set .

Max

unread,
Nov 26, 2018, 5:39:59 PM11/26/18
to ceres-...@googlegroups.com
Hello,

I am coming back to this issue after a while as I had to move on to work on another project after being blocked on this for too long. I tried building gflags before glog but I still got the same error, I also tried setting search locations but nothing could do it.

After a while, I moved on to installing the Microsoft Visual Studio wrapper for Ceres Solver by Tal Ben-Nun,  which is mentioned as an easier alternative. When trying to build the solution I first got some errors about it not being able to find the Eigen files, apparently they weren't missing in the ceres_windows folder so I simply added them and it built without error. However, when I copied the simple introductory example from the tutorial I get an error. When I call the Solve function, I get the Debug Assertion Failed error with Expression " _Count <= (size_t)(-1) / _Sz" && 0. Have you ever encountered this problem? Before getting to there I had to add a #define NOGDI line somewhere, I wonder if it has something to do with that, and that basically I didn't resolve the glog issue with window.h correctly.

--
You received this message because you are subscribed to the Google Groups "Ceres Solver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ceres-solver...@googlegroups.com.

haleh mohammadion

unread,
Nov 26, 2018, 9:22:24 PM11/26/18
to Ceres Solver
No , I didn't have this error , and I have not worked with Microsoft Visual Studio wrapper for Ceres, in my case at first I will install gflag easily and successfully then I install glog , glog asks for Eigen and I set eigen directory and I use new version of eigen 3.3.5 , glog doesn't work with old version of eigen and I will change installation path to the short path address since sometimes I encounter with the error that it will say path is too long. you should be sure that glog is installed successfully since if it is not built correctly , you cannot work with google ceres . after building and compiling glog successfully , I will install ceres easily and then I use CmakeLists.txt that ceres website provided to link my project with ceres. if you are doing these steps and your problem is not resolved , report your complete error here. I hope this resolve your issue.
Message has been deleted

CAI Jianping

unread,
Nov 27, 2018, 10:37:39 AM11/27/18
to Ceres Solver

Hi Max,


I think you can try to install ceres solver using vcpkg, which is quite convenient. 
Just use the command: vcpkg install ceres:x64-windows, and it will take care everything for you.

Max

unread,
Nov 29, 2018, 10:42:19 AM11/29/18
to ceres-...@googlegroups.com
Hello CAI,

I have tried using vckpg, unfortunately it went very smooth and easy up to using the command, but vckpg had an issue building gflags:

Error: Building package gflags:x64-windows failed with: BUILD_FAILED
Please ensure you're using the latest portfiles with `.\vcpkg update`, then
submit an issue at https://github.com/Microsoft/vcpkg/issues including:
  Package: gflags:x64-windows
  Vcpkg version: 2018.11.23-nohash

I have tried looking up the issue for a fix but so far no luck, I will keep looking for a way to fix this. Very unfortunate as otherwise vcpkg does make the otherwise complicated installation of Ceres much easier.

--
You received this message because you are subscribed to the Google Groups "Ceres Solver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ceres-solver...@googlegroups.com.

CAI Jianping

unread,
Dec 1, 2018, 2:41:41 AM12/1/18
to Ceres Solver
Hi Max,

It is weird that you had a error with gflags. I did not have any issue with installation via vcpkg. 
I did a re-installation, and still worked. 
Good luck. 

c:\vcpkg\vcpkg>vcpkg list gflags
gflags:x64-windows                                 2.2.1-3          A C++ library that implements commandline flags ...
gflags:x86-windows                                 2.2.1-3          A C++ library that implements commandline flags ...

c:\vcpkg\vcpkg>vcpkg list ceres
ceres:x64-windows                                  1.14.0-1         non-linear optimization package
ceres:x86-windows                                  1.14.0-1         non-linear optimization package
Reply all
Reply to author
Forward
0 new messages