From e9cdd2a8fbadf2757a220bb261e950fe5580d517 Mon Sep 17 00:00:00 2001
From: Stefan Bienert <stefan.bienert@unibas.ch>
Date: Mon, 24 Jun 2019 14:23:14 +0200
Subject: [PATCH] SCHWED-3977: Updated macOS build instructions.

---
 modules/doc/install.rst | 52 ++++++++++++++++++++++++++---------------
 1 file changed, 33 insertions(+), 19 deletions(-)

diff --git a/modules/doc/install.rst b/modules/doc/install.rst
index 8bb1f03db..c97209521 100644
--- a/modules/doc/install.rst
+++ b/modules/doc/install.rst
@@ -24,8 +24,8 @@ the steps which we describe in detail below. In essence, these steps are:
 Installing the Dependencies
 --------------------------------------------------------------------------------
 
-OpenStructure uses a bunch of OpenSource libraries. If you haven't already
-installed them, please install them now! Where appropriate the minimally
+OpenStructure uses a bunch of open-source libraries. If you haven't already
+installed them, please install them now! Where appropriate, the minimally
 required version is given in parentheses.
 
 * `CMake <http://cmake.org>`_ (2.6.4)
@@ -116,7 +116,7 @@ cmake. You can do that by invoking `cmake` in the project directory.
 There are two kinds of options: Options that let you control the building
 behaviour, enabling and disabling the compilation of certain modules and options
 that let you tell CMake where to find the dependencies. All of them are passed
-to CMake with via `-D<opt>=<value>`.
+to CMake via `-D<opt>=<value>`.
 
 
 Flag to choose build generator
@@ -124,8 +124,8 @@ Flag to choose build generator
 
 CMake supports different build generators. On UNIX, i.e. macOS and Linux, the
 default build generator is Makefiles, but it is also possible to use other
-programs. For a list of supported build generators on your platform, start cmake
-without parameters.
+programs. For a list of supported build generators on your platform, run
+`cmake` without parameters.
 
 
 .. _cmake-flags:
@@ -227,7 +227,7 @@ can influence it.
 Build Options
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-* `OPTIMIZE` can be switched on to build an optimized (-O3 -DNDEBUG) version of
+* `OPTIMIZE` can be switched on to build an optimised (-O3 -DNDEBUG) version of
   OpenStructure. By default, this is switched off.
 
 * `USE_DOUBLE_PRECISION` will switch on double precision within OpenStructure. 
@@ -262,10 +262,10 @@ Build Options
 Example Configurations
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-**Generic linux without GUI**
+**Generic Linux without GUI**
 
 The simplest way to compile OpenStructure is to disable the GUI and any
-dependency to Qt5. You can build an optimized OpenStructure without GUI as
+dependency to Qt5. You can build an optimised OpenStructure without GUI as
 follows:
 
 .. code-block:: bash
@@ -303,7 +303,7 @@ All the dependencies can be installed from the package manager as follows:
 Now, all dependencies are located in standard locations and cmake will
 automatically find them without the need to pass any additional parameters. The
 only exception is the Python library which is put in a different path than
-expected. Also, we add -DOPTIMIZE, which will tell cmake to build an optimized
+expected. Also, we add -DOPTIMIZE, which will tell cmake to build an optimised
 version of OpenStructure.
 
 .. code-block:: bash
@@ -312,22 +312,31 @@ version of OpenStructure.
           -DOPTIMIZE=ON
 
 
-**macOS with Homebrew without GUI**
+**macOS (High Sierra) with Homebrew**
+
+`Homebrew <https://brew.sh/>`_ can be used to conveniently install all
+dependencies. The current Boost version, as of writing these instructions, is
+1.70.0 but works so far. Do not forget to also install `boost-python`.
+
+Before running CMake, an environment variable needs to be set on the command line. If omitted, 
+the linker will throw a bunch of warnings later:
+
+.. code-block:: bash
+
+  export SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk
 
-`Homebrew <https://brew.sh/>`_ can be used to conveniently install all packages
-on macOS. Unfortunately, Qt4 is not (officially) supported on macOS Sierra (and
-newer). Hence, it is not possible to build OpenStructure with GUI support there.
 Homebrew installs all the software under /usr/local. Thus we have to tell cmake
 where to find Boost and Python. Also the Python headers and libraries are not
-located as they are on linux and hence they must be specified too:
+located as they are on Linux and hence they must be specified too:
 
 .. code-block:: bash
-  
-  cmake . -DPYTHON_INCLUDE_PATH=/usr/local/opt/python/Frameworks/Python.framework/Headers \
-          -DPYTHON_LIBRARIES=/usr/local/opt/python/Frameworks/Python.framework/Python \
-          -DBOOST_ROOT=/usr/local -DPYTHON_ROOT=/usr/local \
-          -DSYS_ROOT=/usr/local -DENABLE_INFO=OFF -DOPTIMIZE=ON
 
+  cmake . -DPYTHON_INCLUDE_PATH=/usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/include/python2.7 \
+          -DPYTHON_LIBRARIES=/usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib \
+          -DPYTHON_ROOT=/usr/local/ \
+          -DBOOST_ROOT=/usr/local \
+          -DSYS_ROOT=/usr/local \
+          -DOPTIMIZE=ON
 
 Building the Project
 --------------------------------------------------------------------------------
@@ -364,3 +373,8 @@ To get the newest changes from the central git repository, enter
 
 in your terminal. This will fetch the newest changes.
 
+
+..  LocalWords:  Homebrew cmake CMake zlib SQLite FFTW libtiff libpng PyQt
+..  LocalWords:  SSL macOS Makefiles PDB qmake PNG libz libsqlite OPTIMIZE
+..  LocalWords:  DNDEBUG RPATH rpath SHADER shader SPNAV DConnexion profiler
+..  LocalWords:  DOPTIMIZE DENABLE DOPEN DPYTHON DBOOST DSYS
-- 
GitLab