Installation of MathGL 2.3.5 In Debian
Motivation
Despite that MathGL is included in the official Debian repositories, It is not the latest version, and the installed, library includes a lot of wrappers and features I'm unlikely to use.
What is MathGL?
As the official website states, MathGL is,
- a library for making high-quality scientific graphics under Linux and Windows.
- a library for the fast data plotting and data processing of large data arrays.
- a library for working in window and console modes and for easy embedding into other programs.
- a library with large and growing set of graphics.
Here you can see a gallery with MathGL graphics
I've used this library several times from long time ago (like in this project of Hodgking-Huxley action potential) and I think is a very nice library to generate graphics from your final binaries. For example, I've used it when my code is up and running and I want it to generate graphic output directly (png,pdf,...)
Installation
First of all, download the latest source from here, and then proceed to get the required prerequisistes.
Prerequisites
The list of prerequisites depends a lot on what you'd like to do with MathGL. I wanted to be able to work with Qt5 widgets, pdf output,gsl support (GNU Scientifical library),OpenMP, MPI, HDF5, and wxWidget support. I've installed the required libraries as root by,
To see the complete list of supported features you can read the CMakeLists.txt
and look for every line containing option(enable-XYZ)
so you add -D enable-XYZ
when you call cmake
.
Building MathGL
Once you've installed the prerequisites, you can build MathGL at the root directory of the source or simply a build
directory. I like more the build
approach since keeps the source directory clean.
Any errors during the cmake
phase can be related to the lack of any prerequisite so keep an eye on the errors, they often say what needs to get installed or fixed.
If everything goes fine, you finally install MathGL as root by,
make install
And that's it.