Mercurium C/C++/Fortran source-to-source compiler

Programming Models

Mercurium is a source-to-source compilation infrastructure aimed at fast prototyping. Current supported languages are C99, C++11 and Fortran 95. Mercurium is mainly used along with the Nanos++ runtime to implement projects for OmpSs and OpenMP but since it is quite extensible it has been used in other projects including (but not limiting to) Cell Superscalar, ACOTES, software transactional memory, vectorization and correctness.

Software Author: 

Roger Ferrer Ibáñez, Sara Royuela Alcázar, Sergi Mateo Bellido, Diego Caballero De Gea

Contacto:

sergi.mateo@bsc.es

pm-tools@bsc.es

License: 

Mercurium is licensed under the LGPLv3

Primary tabs

Existing compilation infrastructures for production are usually too big to tackle in an academic environment where manpower and resources are limited. Mercurium has been designed with the goal to be productive in a fast prototyping context of new ideas requiring compiler analyses and transformations.

Mercurium architecture provides a rich shared internal representation for C, C++ and Fortran and can be extended by means of compiler phases implemented as plugins. Code transformations can easily be implemented using source snippets that are integrated in the intermediate representation of the compiler. A more traditional mechanism manually building nodes is also available for more advanced transformations.

Mercurium has built-in several single-source features aimed at heterogeneous computing: from a single file the compiler can generate several files that can be compiled with other backend compiler and finally integrated into a single executable. This mechanism available since the Cell architecture has been exploited also for CUDA and other manycore heterogeneous clusters.

Please, visit the Programming Models website where you will find more resources about Mercurium.