Difference between revisions of "Installation on Mac"
Schismguest (talk | contribs) |
|||
| (17 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) | ||
| Line 31: | Line 31: | ||
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.: | 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 | + | <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