-
Notifications
You must be signed in to change notification settings - Fork 28
Solving issues with Ceres
D2D includes the Ceres solver from Google [1] . Ceres is a toolbox of non-linear optimization algorithms. It can be chosen with
ar.config.optimizer = 10;
Ceres will be locally compiled when running arFit for the first time with Ceres. This compilation works an all platforms (Mac, Windows, Linux), but requires a compiler with support for variadic templates:
Visual Studio C++ supported from version 2013
GCC supported from version 4.4
Clang C++ supported from version 2.9
When compiling Ceres on Linux with a compiler above the currently supported version of Matlab, you might run into an error when running Ceres which looks like this:
.../libstdc++.so.6: version `GLIBCXX_3.4.x' not found (required by …)
This is due to Matlab preferably using the c++ standard library it has shipped with its distribution. This libstdc++, located in MATLABROOT/sys/os/ is outdated and not the one your compiler used when compiling Ceres.
A fix for this issue is to symbolicly link MATLABs shipped version to the newer one your compiler used. This can be done (on linux) via the commands (in command prompt).
Backup old version
mv MATLABROOT/sys/os/libstdc++.so.6 MATLABROOT/sys/os/libstdc++.so.6.old
Create symbolic link to local libstdc++ folder
ln -s /path/to/compiler/libstdc++.so.6 MATLABROOT/sys/os/libstdc++.so.6
If you don't know where your local libstdc++.so.6 is located just run
locate libstdc++.so.6
An alternate way of fixing this problem is to explicitly tell MATLAB to use the system libstd library. However this has to be done before running matlab with the following command and is required for every run:
env LD_PRELOAD=/path/to/local/libstdc++.so.6 matlab -desktop
[1] Agarwal, S. et al. Ceres Solver. http://ceres-solver.org
- Installation and system requirements
- Setting up models
- First steps
- Advanced events and pre-equilibration
- Computation of integration-based prediction bands
- How is the architecture of the code and the most important commands?
- What are the most important fields of the global variable ar?
- What are the most important functions?
- Optimization algorithms available in the d2d-framework
- Objective function, likelhood and chi-square in the d2d framework
- How to set up priors?
- How to set up steady state constraints?
- How do I restart the solver upon a step input?
- How to deal with integrator tolerances?
- How to implement a bolus injection?
- How to implement washing and an injection?
- How to implement a moment ODE model?
- How to run PLE calculations on a Cluster?