-
Notifications
You must be signed in to change notification settings - Fork 245
Installing and running ASPECT on Mac OS X
OS X has some eccentricities which can complicate installation of ASPECT. Currently the easiest and most reliable way to run the current version of ASPECT (2.0 and development branch) under Mac OS X Yosemite (10.10), El Capitan (10.11), Sierra (10.12) and High Sierra (10.13) is to install and run the 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.
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 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.
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
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:
open /Applications/deal.II.app
deal.II app opens a terminal window and displays a deal.II message. deal.II.app will install all required libraries for ASPECT (p4est, parMeTiS, and Trilinos) and will include the environment variables needed to use these libraries.
To ensure the correct compilers are picked up when configuring ASPECT, add the following lines to your ~/.profile
or ~/.bash\_profile
:
export OMPI_CXX=clang++
export OMPI_CC=clang
cd $HOME/src
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.
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 to the directory where you wish to install ASPECT and run the following commands:
cmake .
This should display something like:
Project aspect set up with deal.II-8.4.1 found at /Applications/deal.II.app/Contents/Resources
- Run make:
bash-3.2$ make
Scanning dependencies of target aspect
[ 0%] Building CXX object CMakeFiles/aspect.dir/source/adiabatic_conditions/initial_profile.cc.o
[ 0%] Building CXX object CMakeFiles/aspect.dir/source/adiabatic_conditions/interface.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
- Run make test
make test
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.app/Contents/Resources/opt/openmpi-1.6.5/bin/mpirun
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 clickEdit
. 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, thenDuplicate scheme
. Rename the new scheme toaspect parallel
. Go to Run -> Info, and in Executable chooseOther...
. 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.