This page describes how to install MESA.
Prerequisites
Ensure your system meets the minimum hardware requirements
The minimum system requirements for MESA are:
Mac or Linux operating system
64-bit processor
8 GB RAM
20 GB free disk space
Windows users should follow the instructions here.
Most laptop or desktop computers built in the last three years willsatisfy these requirements.
Install the MESA SDK
Before you install MESA, you need to get the prerequisites. The MESASDKsimplifies this process by providing a prebuilt set of compilers andrun-time libraries that should make your MESA install gosmoothly. Visit the MESA SDK website forthe details of setting it up.
If you would prefer to use ifort (the MESA SDK uses gfortran), that isalso an option, so long as you use ifort 14 or later. Even if you chooseto use ifort, you should still visit the MESA SDK website to get a feelfor the other MESA requirements.
Not using the MESA SDK means you’ll need to replace the file$MESA_DIR/utils/makefile_header
with a version customized to yoursystem. There’s a template to get you started at$MESA_DIR/utils/makefile_header_non_mesasdk
.
Regardless of whether you use the MESA SDK or ifort, and whether yourmachine runs MacOS or linux, the output of MESA should be bit-for-bitidentical. If it’s not, this is considered to be a bug. (This hasbeen the case since Release 5819 in early January 2014.)
Installation
Download MESA
The simplest way to get the MESA software is to download a zip file ofthe latest MESA release.
The compressed file is about 2GB, so don’t worry if it takes a littlewhile to download.
The unzipped and installed package will be large, so make sure you haveat least 20 GB free on your disk.
When you unzip the file, it will create a directory namedmesa-main. This will be your main MESA directory. You arefree to rename it, just make sure to set MESA_DIR accordingly (see thenext section).
You can also download zip files of older MESA releases.If you plan to do so, please read this FAQ entry.
Set your environment variables
The easiest way to make sure that your system is always configuredappropriately is to define the necessary environment variables inyour shell start-up file. The file thatyou need to edit will depend on which shell you’re using.You can find out by running echo $0
. The default on most Linuxdistros is bash, in which case you need to edit $HOME/.bashrc
. Ifyou don’t set the environment variables in your shell start-up file,you will need to re-define them each time you open a new shell.
The exact paths depend on where you installed MESA and which operatingsystem you are using. After you add these commands to your shellstartup file, don’t forget to open a new shell (or source
thestartup file in an existing one).
Here is an example from a machine that uses bash as its shell (and henceuses export to set variables):
# set MESA_DIR to be the directory to which you downloaded MESA# The directory shown is only an example and must be modified for your particular system.export MESA_DIR=/Users/jschwab/Software/mesa-r21.12.1# set OMP_NUM_THREADS to be the number of cores on your machineexport OMP_NUM_THREADS=2# you should have done this when you set up the MESA SDK# The directory shown is only an example and must be modified for your particular system.export MESASDK_ROOT=/Applications/mesasdksource $MESASDK_ROOT/bin/mesasdk_init.sh# add shmesa (the MESA command line tool) to your PATHexport PATH=$PATH:$MESA_DIR/scripts/shmesa
If your machine uses csh as its shell, use setenv
instead of export
.
One caveat is that if you initialize the MESA SDK in your shellprofile, you’ll always be using the MESA SDK supplied version of gccwhich may be a compatibility issue if you work with other other codes.Alternative (unsupported) initialization scripts are available here.
Compile MESA
Now we are ready to compile the code. This will take a little while, sodo something else for a bit or get up and get a cup of coffee.
cd $MESA_DIR./install
Warning
There is no reason to use sudo
. The MESA install does notrequire root privileges.
Once it is done, you should receive the message
************************************************************************************************************************************************MESA installation was successful************************************************************************************************************************************************
If so, you can learn more about MESA by looking at other pages.
Read the linked page that summarizes some best practicesto keep in mind throughout the lifecycle of your project.
Troubleshooting
First, confirm that you can reproduce the error. Do
cd $MESA_DIR./clean./install
and see if you get the same error.
Check that your environment variables are set correctly
One of the most common issues is unset or incorrectly set environmentvariables. In the same terminal window where you are trying to installMESA, execute the command:
echo $MESA_DIR
and if you’re using the MESA SDK, execute the command:
echo $MESASDK_ROOT
Confirm thatthese showed the directories where you have installed MESA and the MESASDK. If they did not, please re-read the instructions on how to Set your environment variables.
Confirm that you installed the MESA SDK correctly
Please check that you followed the MESA SDK installationinstructions.Pay particular attention to the prerequisites for your system.
Consult the FAQ
Check to see if there is any information about your problem in theMESA FAQ.
If you are using the MESA SDK and are having a problem withinstallation, you should also consult the MESA SDKFAQ.
Search the mesa-users mailing list archive
Search the mailing listarchives to see ifsomeone has had a similar problem in the past.
Post a question to mesa-users
If the previous steps have not solved your problem, send an emailmessage to mesa-users@lists.mesastar.org describing the problem.
Please provide the following information:
What version of MESA are you trying to build?
Are you using the MESA SDK? If so, what version?
Describe your computer (machine type, operating system, operatingsystem version).
What is the error message you received?
Attach the
$MESA_DIR/build.log
file. This includes the output of the build process along with the output of each of the following commandsuname -agfortran -vecho $MESASDK_ROOTecho $PATHecho $MESA_DIR