Getting Started
This page has information to help you get started using MESA. It begins with a sketch of the overall organization of the MESA modules, then gives steps for downloading, installing, and using MESA.
MESA organization
Downloading MESA (1943 is current as of 2009-11-26)
Installing MESA
Using MESA

MESA is under construction—and probably will be for the indefinite future.
Moreover, for now, I’m the documentation! So if you run into trouble, email me (paxton AT kitp DOT ucsb DOT edu), and perhaps we can fix things. If you still want to give it a try, read on.
MESA organization
When you download MESA, you’ll get a directory with lots of subdirectories. You can name the top level directory whatever you’d like and put it anyplace that’s convenient. But don’t mess with the names of the subdirectories or their contents. In the following, I’ll refer to this top level directory as “the MESA directory”.
Each MESA module has its own directory with a standard set of subdirectories and scripts. The standard subdirectories for each module are “make”, “private”, “public”, and “test”. The test directory has “make” and “src” directories for the program that tests the module when it is created. The make directory has the makefile for the library and will hold the object files and “mod” files that are created by the compiler. The public directory has the sources for the interface to the library, while the private directory has sources for the parts of the implementation that are meant for internal use only. For example, if you want to see what’s available in the eos module, look in eos/public/eos_lib.f for the routines and eos/public/eos_def.f for the data.
In addition to the directories for the various modules, the MESA directory also has several directories that hold shared information. The “data” directory holds tables for eos and opacities in both text and cached binary formats. The “include” directory holds interface information needed by the compiler, and the “lib” directory holds the library files for the modules.
Finally, the MESA directory contains several useful scripts that will be discussed below.
Downloading MESA
The first step is to “checkout” the MESA project using the svn version control system. (Binaries for svn are available from the downloads page of the subversion website. The first two chapters of the on-line Subversion Book will tell you all you need to know to use svn for MESA.)
The following command line will install the most recent version that has been checked to work okay using both the Intel fortran compiler and gfortran compiler on my Mac.
svn co -r 1943 https://mesa.svn.sourceforge.net/svnroot/mesa/trunk mesa
Similarly, if you’ve previously done a checkout, and now you want to update to the most recent released version, do
svn update -r 1943
After you do an svn update, you should do ./clean before redoing ./install for the new stuff. That will force it to recompile everything just to be safe.
Whether you’re doing a checkout or an update, always use “-r” to get an officially released version.
Oldies:
1822 (2009-10-10)
1728 (2009-09-21)
1691 (2009-09-11)
1585 (2009-08-09)
1489 (2009-07-18)
1396 (2009-06-28)
1296 (2009-06-07)
1249 (2009-05-12)
1145 (2009-03-16)
1118 (2009-02-27)
971 (2009-01-25)
776 (2008-11-11)
Installing MESA
Before doing an install, you need to give MESA some information such as what compiler you’d like to use. The relevant info is in a file called “makefile_header” that lives in the “utils” directory. Open that file now, follow the step-by-step instructions, and then return here.
Now you’re ready to run one of the install scripts. If you’re only installing the MESA numerics modules, then run the “install_numerics_only” script; otherwise run “install”. The full install is a rather lengthy process, so go do something else while it grinds away.
If at some point you’d like to redo the installation process (for example, after changing something in the makefile_header), you can run the “clean” script and then reinstall.
By the way: do you have the “ndiff” program installed already? If so, great. If not, it will be installed automatically along with mesa. We use ndiff in all of the package test programs to compare numeric results for equality up to some specified tolerance. This description is from Nelson Beebe’s ndiff webpage:
Suppose that you have just run the same numerical program in two different environments, perhaps different compilers on the same system, or on different CPU architectures or operating systems. You run diff on the two program output text files, but there are thousands of differences reported. Is the program behaving acceptably, or are there real errors that you must deal with, perhaps due to architectural assumptions in your code, or to numerical instabilities in your algorithms, or errors in compiler-generated code, or errors or inaccuracies in run-time libraries? ndiff is a very useful tool for solving problems like that. Simply put, it assumes that you have two text files containing numerical values, and the two files are expected to be identical, or at least numerically similar. ndiff allows you to specify absolute and/or relative error tolerances for differences between numerical values in the two files, and then reports only the lines with values exceeding those tolerances.
Using MESA
In the MESA directory you should find a subdirectory called “sample”. Make a copy of it anywhere you’d like and give it whatever name you want. Follow the instructions in the README file to make and test the sample.
Hopefully this little example will be enough to show you how to modify your own project makefile in order to use MESA. If not, consult the MESA-users mailing list for help. Please sign up before sending mail!
MESA-news—news from the developers
MESA-users—questions, comments, and discussion
website design by
Andreas Viklund