MESA SDK
The MESA SDK is a collection of compilers and run-time libraries which make it easy to install and use the MESA stellar evolution code.
Overview
Experience has demonstrated that incompatibilities and bugs in compilers and libraries are significant obstacles in getting MESA up and running with minimal fuss. For instance, MESA makes use of various features in the new(ish) Fortran 2003 standard, which aren't implemented (or are still buggy) in all but the most recent compiler releases.
To help overcome these obstacles, I've put together a unified software development kit (SDK) which contains compilers and libraries known to compile MESA correctly. The SDK contains the following components:
- The GNU Comipler Collection (gcc), with support for C, C++, and Fortran
- The Basic Linear Algebra Subprogram (BLAS) library
- The Linear Algebra PACKage (LAPACK) library
- The Hierarchical Data Format v5 (HDF5) library
- The PGPLOT graphics library
- The ndiff fuzzy comparison tool
- The SE library from the NuGrid project
- Various helper scripts for use in linking against these libraries
Currently, both Linux and Mac OS X running on Intel/AMD processors are supported. Although the SDK was initially bundled as part of the standard MESA distribution (from release 3708 onwards), it makes more sense to keep it separate. This page hosts all the necessary information and links to download, install and use the SDK.
Linux
Compatibility
The SDK should work on any relatively-recent Linux distribution running on both 32-bit and 64-bit Intel-compatible processors. In the 32-bit case, the processor microarchitecture must be P6 or more recent; in layman's terms, this means anything manufactured since late 1995. The GNU C library (also known as GLIBC) included in the distribution must be version 2.7 or more recent; to determine what GLIBC your system uses, run the command /lib/libc.so.6 and examine the first line of the output for the version number.
Pre-requisites
The following components must be installed for the SDK to work on Linux-based systems:
- The 'Binutils' development tools
- The 'Make' dependency/compilation tool
- The 'Perl' scripting language
- The 'X11' windowing library plus development headers
- The 'Z' compression library plus development headers
- The 'C' shell or derivatives
Not all of these components are installed by default on some Linux distributions, and you may have to use the appropriate package management tool (e.g., apt-get, yum, rpm, emerge) to install them. The following table lists the package names of the components for some of the more-common distributions:
| Package | Fedora | Ubuntu | Gentoo |
|---|---|---|---|
| Binutils | binutils | binutils | sys-devel/binutils |
| Make | make | make | sys-devel/make |
| Perl | perl | perl | dev-lang/perl |
| X11 library | libX11, libX11-devel | libx11, libx11-dev | x11-libs/libX11 |
| Z library | libz, libz-devel | zlib, zlib-dev | sys-libs/zlib |
| C shell | tcsh | tcsh | sys-shells/tcsh |
If your distribution is not listed here, please contact me and I'll add it to the table.
Download
To download the SDK for Linux, click on the appropriate link in the table:
| Release Date | 32-bit Linux | 64-bit Linux | Notes |
|---|---|---|---|
| March 20 2013 (development) | mesasdk-i686-linux-20130320.tar.gz | mesasdk-x86_64-linux-20130320.tar.gz | Updated to production gcc 4.8.0; see the FAQ if encountering errors related to inequality comparison or unused parameter. |
| November 6 2012 (current) | mesasdk-i686-linux-20121106.tar.gz | mesasdk-x86_64-linux-20121106.tar.gz | Updated to production gcc 4.7.2; updated other components; added copyright/licensing messages |
| August 9 2012 | mesasdk-i686-linux-20120809.tar.gz | mesasdk-x86_64-linux-20120809.tar.gz | Built with GLIBC 2.5 (on Fedora Core 6) to fix `GLIBC_2.x' not found errors for x >= 5 |
| July 28 2012 | mesasdk-i686-linux-20120728.tar.gz | mesasdk-x86_64-linux-20120728.tar.gz | Fixed missing shared libraries (libmpfr.so) problem |
| July 27 2012 | mesasdk-i686-linux-20120727.tar.gz | mesasdk-x86_64-linux-20120727.tar.gz | |
| January 20 2012 | mesasdk-i686-linux-20120120.tar.gz | mesasdk-x86_64-linux-20120120.tar.gz |
Note that versions of the SDK older than the current one are not formally supported but are provided here as a courtesy; if you run into problems using an older version, you should first try upgrading to the current version.
Installation
On Linux the SDK can be installed anywhere (this is different from previous releases, where it had to be put in the /opt directory). However, for simplicity the following instructions will assume you're installing in your home directory. The steps are as follows:
- Download the package from the table above
- Extract it using the command tar xvfz package_name -C ~/ (note that's a tilde in front of the slash!)
- Set the path to the SDK:
- For the C shell: setenv MESASDK_ROOT ~/mesasdk
- For the Bourne shell: export MESASDK_ROOT=~/mesasdk
- Initialize the SDK (also checks compatibility):
- For the C shell: source $MESASDK_ROOT/bin/mesasdk_init.csh
- For the Bourne shell: source $MESASDK_ROOT/bin/mesasdk_init.sh
- Check that the SDK is properly installed by running gfortran --version. The first line of the output should look something like this:
GNU Fortran (GCC) 4.7.2 20120711 (prerelease)
If it doesn't, then you should consult the [#Troubleshooting] section below.
Steps 3 and 4 need to be repeated each time you begin a new shell session; alternatively, they can be added to the appropriate shell start-up file (~/.cshrc for the C shell, and ~/.profile for the Bourne shell).
Usage
Nothing special needs to be done in order to use the SDK to build MESA. Simply change into the top-level mesa directory (the one created when you download MESA via svn) and then run ./install.
Mac OS X
Compatibility
The SDK should work on any relatively-recent OS X distribution (10.4 Tiger or later) running on Apple computers with both 32-bit and 64-bit Intel-compatible processors. (The distinction between 32-bit and 64-bit on OS X is a little complicated, as although 10.4 can run some 64-bit command-line applications, its kernel is still 32-bit. See here to read more about this). You should try the 64-bit SDK first; if it produces errors of the form 'dyld: unknown required load command 0x80000022, then try the 32-bit SDK instead.
Pre-requisites
The following components must be installed for the SDK to work on OS X systems:
- The 'Xcode' development package
- The 'X' windowing package
These can be found either on one of the OS X installation disks, or on Apple's website.
Download
To download the SDK for OS X, click on the appropriate link in the table:
| Release Date | 32-bit OS X | 64-bit OS X | Notes |
|---|---|---|---|
| March 20 2013 (current) | mesasdk-x86_64-darwin-20130320.dmg | Updated to production gcc 4.8.0; see the FAQ if encountering errors related to inequality comparison or unused parameter. | |
| November 6 2012 (current) | mesasdk-x86_64-darwin-20121106.dmg | Updated to production gcc 4.7.2; updated other components; added copyright/licensing messages | |
| July 28 2012 (current) | mesasdk-i686-darwin-20120728.dmg | mesasdk-x86_64-darwin-20120728.dmg | Added support for OS X 10.4 and 10.5 |
| July 27 2012 | mesasdk-x86_64-darwin-20120727.dmg |
Note that versions of the SDK older than the current one are not formally supported but are provided here as a courtesy; if you run into problems using an older version, you should first try upgrading to the current version.
Installation
On OS X the SDK is installed in the Applications folder. The steps are as follows:
- Download the disk image from the table above
- Open it by double clicking on it in the Finder
- Drag the mesasdk folder across to the Applications folder
- Set the path to the SDK:
- For the C shell: setenv MESASDK_ROOT /Applications/mesasdk
- For the Bourne shell: export MESASDK_ROOT=/Applications/mesasdk
- Initialize the SDK (also checks compatibility):
- For the C shell: source $MESASDK_ROOT/bin/mesasdk_init.csh
- For the Bourne shell: source $MESASDK_ROOT/bin/mesasdk_init.sh
- Check that the SDK is properly installed by running gfortran --version. The first line of the output should look something like this:
GNU Fortran (GCC) 4.7.2 20120711 (prerelease)
If it doesn't, then you should consult the [#Troubleshooting] section below.
Steps 4 and 5 need to be repeated each time you begin a new shell session; alternatively, they can be added to the appropriate shell start-up file (~/.cshrc for the C shell, and ~/.profile for the Bourne shell).
Usage
See the usage instructions above for Linux (they are the same for OS X).
Troubleshooting
If you encounter an error during the build process, please consult the FAQ first. If your problem is not resolved, then you should submit a bug report to the MESA Forum. Be sure to include the following information in your bug report:
- The version of MESA you are trying to build
- The version of the SDK you are using
- Your platform (machine type, operating system, version)
Also, it would be helpful if you could post the output of the following commands:
- uname -a
- gfortran --version
- echo $MESASDK_ROOT
- echo $PATH
