Difference between revisions of "Installation on Mac"
Schismguest (talk | contribs) |
|||
| (25 intermediate revisions by one other user not shown) | |||
| Line 1: | Line 1: | ||
| − | Below is a recipe | + | Below is a recipe provided by Dr. Carsten Lemmen. |
From a clean macOS (currently High Sierra), first you need to have a compiler (a clang comes with Xcode) | From a clean macOS (currently High Sierra), first you need to have a compiler (a clang comes with Xcode) | ||
| − | + | <UL> | |
| − | + | <LI>Install XCode from AppStore | |
| − | + | <LI>Install XCode Command Line Tools from within XCode | |
| + | <LI>run xcodebuild -license and type "agree" | ||
| − | + | <LI>Install MacPorts, i.e. install a toolchain with open source developer tools; there are at least three prominent systems that help you do this (1) fink (2) home-brew (3) macports. Either of them is probably fine and the choice is a matter of taste. I have been using macports. | |
| − | + | <LI>By default, all your programs installed through ports will end up in the prefix /opt/local, so add to your path | |
| − | + | <UL> | |
| + | <LI> export PATH=$PATH:/opt/local/bin | ||
| + | </UL> | ||
| − | + | <LI>Install the packages needed for SCHISM, i.e. deal with netcdf/openmpi/compiler. I have chosen clang5 as my c++, gfortran7 as fortran, and openmpi as MPI for this example | |
| − | + | <UL> | |
| − | + | <LI>port selfupdate | |
| − | + | <LI>port install openmpi-clang50 +gcc7 | |
| + | <LI>port install netcdf-fortran +gcc7 +openmpi | ||
| + | </UL> | ||
| + | <LI>Install cmake | ||
| + | <UL> | ||
| + | <LI>port install cmake | ||
| + | </UL> | ||
| + | </UL> | ||
| − | + | That should give you a build system very similar to Linux, i.e. continue with creating a build directory, running cmake with path to SCHISM/src, e.g.: | |
| − | |||
| − | + | <p></p> | |
| − | + | cd <nowiki>$BUILD_DIR</nowiki>; cmake <nowiki>$SCHISM_DIR/trunk/src</nowiki> -DNetCDF_FORTRAN_DIR=/opt/local -DCMAKE_Fortran_COMPILER=mpifort -DCMAKE_CXX_COMPILER=mpicc -DNetCDF_C_DIR=/opt/local -DTVD_LIM=SB; make pschism | |
| − | |||
Latest revision as of 20:30, 28 June 2018
Below is a recipe provided by Dr. Carsten Lemmen.
From a clean macOS (currently High Sierra), first you need to have a compiler (a clang comes with Xcode)
- Install XCode from AppStore
- Install XCode Command Line Tools from within XCode
- run xcodebuild -license and type "agree"
- Install MacPorts, i.e. install a toolchain with open source developer tools; there are at least three prominent systems that help you do this (1) fink (2) home-brew (3) macports. Either of them is probably fine and the choice is a matter of taste. I have been using macports.
- By default, all your programs installed through ports will end up in the prefix /opt/local, so add to your path
- export PATH=$PATH:/opt/local/bin
- Install the packages needed for SCHISM, i.e. deal with netcdf/openmpi/compiler. I have chosen clang5 as my c++, gfortran7 as fortran, and openmpi as MPI for this example
- port selfupdate
- port install openmpi-clang50 +gcc7
- port install netcdf-fortran +gcc7 +openmpi
- Install cmake
- port install cmake
That should give you a build system very similar to Linux, i.e. continue with creating a build directory, running cmake with path to SCHISM/src, e.g.:
cd $BUILD_DIR; cmake $SCHISM_DIR/trunk/src -DNetCDF_FORTRAN_DIR=/opt/local -DCMAKE_Fortran_COMPILER=mpifort -DCMAKE_CXX_COMPILER=mpicc -DNetCDF_C_DIR=/opt/local -DTVD_LIM=SB; make pschism