Compiling Mathemagix from its sources
Home | Download | Language | Packages | Develop | Contact | Jobs | Search

This section concerns the compilation, installation, or local use of several Mathemagix packages together, from sources.

1.Dependencies

For a minimal build of the Mathemagix interpreter, you will need to ensure that Libtool has been installed on your system with support for building dynamic libraries. In addition, you probably want to install Readline, which is convenient if you want to use the interpreter from a shell.

The other packages of Mathemagix each come with their specific dependencies; see the package list. The two most important dependencies are Gmp and Mpfr, which are required by almost all other packages. Developers also need to install Autotools, cmake, Doxygen, and TeXmacs.

2.Downloading from the svn server

The sources of Mathemagix can be downloaded from the svn server located at http://gforge.inria.fr/projects/mmx/ via the following command:


      

This will create a mmx directory containing all the source files.

3.Installation and use via autotools

Mathemagix packages comply with the standard GNU installation procedure. For a complete description please refer to the documentation of individual packages. In this section we describe how several packages can be configured, compiled and installed with the top level tools available in the mmx directory.

3.1.Configuration

In a text terminal or console, and within the mmx directory, you can type the following command:


      

The default list of the packages to be handled is thus printed. The latter list can be customized thanks to the –enable-package options. Dependencies are treated automatically. For instance


      

will build the package algebramix and the interpreter mmxlight, as well as all dependencies (in this case basix and numerix). Notice that extra packages can be enabled a posteriori, simply by redoing a ./configure; this will not recompile the packages which are already available.

To build Mathemagix on certain architectures you may need to specify additional include and library paths. For example, if external dependencies have been installed via Macports on a MacOS platform then you have to type:


      

Default installation path is /usr/local/, but you can customize it with the –prefix option as follows:


      

In order to build the html documentation, you have to add the option –enable-doc to the configure script, but it requires that TeXmacs and Doxygen are installed on your platform. Finally the list of all configuration options is obtained using:


      

3.2.Compilation

Once the configuration stage is finished you can start the compilation and installation by typing:


      

Please notice that running the make command without the argument install, in order to launch the sole compilation, will fail here, because low level (regarding to the dependency chain) packages must be installed in order to be detected at the right place by higher level packages.

3.3.Development mode

If you do not want to install Mathemagix, then you can use it, either to try or to contribute, via the development mode. First of all, you need to setup the paths needed for the applications to be built and used locally, by typing the following command in the mmx directory:


      

Then you can proceed to the configuration as explained above with adding the option –enable-devel, and then type:


      

This will allow you for instance to run the tests, the benchmarks, and the interpreter without installation, by typing for instance:

Since Mathemagix consists of several packages, this development mode is convenient for developers. Indeed, otherwise reinstalling a package after a modification may cause dependant packages to be recompiled over and over again. In case you have passed the –enable-doc option you can build the whole html documentation by typing make html.

If the one wants to run make in the specific package only then one can type:


      

The other targets (which behave similarly) are:

check [package-check]
run the test suite of the package(s).
clean [package-clean]
clean the package(s).
confclean [package-confclean]
clean the configuration file of the package(s).
dist [package-dist]
build the distribution archive .tar.gz for each selected package.
distclean [package-distclean]
clean the built files and the Makefile(s).
html [package-html]
build the html documentation of the package(s).
install [package-install]
install the package(s) in the directory specified by the option –prefix=... of configure.
uninstall [package-uninstall]
unsintall the package(s).

4.Configuration and compilation using cmake

Mathemagix packages also comply with cmake building tools. For a complete description please refer to the documentation of individual packages. In this section we describe how several packages can be configured, compiled and installed with the top level tools available in the mmx directory.

4.1.Configuration

Once the sources are downloaded, you should create a directory outside the Mathemagix source tree, say build, where the Mathemagix packages are going to be compiled. Then you can proceed to the configuration by running cmake from your build directory as follows:


      

where path-to-mmx represents the actual path to the mmx source directory.

In order to customize and select only some of the packages (e.g. realroot, mmxlight), you can add the following kind of options:


      

To build test files, you have to set -DTEST=ON. The sources of the test files are located in the subdirectories named test.

The option which controls the construction of the applications available from the subdirectories called app is APP. The default value is APP=ON. If these applications are built, then their binaries are put in the folder build/bin.

To construct the glue to the Mathemagix interpreter, you have to add the option -DGLUE=ON (if not already set by default). To construct the plugins for Axel, you have to add the option -DAXEL=ON. In these cases, the dependencies with other packages are checked, depending on the list pkg.glue and pkg.axel defined in the file pkg/specif/pkg-cmake.mmx.

In a similar way you can activate the production of the html documentation by adding -DDOC=ON.

The installation destination can be specified through the variable CMAKE_INSTALL_PREFIX (the default value being /usr/local):


      

4.2.Compilation

Once configured, you can launch the compilation and installation by typing:


      

To see more details on the commands that are run to build files, one can use the option VERBOSE:

To see the available targets of the make command, use

4.3.Development mode

As described above with the autotools you might want to use mathemagix without installing it, either for a simple try or to contribute to it. The development mode is activated by passing the option -DDEV=ON to cmake. Then you need to setup the paths needed for using the applications, that will be built locally, by typing from your build directory:


      

The compilation is then performed by simply typing:


      

As a result, the packages will be configured and compiled automatically in a suitable order. When done you should have the binary mmx-light of the interpreter in your path:


      

Typing 1+1 at the prompt should produce the output 2.

5.Global Variables

The following variables should not be modified, unless you really know what you are doing.

Beside global variables a global boot file is located at 'prefix_path'/etc/mathemagix/boot.mmx. It is automatically loaded by mmx-light. At the end, the latter boot file further loads a user boot file located at $MMX_USER_DIR/etc/boot.mmx. Use the shell option –noboot to disable these loadings.

6.Known problems

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License. If you don't have this file, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.