Skip to content

Installing and running ASPECT on Mac OS X

naliboff edited this page Jun 7, 2018 · 9 revisions

OS X has some eccentricities which can complicate installation of ASPECT. Currently the easiest and most reliable way build and run ASPECT under different versions of Mac OS X 10.10 (Yosemite) - 10.13 (High Sierra) is through the Mac binary package for deal.II.

The most recent deal.II binary package (version 9.0) is only compatible with OS X 10.13, while older versions (8.5.1 and 8.5.0) can run on OS X 10.10-10.12. Likewise, there may be issues installing older deal.II binaries on OS X 10.13 and we strongly recommend using the most recent deal.II release on 10.13.

1. Install Xcode from the app store.

You might need to install the command line tools. Open a terminal and make sure clang does not report command not found. You might need to run

  xcode-select --install

to install the tools.

If that command does not work, you will need to create a free apple developer account (typically linked to an iCloud account) and download the command line tool package (.dmg file) from the apple developer website. At this website go to the "Account" link at the top right of the page, login and download the command tool package from the "Download Tools" link.

2. Install Cmake.

CMake is a cross-platform, open-source build system that can be downloaded from http://www.cmake.org. After installation of CMake.app, the terminal command for cmake will be

  /Applications/CMake.app/Contents/bin/cmake

3. Dowload and install deal.II.

Open the downloaded disk image, and drag deal.II.app into the Applications folder. To start the deal.II app, double click the icon in the Applications folder or use the open command as shown in the example below.

  open /Applications/deal.II-8.5-brew.app

deal.II app opens a terminal window and displays a deal.II message.

        ______           _  _____ _____
        |  _  \         | ||_   _|_   _|
        | | | |___  __ _| |  | |   | |
        | | | / _ \/ _| | |  | |   | |
        | |/ /  __/ (_| | |__| |_ _| |_
        |___/ \___|\__,_|_(_)___/ \___/

This is a shell with PATHs and ${EXTERNAL_LIB}_DIR setup to work with Deal.II.
All external libraries are located in 

    /Applications/deal.II-8.5-brew.app/Contents/Resources/brew/

If you are new to Deal.II you probably want to have a look at

    /Applications/deal.II-8.5-brew.app/Contents/Resources/examples/

For more information please visit the project website:

http://www.dealii.org

If you want to set up your daily Terminal to work with deal.II, add
these lines to your ~/.profile file (the first line turns off this message):

   export DEAL_II_CONF_SILENT=ON
   . /Applications/deal.II-8.5-brew.app/Contents/Resources/share/deal.II/dealii.conf

bash-3.2$ 

The deal.II terminal window contains all of the required libraries for ASPECT (deal.II, p4est, Trilinos) and also automatically sets the correct environment variables for these libraries and the compilers.

4. Download the ASPECT source from the git repository.

Within the deal.II terminal window cd to the folder where you would like to install ASPECT and the clone it from the main repository or your own forked repository

  git clone https://github.com/geodynamics/aspect.git

If you wish to use Xcode as your IDE it is recommended to skip to step 7 below. Otherwise, proceed with steps 5 and 6 below.

5. Build ASPECT

Note: if you are not using Xcode (see step 7 below), you MUST build and run ASPECT in the terminal window started by deal.II, rather than in the Terminal app.

  • Go into the cloned ASPECT repository and configure ASPECT with cmake:
  cd aspect
  cmake .

Part of the displayed messages should include something like:

#  Project  aspect  set up with  deal.II-8.5.0  found at
#      /Applications/deal.II-8.5-brew.app/Contents/Resources
#
#  CMAKE_BUILD_TYPE:          Debug
  • Run make:
  bash-3.2$ make
  Scanning dependencies of target aspect
  [  0%] Building CXX object CMakeFiles/aspect.dir/source/adiabatic_conditions/ascii_data.cc.o
  ...
  Linking CXX executable aspect
  [100%] Built target aspect
  bash-3.2$ ls -l aspect
  -rwxr-xr-x  1 <name>  staff  19131292 May  7 15:02 aspect

There may be warnings from the compiler, but if the ASPECT target is created then it was successful.

  • By default, ASPECT compiles the debug version of the code. To compile the optimized version:
  make release 

Alternatively, one can configure ASPECT to build the optimized version before running make with:

  cmake -DCMAKE_BUILD_TYPE=Release .
  • After ASPECT has been compile successfully, check to make sure the basic test works with the command:
  make test

The entire test suite can then be run with

  make setup_tests
  make test

6. Run ASPECT.

A reminder: you must run ASPECT on the terminal window which is opened by deal.II.app.

To start ASPECT using MPI for parallelization, from the directory where you installed ASPECT:

  mpirun -np <# of processes> ./aspect <parameter file>

To check quickly whether you are running ASPECT on the deal.II.app terminal, check the location of the mpirun command:

  bash-3.2$ which mpirun
  /Applications/deal.II-8.5-brew.app/Contents/Resources/brew/bin/mpirun
  bash-3.2$ 

7. Build ASPECT as an Xcode project.

After completing step 4 above, do the following:

  • Go to the directory where you wish to install ASPECT and run the following command:
  cmake -G Xcode .

Now open the resulting aspect.xcodeproj in Xcode.

  • Open Product -> Scheme -> Manage Schemes, then select aspect and click Edit. Go to Run -> Arguments, and under "Arguments Passed On Launch" add the filepath to the desired parameter file. Click "Close" then select Product -> Run to run ASPECT with this parameter file.

  • If you want to run in parallel in Xcode, the easiest way is to create a new scheme. Open Product -> Scheme -> Manage Schemes, select aspect then select the gear icon, then Duplicate scheme. Rename the new scheme to aspect parallel. Go to Run -> Info, and in Executable choose Other.... Navigate to

  /Applications/deal.II.app/Contents/Resources/opt/openmpi-1.10.2/bin

and select orterun, then click Choose.

  • Now go to the Arguments tab, and add 3 arguments: first, add -np4 (for 4 processors -- you may use however many your machine has). Then add a path to your aspect executable -- this should be within your aspect folder, or the subfolders Debug or Release. Finally, ensure you have a path to your parameter file as above. Ensure these are in the correct order, or reorder them if necessary. Click ``Close'' then select Product\textgreater Run to run ASPECT in parallel with this parameter file.