Download Solver For Mac

Getting the source code¶

  1. Feb 22, 2021 Download EES (64 bit) Engineering Equation Solver for free. EES (64 bit) Engineering Equation Solver - EES (pronounced 'ease') is a general equation-solving program that can numerically solve thousands of coupled non-linear algebraic and differential equations.
  2. This was added only for the benefit of Mac users who try to load this version on their Mac (as many have done). Windows users can ignore this message. O For Solver that ships with Excel 2016 for Windows: SolverTable 2016.zip ¨ This version is basically the same as the 2013 version.
  3. Mar 28, 2017 Mac (OS 10.13 High Sierra to 10.9 Mavericks) Intel Last update: Aug 6, 2021 v2.5 (2509) These are free downloads for personal use. Across Lite Crosswords v4.1 for the iPad.

Download this app from Microsoft Store for Windows 10, Windows 8.1. See screenshots, read the latest customer reviews, and compare ratings for Math Solver. Download Sudoku Solver for Mac to play Sudoku puzzles while enforcing strategy.

You can start with the latest stable release . Or if you wantthe latest version, you can clone the git repository

Dependencies¶

Note

Starting with v2.0 Ceres requires a fully C++14-compliantcompiler. In versions <= 1.14, C++11 was an optional requirement.

Ceres relies on a number of open source libraries, some of which areoptional. For details on customizing the build process, seeCustomizing the build .

  • Eigen3.3 or later required.

    Note

    Ceres can also use Eigen as a sparse linear algebralibrary. Please see the documentation for EIGENSPARSE formore details.

  • CMake 3.5 or later required.

  • glog 0.3.1 orlater. Recommended

    glog is used extensively throughout Ceres for logging detailedinformation about memory allocations and time consumed in variousparts of the solve, internal error conditions etc. The Ceresdevelopers use it extensively to observe and analyze Ceres’sperformance. glog allows you tocontrol its behaviour from the command line. Starting with-logtostderr you can add -v=N for increasing values of Nto get more and more verbose and detailed information about Ceresinternals.

    Ceres also ships with a minimal replacement of glog calledminiglog that can be enabled with the MINIGLOG build option.miniglog is supplied for platforms which do not support the fullversion of glog.

    In an attempt to reduce dependencies, it may be tempting to useminiglog on platforms which already support glog. Whilethere is nothing preventing the user from doing so, we stronglyrecommend against it. miniglog has worse performance thanglog and is much harder to control and use.

    Note

    If you are compiling glog from source, please note thatcurrently, the unit tests for glog (which are enabled bydefault) do not compile against a default build of gflags 2.1as the gflags namespace changed from google:: togflags::. A patch to fix this is available from here.

  • gflags. Needed to buildexamples and tests and usually a dependency for glog.

  • SuiteSparse. Needed forsolving large sparse linear systems. Optional; strongly recomendedfor large scale bundle adjustment

    Note

    If SuiteSparseQR is found, Ceres attempts to find the IntelThread Building Blocks (TBB) library. If found, Ceres assumesSuiteSparseQR was compiled with TBB support and will link to thefound TBB version. You can customize the searched TBB locationwith the TBB_ROOT variable.

  • CXSparse.Similar to SuiteSparse but simpler and slower. CXSparse hasno dependencies on LAPACK and BLAS. This makes for a simplerbuild process and a smaller binary. Optional

  • Apple’s Accelerate sparse solvers.As of Xcode 9.0, Apple’s Accelerate framework includes support forsolving sparse linear systems across macOS, iOS et al. Optional

  • BLAS and LAPACK routines are needed bySuiteSparse, and optionally used by Ceres directly for someoperations.

    On UNIX OSes other than macOS we recommend ATLAS, which includes BLAS andLAPACK routines. It is also possible to use OpenBLAS . However, one needs to becareful to turn off the threadinginside OpenBLAS as it conflicts with use of threads in Ceres.

    MacOS ships with an optimized LAPACK and BLASimplementation as part of the Accelerate framework. The Ceresbuild system will automatically detect and use it.

    For Windows things are much more complicated. LAPACK ForWindowshas detailed instructions..

    Optional but required forSuiteSparse.

Linux¶

We will use Ubuntu as our example linuxdistribution.

Note

These instructions are for Ubuntu 18.04 and newer. On Ubuntu 16.04you need to manually get a more recent version of Eigen, such as3.3.7.

Start by installing all the dependencies.

We are now ready to build, test, and install Ceres.

You can also try running the command line bundling application with one of theincluded problems, which comes from the University of Washington’s BALdataset [Agarwal].

This runs Ceres for a maximum of 10 iterations using theDENSE_SCHUR linear solver. The output should look something likethis.

macOS¶

On macOS, you can either use Homebrew (recommended) or MacPorts to install Ceres Solver.

If using Homebrew, then

will install the latest stable version along with all the requireddependencies and

will install the latest version in the git repo.

If using MacPorts, then

will install the latest version.

You can also install each of the dependencies by hand using Homebrew. There is no need to installBLAS or LAPACK separately as macOS ships with optimizedBLAS and LAPACK routines as part of the vecLibframework.

We are now ready to build, test, and install Ceres.

Building with OpenMP on macOS¶

Up to at least Xcode 12, OpenMP support was disabled in Apple’s version ofClang. However, you can install the latest version of the LLVM toolchainfrom Homebrew which does support OpenMP, and thus build Ceres with OpenMPsupport on macOS. To do this, you must install llvm via Homebrew:

As the LLVM formula in Homebrew is keg-only, it will not be installed to/usr/local to avoid conflicts with the standard Apple LLVM toolchain.To build Ceres with the Homebrew LLVM toolchain you should do thefollowing:

Like the Linux build, you should now be able to runbin/simple_bundle_adjuster.

Windows¶

Note

If you find the following CMake difficult to set up, then you maybe interested in a Microsoft Visual Studio wrapper for Ceres Solver by TalBen-Nun.

On Windows, we support building with Visual Studio 2015.2 of newer. Notethat the Windows port is less featureful and less tested than theLinux or macOS versions due to the lack of an officially supportedway of building SuiteSparse and CXSparse. There are however a numberof unofficial ways of building these libraries. Building on Windowsalso a bit more involved since there is no automated way to installdependencies.

Note

Using google-glog & miniglog with windows.h.

The windows.h header if used with GDI (Graphics Device Interface)defines ERROR, which conflicts with the definition of ERRORas a LogSeverity level in google-glog and miniglog. Thereare at least two possible fixes to this problem:

  1. Use google-glog and define GLOG_NO_ABBREVIATED_SEVERITIESwhen building Ceres and your own project, as documented here.Note that this fix will not work for miniglog, but use ofminiglog is strongly discouraged on any platform for whichgoogle-glog is available (which includes Windows).

  2. If you do not require GDI, then define NOGDIbeforeincluding windows.h. This solution should work for bothgoogle-glog and miniglog and is documented forgoogle-gloghere.

  1. Make a toplevel directory for deps & build & src somewhere: ceres/

  2. Get dependencies; unpack them as subdirectories in ceres/(ceres/eigen, ceres/glog, etc)

    1. Eigen 3.3 . Configure and optionally install Eigen. It should beexported into the CMake package registry by default as part of theconfigure stage so installation should not be necessary.

    2. google-glog Open up the Visual Studio solution and build it.

    3. gflags Open up the Visual Studio solution and build it.

    4. (Experimental) SuiteSparse Previously SuiteSparse was notavailable on Windows, recently it has become possible to buildit on Windows using the suitesparse-metis-for-windowsproject. If you wish to use SuiteSparse, follow theirinstructions for obtaining and building it.

    5. (Experimental) CXSparse Previously CXSparse was notavailable on Windows, there are now several ports that enable itto be, including: [1]and [2]. If youwish to use CXSparse, follow their instructions forobtaining and building it.

  3. Unpack the Ceres tarball into ceres. For the tarball, youshould get a directory inside ceres similar toceres-solver-2.0.0. Alternately, checkout Ceres via git toget ceres-solver.git inside ceres.

  4. Install CMake,

  5. Make a dir ceres/ceres-bin (for an out-of-tree build)

  6. Run CMake; select the ceres-solver-X.Y.Z orceres-solver.git directory for the CMake file. Then select theceres-bin for the build dir.

  7. Try running Configure. It won’t work. It’ll show a bunch of options.You’ll need to set:

    1. Eigen3_DIR (Set to directory containing Eigen3Config.cmake)

    2. GLOG_INCLUDE_DIR_HINTS

    3. GLOG_LIBRARY_DIR_HINTS

    4. (Optional) gflags_DIR (Set to directory containing gflags-config.cmake)

    5. (Optional) SUITESPARSE_INCLUDE_DIR_HINTS

    6. (Optional) SUITESPARSE_LIBRARY_DIR_HINTS

    7. (Optional) CXSPARSE_INCLUDE_DIR_HINTS

    8. (Optional) CXSPARSE_LIBRARY_DIR_HINTS

    to the appropriate directories where you unpacked/built them. Ifany of the variables are not visible in the CMake GUI, create anew entry for them. We recommend using the<NAME>_(INCLUDE/LIBRARY)_DIR_HINTS variables rather thansetting the <NAME>_INCLUDE_DIR & <NAME>_LIBRARY variablesdirectly to keep all of the validity checking, and to avoid havingto specify the library files manually.

  8. You may have to tweak some more settings to generate a MSVCproject. After each adjustment, try pressing Configure & Generateuntil it generates successfully.

  9. Open the solution and build it in MSVC

To run the tests, select the RUN_TESTS target and hit BuildRUN_TESTS from the build menu.

Like the Linux build, you should now be able to runbin/simple_bundle_adjuster.

Notes:

  1. The default build is Debug; consider switching it to release mode.

  2. Currently system_test is not working properly.

  3. CMake puts the resulting test binaries in ceres-bin/examples/Debugby default.

  4. The solvers supported on Windows are DENSE_QR, DENSE_SCHUR,CGNR, and ITERATIVE_SCHUR.

  5. We’re looking for someone to work with upstream SuiteSparse toport their build system to something sane like CMake, and get afully supported Windows port.

Android¶

Note

You will need Android NDK r15 or higher to build Ceres solver.

To build Ceres for Android, we need to force CMake to findthe toolchains from the Android NDK instead of using the standardones. For example, assuming you have specified $NDK_DIR:

You can build for any Android STL or ABI, but the c++_shared STLand the armeabi-v7a or arm64-v8a ABI are recommended for 32bitand 64bit architectures, respectively. Several API levels maybe supported, but it is recommended that you use the highestlevel that is suitable for your Android project.

Note

You must always use the same API level and STL library foryour Android project and the Ceres binaries.

After building, you get a libceres.so library, which you canlink in your Android build system by using aPREBUILT_SHARED_LIBRARY target in your build script.

If you are building any Ceres samples and would like to verifyyour library, you will need to place them in an executable publicdirectory together with libceres.so on your Android device(e.g. in /data/local/tmp) and ensure that the STL library fromyour NDK is present in that same directory. You may then executethe sample by running for example:

Note that any solvers or other shared dependencies you include inyour project must also be present in your android build config andyour test directory on Android.

iOS¶

Note

Download Solver For Mac

You need iOS version 7.0 or higher to build Ceres Solver.

To build Ceres for iOS, we need to force CMake to find thetoolchains from the iOS SDK instead of using the standard ones. Forexample:

PLATFORM can be: OS, SIMULATOR or SIMULATOR64. You canbuild for OS (armv7, armv7s, arm64), SIMULATOR(i386) or SIMULATOR64 (x86_64) separately and use lipoto merge them into one static library. See cmake/iOS.cmake formore options.

Note

iOS version 11.0+ requires a 64-bit architecture, so you cannotbuild for armv7/armv7s with iOS 11.0+ (only arm64 is supported).

After building, you will get a libceres.a library, which you willneed to add to your Xcode project.

The default CMake configuration builds a bare bones version of CeresSolver that only depends on Eigen (MINIGLOG is compiled into Ceresif it is used), this should be sufficient for solving small tomoderate sized problems (No SPARSE_SCHUR,SPARSE_NORMAL_CHOLESKY linear solvers and no CLUSTER_JACOBIand CLUSTER_TRIDIAGONAL preconditioners).

If you decide to use LAPACK and BLAS, then you also need toadd Accelerate.framework to your Xcode project’s linkingdependency.

Customizing the build¶

It is possible to reduce the libraries needed to build Ceres andcustomize the build process by setting the appropriate options inCMake. These options can either be set in the CMake GUI, orvia -D<OPTION>=<ON/OFF> when running CMake from the commandline. In general, you should only modify these options from theirdefaults if you know what you are doing.

Note

If you are setting variables via -D<VARIABLE>=<VALUE> whencalling CMake, it is important to understand that this forciblyoverwrites the variable <VARIABLE> in the CMake cache atthe start of every configure.

This can lead to confusion if you are invoking the CMakecurses terminal GUI(via ccmake, e.g. `ccmake-D<VARIABLE>=<VALUE><PATH_TO_SRC>). In this case, even if you change the value of<VARIABLE> in the CMake GUI, your changes will beoverwritten with the value passed via -D<VARIABLE>=<VALUE>(if one exists) at the start of each configure.

As such, it is generally easier not to pass values to CMake via-D and instead interactively experiment with their values in theCMake GUI. If they are not present in the Standard View,toggle to the Advanced View with <t>.

Modifying default compilation flags¶

The CMAKE_CXX_FLAGS variable can be used to define additionaldefault compilation flags for all build types. Any flags specifiedin CMAKE_CXX_FLAGS will be used in addition to the defaultflags used by Ceres for the current build type.

For example, if you wished to build Ceres with -march=native which is notenabled by default (even if CMAKE_BUILD_TYPE=Release) you would invokeCMake with:

Note

The use of -march=native will limit portability, as it will tune theimplementation to the specific CPU of the compiling machine (e.g. use ofAVX if available). Run-time segfaults may occur if you then tried torun the resulting binaries on a machine with a different processor, evenif it is from the same family (e.g. x86) if the specific options availableare different. Note that the performance gains from the use of-march=native are not guaranteed to be significant.

Options controlling Ceres configuration¶

  1. LAPACK[Default:ON]: If this option is enabled, and the BLAS andLAPACK libraries are found, Ceres will enable direct use ofLAPACK routines (i.e. Ceres itself will call them). If this option isdisabled, then Ceres will not require LAPACK or BLAS. It ishowever still possible that Ceres may call LAPACK routines indirectlyvia SuiteSparse if LAPACK=OFF and SUITESPARSE=ON. Finallynote that if LAPACK=ON and SUITESPARSE=ON, the LAPACK andBLAS libraries used by SuiteSparse and Ceres should be the same.

  2. SUITESPARSE[Default:ON]: By default, Ceres will link toSuiteSparse if it and all of its dependencies are present. Turnthis OFF to build Ceres without SuiteSparse.

    Note

    SuiteSparse is licensed under a mixture of GPL/LGPL/Commercialterms. Ceres requires some components that are only licensed underGPL/Commercial terms.

  3. CXSPARSE[Default:ON]: By default, Ceres will link toCXSparse if all its dependencies are present. Turn this OFFto build Ceres without CXSparse.

  4. ACCELERATESPARSE[Default:ON]: By default, Ceres will link toApple’s Accelerate framework directly if a version of it is detectedwhich supports solving sparse linear systems. Note that on Apple OSsAccelerate usually also provides the BLAS/LAPACK implementations andso would be linked against irrespective of the value of ACCELERATESPARSE.

  5. EIGENSPARSE[Default:ON]: By default, Ceres will not useEigen’s sparse Cholesky factorization.

  6. GFLAGS[Default:ON]: Turn this OFF to build Ceres withoutgflags. This will also prevent some of the example code frombuilding.

  7. MINIGLOG[Default:OFF]: Ceres includes a stripped-down,minimal implementation of glog which can optionally be used asa substitute for glog, thus removing glog as a requireddependency. Turn this ON to use this minimal glogimplementation.

  8. SCHUR_SPECIALIZATIONS[Default:ON]: If you are concerned aboutbinary size/compilation time over some small (10-20%) performancegains in the SPARSE_SCHUR solver, you can disable some of thetemplate specializations by turning this OFF.

  9. CERES_THREADING_MODEL[Default:CXX_THREADS>OPENMP>NO_THREADS]:Multi-threading backend Ceres should be compiled with. This willautomatically be set to only accept the available subset of threadingoptions in the CMake GUI.

  10. BUILD_SHARED_LIBS[Default:OFF]: By default Ceres is built asa static library, turn this ON to instead build Ceres as ashared library.

  11. EXPORT_BUILD_DIR[Default:OFF]: By default Ceres is configuredsolely for installation, and so must be installed in order forclients to use it. Turn this ON to export Ceres’ builddirectory location into the user’s local CMake package registrywhere it will be detected without requiring installation in aclient project using CMake when find_package(Ceres)is invoked.

  12. BUILD_DOCUMENTATION[Default:OFF]: Use this to enable buildingthe documentation, requires Sphinx andthe sphinx-better-theme packageavailable from the Python package index. In addition, makeceres_docs can be used to build only the documentation.

  13. MSVC_USE_STATIC_CRT[Default:OFF]Windows Only: By defaultCeres will use the Visual Studio default, shared C-Run Time (CRT)library. Turn this ON to use the static C-Run Time libraryinstead.

  14. LIB_SUFFIX[Default:'64'onnon-Debian/Archbased64-bitLinux,otherwise:']: The suffix to append to the library installdirectory, built from:${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}.

    The filesystem hierarchy standard recommends that 64-bit systemsinstall native libraries to lib64 rather than lib. Most Linuxdistributions follow this convention, but Debian and Arch baseddistros do not. Note that the only generally sensible values forLIB_SUFFIX are “” and “64”.

    Although by default Ceres will auto-detect non-Debian/Arch based64-bit Linux distributions and default LIB_SUFFIX to “64”, thiscan always be overridden by manually specifying LIB_SUFFIX using:-DLIB_SUFFIX=<VALUE> when invoking CMake.

Options controlling Ceres dependency locations¶

Ceres uses the CMakefind_packagefunction to find all of its dependencies. Dependencies that reliablyprovide config files on all supported platforms are expected to befound in “Config” mode of find_package (Eigen, gflags).This means you can use the standard CMake facilities to customizewhere these dependencies are found, such as CMAKE_PREFIX_PATH,the <DEPENDENCY_NAME>_DIR variables, or since CMake 3.12 the<DEPENDENCY_NAME>_ROOT variables.

Other dependencies are found usingFind<DEPENDENCY_NAME>.cmake scripts which are either included inCeres (for most dependencies) or are shipped as standard withCMake (for LAPACK & BLAS). These scripts will search allof the “standard” install locations for various OSs for eachdependency. However, particularly for Windows, they may fail to findthe library, in this case you will have to manually specify itsinstalled location. The Find<DEPENDENCY_NAME>.cmake scriptsshipped with Ceres support two ways for you to do this:

  1. Set the hints variables specifying the directories to search inpreference, but in addition, to the search directories in theFind<DEPENDENCY_NAME>.cmake script:

    • <DEPENDENCY_NAME(CAPS)>_INCLUDE_DIR_HINTS

    • <DEPENDENCY_NAME(CAPS)>_LIBRARY_DIR_HINTS

    These variables should be set via -D<VAR>=<VALUE>CMake arguments as they are not visible in the GUI.

  2. Set the variables specifying the explicit include directoryand library file to use:

    • <DEPENDENCY_NAME(CAPS)>_INCLUDE_DIR

    • <DEPENDENCY_NAME(CAPS)>_LIBRARY

    This bypasses all searching in theFind<DEPENDENCY_NAME>.cmake script, but validation is stillperformed.

    These variables are available to set in the CMake GUI. They arevisible in the Standard View if the library has not been found(but the current Ceres configuration requires it), but are alwaysvisible in the Advanced View. They can also be set directly via-D<VAR>=<VALUE> arguments to CMake.

Building using custom BLAS & LAPACK installs¶

If the standard find package scripts for BLAS & LAPACK whichship with CMake fail to find the desired libraries on your system,try setting CMAKE_LIBRARY_PATH to the path(s) to the directoriescontaining the BLAS & LAPACK libraries when invoking CMaketo build Ceres via -D<VAR>=<VALUE>. This should result in thelibraries being found for any common variant of each.

Alternatively, you may also directly specify the BLAS_LIBRARIES andLAPACK_LIBRARIES variables via -D<VAR>=<VALUE> when invoking CMaketo configure Ceres.

Using Ceres with CMake¶

In order to use Ceres in client code with CMake using find_package()then either:

  1. Ceres must have been installed with makeinstall. If the

    install location is non-standard (i.e. is not in CMake’s defaultsearch paths) then it will not be detected by default, see:Local installations.

    Note that if you are using a non-standard install location youshould consider exporting Ceres instead, as this will not requireany extra information to be provided in client code for Ceres tobe detected.

  2. Or Ceres’ build directory must have been exported by enabling the

    EXPORT_BUILD_DIR option when Ceres was configured.

As an example of how to use Ceres, to compile examples/helloworld.ccin a separate standalone project, the following CMakeList.txt can beused:

Irrespective of whether Ceres was installed or exported, if multipleversions are detected, set: Ceres_DIR to control which is used.If Ceres was installed Ceres_DIR should be the path to thedirectory containing the installed CeresConfig.cmake file(e.g. /usr/local/lib/cmake/Ceres). If Ceres was exported, thenCeres_DIR should be the path to the exported Ceres builddirectory.

Note

You do not need to call include_directories(${CERES_INCLUDE_DIRS})as the exported Ceres CMake target already contains the definitionsof its public include directories which will be automaticallyincluded by CMake when compiling a target that links against Ceres.In fact, since v2.0 CERES_INCLUDE_DIRS is not even set.

Specify Ceres components¶

You can specify particular Ceres components that you require (in orderfor Ceres to be reported as found) when invokingfind_package(Ceres). This allows you to specify, for example,that you require a version of Ceres built with SuiteSparse support.By definition, if you do not specify any components when callingfind_package(Ceres) (the default) any version of Ceres detectedwill be reported as found, irrespective of which components it wasbuilt with.

The Ceres components which can be specified are:

  1. LAPACK: Ceres built using LAPACK (LAPACK=ON).

  2. SuiteSparse: Ceres built with SuiteSparse (SUITESPARSE=ON).

  3. CXSparse: Ceres built with CXSparse (CXSPARSE=ON).

  4. AccelerateSparse: Ceres built with Apple’s Accelerate sparse solvers (ACCELERATESPARSE=ON).

  5. EigenSparse: Ceres built with Eigen’s sparse Cholesky factorization(EIGENSPARSE=ON).

  6. SparseLinearAlgebraLibrary: Ceres built with at least one sparse linearalgebra library. This is equivalent to SuiteSparseORCXSparseORAccelerateSparseOREigenSparse.

  7. SchurSpecializations: Ceres built with Schur specializations(SCHUR_SPECIALIZATIONS=ON).

  8. OpenMP: Ceres built with OpenMP (CERES_THREADING_MODEL=OPENMP).

  9. Multithreading: Ceres built with a multithreading library.This is equivalent to (CERES_THREAD!=NO_THREADS).

To specify one/multiple Ceres components use the COMPONENTS argument tofind_package() like so:

Specify Ceres version¶

Additionally, when CMake has found Ceres it can optionally check the packageversion, if it has been specified in the find_package()call. For example:

Local installations¶

If Ceres was installed in a non-standard path by specifying-DCMAKE_INSTALL_PREFIX='/some/where/local', then the user shouldadd the PATHS option to the find_package() command, e.g.,

Note that this can be used to have multiple versions of Ceresinstalled. However, particularly if you have only a single version ofCeres which you want to use but do not wish to install to a systemlocation, you should consider exporting Ceres using theEXPORT_BUILD_DIR option instead of a local install, as exportedversions of Ceres will be automatically detected by CMake,irrespective of their location.

Understanding the CMake Package System¶

Although a full tutorial on CMake is outside the scope of this guide,here we cover some of the most common CMake misunderstandings thatcrop up when using Ceres. For more detailed CMake usage, thefollowing references are very useful:

  • The official CMake tutorial

  • ProjectConfig tutorialand the cmake-packages documentation

    Cover how to write a ProjectConfig.cmake file, discussed below,for your own project when installing or exporting it using CMake.It also covers how these processes in conjunction withfind_package() are actually handled by CMake. TheProjectConfig tutorialis the older style, currently used by Ceres for compatibility witholder versions of CMake.

    Note

    Targets in CMake.

    All libraries and executables built using CMake are represented astargets created using add_library()and add_executable().Targets encapsulate the rules and dependencies (which can be othertargets) required to build or link against an object. This allowsCMake to implicitly manage dependency chains. Thus it issufficient to tell CMake that a library target: B depends on apreviously declared library target A, and CMake willunderstand that this means that B also depends on all of thepublic dependencies of A.

When a project like Ceres is installed using CMake, or its builddirectory is exported into the local CMake package registry (seeInstalling a project with CMake vs Exporting its build directory), in addition to the public headersand compiled libraries, a set of CMake-specific project configurationfiles are also installed to: <INSTALL_ROOT>/lib/cmake/Ceres (if Ceresis installed), or created in the build directory (if Ceres’ builddirectory is exported). When find_package isinvoked, CMake checks various standard install locations (including/usr/local on Linux & UNIX systems), and the local CMake packageregistry for CMake configuration files for the project to be found(i.e. Ceres in the case of find_package(Ceres)). Specifically itlooks for:

  • <PROJECT_NAME>Config.cmake (or<lower_case_project_name>-config.cmake)

    Which is written by the developers of the project, and isconfigured with the selected options and installed locations whenthe project is built and imports the project targets and/or definesthe legacy CMake variables: <PROJECT_NAME>_INCLUDE_DIRS &<PROJECT_NAME>_LIBRARIES which are used by the caller.

The <PROJECT_NAME>Config.cmake typically includes a second fileinstalled to the same location:

  • <PROJECT_NAME>Targets.cmake

    Which is autogenerated by CMake as part of the install process and definesimported targets for the project in the caller’s CMake scope.

An imported target contains the same information about a libraryas a CMake target that was declared locally in the current CMakeproject using add_library(). However, imported targets refer toobjects that have already been built by a different CMake project.Principally, an imported target contains the location of the compiledobject and all of its public dependencies required to link against itas well as all required include directories. Any locally declared targetcan depend on an imported target, and CMake will manage the dependencychain, just as if the imported target had been declared locally by thecurrent project.

For

Crucially, just like any locally declared CMake target, an imported target isidentified by its name when adding it as a dependency to another target.

Since v2.0, Ceres has used the target namespace feature of CMake to prefixits export targets: Ceres::ceres. However, historically the Ceres targetdid not have a namespace, and was just called ceres.

Whilst an alias target called ceres is still provided in v2.0 for backwardscompatibility, it creates a potential drawback, if you failed to callfind_package(Ceres), and Ceres is installed in a default search path foryour compiler, then instead of matching the imported Ceres target, it willinstead match the installed libceres.so/dylib/a library. If this happens youwill get either compiler errors for missing include directories or linker errorsdue to missing references to Ceres public dependencies.

Note that this description applies both to projects that areinstalled using CMake, and to those whose build directory isexported using export() (insteadof install()). Ceressupports both installation and export of its build directory if theEXPORT_BUILD_DIR option is enabled, seeCustomizing the build.

Installing a project with CMake vs Exporting its build directory¶

When a project is installed, the compiled libraries and headersare copied from the source & build directory to the install location,and it is these copied files that are used by any client code. When aproject’s build directory is exported, instead of copying thecompiled libraries and headers, CMake creates an entry for the projectin the user’s local CMake package registry,<USER_HOME>/.cmake/packages on Linux & macOS, which contains thepath to the project’s build directory which will be checked by CMakeduring a call to find_package(). The effect of which is that anyclient code uses the compiled libraries and headers in the builddirectory directly, thus not requiring the project to be installedto be used.

Installing / Exporting a project that uses Ceres¶

As described in Understanding the CMake Package System, the contents ofthe CERES_LIBRARIES variable is the name of an imported target whichrepresents Ceres. If you are installing / exporting your own project whichuses Ceres, it is important to understand that:

Download Solver For Excel Mac

Imported targets are not (re)exported when a project which imported them isexported.

Thus, when a project Foo which uses Ceres is exported, its list ofdependencies as seen by another project Bar which imports Foovia: find_package(FooREQUIRED) will contain: ceres. However,the definition of ceres as an imported target is not(re)exported when Foo is exported. Hence, without any additionalsteps, when processing Bar, ceres will not be defined as animported target. Thus, when processing Bar, CMake will assumethat ceres refers only to: libceres.a/so/dylib/lib (thecompiled Ceres library) directly if it is on the current list ofsearch paths. In which case, no CMake errors will occur, but Barwill not link properly, as it does not have the required public linkdependencies of Ceres, which are stored in the imported targetdefinition.

The solution to this is for Foo (i.e., the project that usesCeres) to invoke find_package(Ceres) in FooConfig.cmake, thusceres will be defined as an imported target when CMake processesBar. An example of the required modifications toFooConfig.cmake are show below:

Migration¶

The following includes some hints for migrating from previous versions.

Version 2.0¶

  • When using Ceres with CMake, the target name in v2.0 isCeres::ceres following modern naming convetions. The legacytarget ceres exists for backwards compatibility, but isdeprecated. CERES_INCLUDE_DIRS is not set any more, as theexported Ceres CMake target already contains the definitions of itspublic include directories which will be automatically included byCMake when compiling a target that links against Ceres.

  • When building Ceres, some dependencies (Eigen, gflags) are not foundusing custom Find<DEPENDENCY_NAME>.cmake modules anymore. Hence, instead of the custom variables (<DEPENDENCY_NAME(CAPS)>_INCLUDE_DIR_HINTS,<DEPENDENCY_NAME(CAPS)>_INCLUDE_DIR, …) you should use standardCMake facilities to customize where these dependencies are found, such asCMAKE_PREFIX_PATH, the <DEPENDENCY_NAME>_DIR variables, orsince CMake 3.12 the <DEPENDENCY_NAME>_ROOT variables.

  • While TBB is not used any more directly by Ceres, it might still tryto link against it, if SuiteSparseQR was found. The variable (environmentor CMake) to customize this is TBB_ROOT (used to be TBBROOT).For example, use cmake-DTBB_ROOT=/opt/intel/tbb... if you want tolink against TBB installed from Intel’s binary packages on Linux.

15-January-2021: We have recently released the beta version of OpenSolver 2.9.4. Free feel to read the release notes for the changes and new features added. Please let us know if they are any issues or problems that you have encountered by commenting on the bottom of the OpenSolver 2.9.4 post.

OpenSolver is updated whenever new features are added or bugs fixed. Please check out the blog page for release details. You can also use the built-in update checker to keep up-to-date with the latest release.

OpenSolver comes in two versions, a simpler “linear” version and an “advanced” (non-linear) version with support for more solvers, including non-linear solvers. Both versions are available for Mac and Windows. On Windows, OpenSolver should work with Excel 2007 and later; we test it on 32 and 64 bit Windows 7/10 in Excel 2010/2013/2016. (Older versions worked with Excel 2003, but we don’t test this any more.) On Mac OS X, it should work using Excel for Mac 2011 with any version of OS X newer than 10.7.

OpenSolver for Mac: OpenSolver currently has limited support for Excel 2016 for Mac. Version 2.8.3 of OpenSolver includes initial support for Excel 2016 for Mac, and supports model creation and modification, as well as solving with the CBC and Gurobi solvers. Make sure your version of Excel 2016 is at least 15.28 for this to work. Unfortunately, the late 2018 release of Excel 16.16.7 has broken OpenSolver; if you can help us debug this, please email us at email hidden; JavaScript is required. However, our user Alexander reported in April 2019 that “OpenSolver works for MacOS HighSierra with the latest Excel update 16.24, but if you upgrade your OS to Mojave it no longer works.” (Thanks, Alexander.)

Windows July 2016 Office Security Update Microsoft updated the security requirements for add-ins in July 2016. You now need to “Unblock” the .zip file before extracting the files; please see the instructions below and this help item.

Available Downloads

OpenSolver Linear: This is the simpler version that solves linear models using the COIN-OR CBC optimization engine, with the option of using Gurobi if you have a license. Most people use this version.

OpenSolver Advanced (Non-Linear): As well as the linear solvers, this version includes various non-linear solvers and support for solving models in the cloud using NEOS; more info is here. Much of this code is still new and experimental, and so may not work for you.

You can see all our downloads, including previous versions, on our Open Solver Source Forge site.

To download and use OpenSolver:

  1. Download the OpenSolver Linear zip file (either Mac or Windows, selected automatically depending on the machine you are using to visit this page). You can also try out our experimental Advanced Non-linear OpenSolver for Windows (also available for Mac) for access to non-linear solvers.
  2. Right click the downloaded zip file, choose Properties, and click the “Unblock” button or checkbox. If you don’t see this button (or an equivalent checkbox), you can skip this step. (This step is a new requirement following a July 2016 update to Excel.)
    Close the Properties window.
  3. Extract the files to a convenient location. (All files and sub-folders, including OpenSolver.xlam, must stay together; please do not move any files or folders out of the unzipped OpenSolver folder.) OpenSolver on Windows may not work if installed to an unmapped directory such as servermyfiles or one that contains unicode characters.
  4. Double click on OpenSolver.xlam. There may then be a small wait as Excel checks the digital signature on the OpenSolver code.
  5. If asked in an Excel Security Notice, give Excel permissions to enable the OpenSolver macros. You can click Trust all from Publisher if you do not want to be shown the Excel Security Notice again.
  6. The OpenSolver commands will then appear under Excel’s Data tab on Windows, or in the Menu Bar on a Mac.
  7. If using Excel for Mac 2016, follow the instructions further down the page to set up the solvers
  8. OpenSolver relies on open source solvers developed by COIN-OR; please consider donating to COIN-OR.

Signed Code: Note that as of October 2014, the OpenSolver code is signed by the publisher “The University of Auckland”. This makes the code more secure. However, Excel will occasionally need to check the digital signature by contacting servers online, which can take a few seconds.

Support our Solver Community: OpenSolver includes open source solvers developed by COIN-OR. Without these, OpenSolver would not exist. Please support our solver developers by donating to COIN-OR.

Make OpenSolver Installation Permanent: OpenSolver will be available until you quit Excel. If you wish, there are two ways you can make OpenSolver permanently available in Excel. Either, use OpenSolver… About OpenSolver…. and check “Load OpenSolver when Excel starts”, or you can copy the files from the .zip into the Excel add-in directory. This is typically:

Windows XP:
C:Documents and Settings'user name'Application DataMicrosoftAddins

Windows Vista and later (7, 8, 8.1):
C:Users'user name'AppDataRoamingMicrosoftAddins

Mac OSX:
/Applications/Microsoft Office 2011/Office/Add-Ins

The Excel Solver is a product developed by Frontline Systems for Microsoft. OpenSolver has no affiliation with, nor is recommended by, Microsoft or Frontline Systems. All trademark terms are the property of their respective owners.

Solver

Installing Solvers on Excel for Mac 2016

If you are running Excel 2016 on Mac, you need to install the solvers after unzipping OpenSolver. Inside the unzipped folder, go to Solvers/osx you will find a file called “OpenSolver Solvers.pkg”. Open this file and click through the prompt to set up the solvers on your computer (you will need to enter the administrator password to do so). After this you will be able to use OpenSolver as normal.

Using Gurobi on Excel for Mac 2016

Because of the sandbox, Gurobi is unable to find its license file when we start it from OpenSolver. This can be fixed by copying the license file “gurobi.lic” (which usually is in your home folder) to the following folder:

~/Library/Containers/com.microsoft.Excel/Data

Download Solver Add In Excel

Alternatively, you can open a terminal and paste the following command to put the license file in the right place (if your license file is in a non-default location you will need to modify this command first):

cp ~/gurobi.lic ~/Library/Containers/com.microsoft.Excel/Data

Why do we need an installer for Excel 2016 on Mac?

Microsoft Math Solver Download For Mac

Office for Mac 2016 is sandboxed, meaning that it can only run executables that are located in a set of whitelisted directories on the computer. We need to place the Solvers directory into one of these whitelisted locations so that we can run the solver binaries for OpenSolver. This folder is write-protected and needs admin privilege to modify, so we provide the installer to streamline the setup process.