Download 0.41 beta

From Mesham
Jump to navigationJump to search
Mesham 0.41b
Description: The first release from the Arjuna compiler line and the last version to work on Windows. Based upon FlexibO this version is deprecated but still contains some useful types.
Version: 0.41b
Released: September 2008
Author: Nick Brown

Please Note: This version of Mesham is deprecated, the documentation and examples on this website are no longer compatible with this version.

Version 0.41

Available in this package is version 0.41 (beta). This version of the language has the majority of current functionality, although there are some aspects unavailable which means that the Gadget-2 port is not supported by this version (it requires 0.50.) Having said that, version 0.41 is the only one which currently explicitly supports Windows. Most likely explicit support for Windows will be dropped in the 0.50 release, although advanced users should still be able to get it running on that OS.


You can download Mesham Version 0.41(b) here which is a zip file of approximately 1MB and the download supports both POSIX systems and Windows. Full instructions are included on installation for your specific system and installation instructions are also on this page.

Installation on POSIX Systems

  • Install Java RTE from
  • Make sure you have a C compiler installed i.e. gcc
  • Install an implementation of MPI - MPICH (version 2) and OpenMPI are both good ones, you choose
  • The three different components must be configured to your machine and where they are situated, happily this is all automated in the installlinux script.

Open a terminal and cd into your Mesham directory - i.e. cd /home/work/mesham Then issue the command ./installlinux and follow the on screen prompts.

If there is an issue with running the command, use the command chmod +x installlinux and then try running it again.

After running the install script, the library, compiler and server should not be moved from where they are now - this will cause problems and if required you must rerun the script and remake them.

  • Now type make all
  • If you have root access, login as root and type make install
  • Now type make clean (to clean up the directory)

Congratulations! If you have completed these 7 steps you have installed the Mesham language onto your computer! Now read the readme file for information on how to run the compiler

Nb: If you wish to change the configuration information created by the installer (for an advanced user, this is not required) then you can - the installer tells you where it has written its config files and the documentation is included in the respective source folders.

Installation on Windows Systems

The best way is to install a POSIX based system and follow those instructions. No, seriously, many of the tools and support for parallelism really is designed for Unix based OSes and as such you will have an up hill strugle as a Windows user. Whilst version 0.41 does fully support Windows, it will most likely be the last version to do so explicitly (although for an advanced user installation and usage on Windows still should be possible in the future.) Having said that, we have had Mesham 0.41 running fine on Windows - it just requires more setup as far fewer tools are included by default.


  1. Java Run Time Environment from
  2. A C compiler and GNU maker - MinGW is a very good choice that we suggest, at
  3. An implementation of MPI (see the MPI section for further details.)


To install Mesham really all the hard work has been done for you, but you will still need to configure the language.

  • Unzip the language zip file and extract its contents to a directory - we would suggest c:\mesham but it really doesnt matter
  • Now double click the installwindows.bat file - this will run the installation script, make sure you answer all the questions correctly (if you make an error just rerun it.) The script does a number of things. Firstly it automatically configures the compiler with your settings, secondly it configures the server and lastly it compiles the compiler. If you ever want to change the settings, you will need to rerun this configuration script. To install the server but not compile the compiler, just run installwindows.bat with the option -nocompile
  • Lastly you will need to install the runtime library. There are a number of options here. The simplest is to use one of our prebuilt libraries. In the libraries directory there will be two zip files, one called win32binlibrary and the other win64binlibrary. Depending on whether your system is 32 or 64 bit (most commonly, Core and Core 2 processors are 64 bit) extract the contents of the zip file into the libraries directory. Then copy (or move) mesham.dll and pthreadGC2.dll into c:\windows\system32 . By the end of this step, you should have a file called libmesham.a in the libraries directory and both mesham.dll and pthreadGC2.dll in c:\windows\system32 . If you wish to compile the runtime library rather than use our prebuild ones, then read the readme file in the libraries\windows directory. Note at this stage that if you wish to distribute the executables you compile, the user must have mesham.dll and pthreadGC2.dll on their machine, but libmesham.a is required for compiling only.
  • Thats all the hard work done! For ease of use, we would suggest adding mc.exe (the file just compiled, in compiler\bin) into your MSDOS path. To do this, goto the control panel, system, advanced tab, click on Environment Variables and under System variables scroll down to Path and edit it to add ;c:\mesham\compiler\bin then click OK. (The ; simply separates paths, this assumes you have installed the language in c:\mesham, if not change the path accordingly.)

Note - if you ever wish to move the location of the language files, you will need to rerun installwindows.bat file to reconfigure the setup. Secondly, there is a prebuild server runner called winrunserver.bat with some default options. If you dont want to build the items, you can run this, and then run compiler/wingui.bat for the Mesham into C viewer, without any other steps that will work fine.

Using Mesham on Windows

IMPORTANT you MUST make the MPI executable files visible to Mesham. To do this, goto the control panel, system, advanced tab, click on Environment Variables and under System variables scroll down to Path and edit it to add ;c:\program files\mpich2\bin then click OK. (The ; simply separates paths, this assumes you have installed MPICH2 and in c:\program files\mpich2, if not change the path accordingly.)

As long as you have made mc.exe and the MPI executable files visible via the path, then you can create Mesham source files and compile them anywhere. We will detail how to simply get yourself up and running in this text, consult the language manual for specific language details.

  • First, run the server - this can be found in the server directory, and simply double click runserver.bat . The server will start up (can take a few moments) and will tell you when its ready
  • Now, create a file - lets call it a.mesh. For the contents just put in:
var a:=34;
  • Open a MSDOS terminal window, change the path to the directory where a.mesh is located and type mc a.mesh . The compiler should generate a.exe , and you can run it via MSDOS or by double clicking on it. There are lots of options you can do , type mc -h to find out

If there are any problems, you might need to configure/play around with your MPI implementation. Certainly with MPICH2 you might need to start the process manager, called smpd.exe in the mpich2/bin directory, and wmpiconfig.exe is required initially to register a username/password with the process manager.

If you wish only to view the C code, but not compile it, you can use the language C code viewer by double clicking windowsgui.bat in compiler\java

MPI for Windows

It doesnt matter which implementation you install. Having said that, it seems that the majority of implementations have been created with Unix in mind rather than Windows. MPICH certainly supports Windows, but you need MS Visual Studio to use the automated installer. To install MPICH for windows, make sure you have MS Visual Studio, Intel Fortran (free download from their site) and also Microsoft Visual C++ 2005 SP1 Redistributable Package (x86) from Then download MPICH for windows at under releases and install. This will work automatically via the MPICH installer.

There are other options too, OpenMPI might be a possibility via Cygwin.

Differences between 0.41 and 0.50

The current language version is 0.50, which has been used for the Gadget-2 and NASA PB work and much of the recent work on the language. It is hoped to get 0.50 available for download ASAP, there are some important differences between the two versions, some of the improvments in 0.50 include:

  • Records may refer to themselves (via the reference record type) and be communicated as such
  • Ability to use native C code
  • 64 bit Integer element type
  • Gadget-2 extension types
  • Communication Modes
  • Default communication supported within par loops (MPMD style)
  • Additional collection types
  • Improved Preprocessor and support for including multiple source files
  • Improved Error Handling Support
  • Numerous bug fixes and other improvements