MathGL can be installed in 4 different ways.
cmake .
twice, after it make
and make install
with root/sudo rights. Sometimes after installation you may need to update the library list – just execute ldconfig
with root/sudo rights.
There are several additional options which are switched off by default. They are: enable-fltk, enable-glut, enable-qt4, enable-qt5
for ebabling FLTK, GLUT and/or Qt windows; enable-jpeg, enable-gif, enable-hdf5
and so on for enabling corresponding file formats; enable-all
for enabling all additional features. For using double
as base internal data type use option enable-double
. For enabling language interfaces use enable-python, enable-octave
or enable-all-swig
for all languages. You can use WYSIWYG tool (cmake-gui
) to view all of them, or type cmake -D enable-all=on -D enable-all-widgets=on -D enable-all-swig=on .
in command line for enabling all features.
There is known bug for building in MinGW – you need to manually add linker option -fopenmp
(i.e. CMAKE_EXE_LINKER_FLAGS:STRING='-fopenmp'
and CMAKE_SHARED_LINKER_FLAGS:STRING='-fopenmp'
) if you enable OpenMP support (i.e. if enable-openmp=ON
).
Note, you can download the latest sources (which can be not stable) from sourceforge.net SVN by command
svn checkout http://svn.code.sf.net/p/mathgl/code/mathgl-2x mathgl-code
IMPORTANT! MathGL use a set of defines, which were determined at configure stage and may differ if used with non-default compiler (like using MathGL binaries compiled by MinGW in VisualStudio). There are MGL_SYS_NAN, MGL_HAVE_TYPEOF, MGL_HAVE_PTHREAD, MGL_HAVE_ATTRIBUTE, MGL_HAVE_C99_COMPLEX, MGL_HAVE_RVAL
. I specially set them to 0
for Borland and Microsoft compilers due to compatibility reasons. Also default setting are good for GNU (gcc, mingw) and clang compilers. However, for another compiler you may need to manually set this defines to 0
in file include/mgl2/config.h
if you are using precompiled binaries.