Linking to SuiteSparse on Windows

111 views
Skip to first unread message

Arturo Flores

unread,
May 4, 2016, 7:01:58 PM5/4/16
to Ceres Solver
I am still having trouble building ceres on windows with suitesparse.  I have a few unanswered posts from the past few days.  I've made some progress but still not quite there.

Some details of my environment:
* Windows 7 (64 bit)
* Visual Studio 2012 (64 bit build)
* cmake 3.0.0

I am able to succesfully build (using cmake) the dependencies: gflag, glog, gtest, suitesparse-metis .

I am using suitesparse from https://github.com/jlblancoc/suitesparse-metis-for-windows .  From the instructions in the readme.md file, I copied their FindsuiteSparse.cmake and replaced the FindSuiteSparse.cmake file that comes with ceres-solver .  I also modified ceres-solver's CMakeLists.txt file and removed the section that tries to find lapack and blas.  I also replaced the snippet of code to find SuiteSparse with the snippet provided in SuiteSparse's readme.md file ( section 3. Integration in your code ).

With the changes mentioned above cmake is able to find all the required libraries.  However, it does not set a variable or #define that some of the ceres-solver code is expecting: I now get an error when attempting to build ceres:

solver_utils.cc(57): error C2065: 'CERES_SUITESPARSE_VERSION' : undeclared identifier


Has anyone had success building ceres on windows with suitesparse?  Any suggestions on how to proceed would be greatly appreciated.

I have taken a look at the solution file here https://github.com/tbennun/ceres-windows .  My only concern with this one is it does not include any of the tests so you cannot verify if the build.

Arturo

hwdo...@gmail.com

unread,
Apr 18, 2017, 4:49:15 AM4/18/17
to Ceres Solver
You can add this line to CMakelist.txt:
          add_definitions(-DSUITESPARSE_VERSION ${SUITESPARSE_VERSION})
Reply all
Reply to author
Forward
0 new messages