Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated/extended macOS install instructions #1297

Merged
merged 2 commits into from
Oct 14, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 32 additions & 29 deletions doc/installation/mac_install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Manual installation

The clang/clang++ compiler that ships with OS X/macOS does not support OpenMP threads and creates code that fails some tests. You therefore need to use **GCC** to compile NEST under OS X/macOS.

Installation instructions here have been tested under OS X 10.11 *El Capitan* and macOS 10.12 *Sierra* with `Anaconda Python 2 and 3 <https://www.continuum.io/anaconda-overview>`_ and all other dependencies installed via `Homebrew <http://brew.sh>`_. See below for `Manual installation with dependencies from MacPorts`_.
Installation instructions here have been tested under macOS 10.14 *Mojave* with `Anaconda Python 3 <https://www.continuum.io/anaconda-overview>`_ and all other dependencies installed via `Homebrew <http://brew.sh>`_. They should also work with earlier versions of macOS.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@heplesser Can you be more explicit here in the steps you took to create this environment?
What about the PyNEST dependencies like numpy, scipy, and matplotlib?
which order did you use (brew install then conda install) ? Do you create a conda environment before installing the dependencies?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have tried different approaches at different times, both with the full Anaconda package and miniconda plus the conda install line shown in the Python section. I did not explicitly create conda environments in all cases I tested, it worked with and without for me. Therefore I have't been more specific here.


* Install Xcode from the AppStore.

Expand Down Expand Up @@ -77,13 +77,13 @@ Installation instructions here have been tested under OS X 10.11 *El Capitan* an
mkdir bld
cd bld

* Configure and build NEST inside the build directory:
* Configure and build NEST inside the build directory (replacing `gcc-9` and `g++-9` with the GCC compiler versions you installed with `brew`):

.. code-block:: sh

cmake -DCMAKE_INSTALL_PREFIX:PATH=</install/path> \
-DCMAKE_C_COMPILER=gcc-6 \
-DCMAKE_CXX_COMPILER=g++-6 \
-DCMAKE_C_COMPILER=gcc-9 \
-DCMAKE_CXX_COMPILER=g++-9 \
</path/to/NEST/src>

.. code-block:: sh
Expand All @@ -94,34 +94,37 @@ Installation instructions here have been tested under OS X 10.11 *El Capitan* an

To compile NEST with MPI support, add ``-Dwith-mpi=ON`` as ``cmake`` option.

Manual installation with dependencies from MacPorts
"""""""""""""""""""""""""""""""""""""""""""""""""""
Troubleshooting
.................

The following should work if you install dependencies using MacPorts (only steps that differ from the instructions above are shown):

* Install dependencies via MacPorts::

sudo port install gcc6 cmake gsl openmpi-default libtool \
python27 py27-cython py27-nose doxygen

* Configure and build NEST inside the build directory
If compiling NEST as described above fails with an error message like

.. code-block:: sh

cmake -DCMAKE_INSTALL_PREFIX:PATH=</install/path> \
-DPYTHON_LIBRARY=/opt/local/lib/libpython2.7.dylib \
-DPYTHON_INCLUDE_DIR=/opt/local/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 \
-DCMAKE_C_COMPILER=/opt/local/bin/gcc-mp-6 \
-DCMAKE_CXX_COMPILER=/opt/local/bin/g++-mp-6 \
</path/to/NEST/src>

.. code-block:: sh

make -j4 # -j4 builds in parallel using 4 processes
make install
make installcheck

To compile NEST with MPI support, add ``-Dwith-mpi=ON`` as ``cmake`` option.

In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/wait.h:110,
from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdlib.h:66,
from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/cstdlib:75,
from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/bits/stl_algo.h:59,
from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/algorithm:62,
from /Users/plesser/NEST/code/src/sli/dictutils.h:27,
from /Users/plesser/NEST/code/src/sli/dictutils.cc:23:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/resource.h:443:34: error: expected initializer before '__OSX_AVAILABLE_STARTING'
443 | int getiopolicy_np(int, int) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
| ^~~~~~~~~~~~~~~~~~~~~~~~

you most likely have installed a version of XCode prepared for the next version of macOS. You can attempt to fix this by running

.. code-block:: sh

sudo xcode-select -s /Library/Developer/CommandLineTools/

If this does not help, you can reset to the default XCode path using

.. code-block:: sh

sudo xcode-select -r




Python on Mac
Expand Down