-
Notifications
You must be signed in to change notification settings - Fork 124
Building Mantid on OS X 10.9 using clang and macports
This instruction considers that you either use macports or need them for your other development projects. It also considers that you need to compile Mantid by yourself. In other cases please either [download a Mantid dmg package] (http://download.mantidproject.org/) or follow the instructions how to build Mantid with homebrew. Warning: it is not recommended to have both, homebrew and macports installed simultaneously on one mac.
-
Install Xcode and macports following the instructions on https://guide.macports.org/chunked/installing.html if needed.
-
Install Mantid prerequisites via
sudo port install package_name
Mantid prerequisites can be found for example [here] (https://github.com/mantidproject/mantid/wiki/Building-Mantid-on-OS-X-10.9-&-10.10-using-clang-and-Xcode). -
Things to take care about:
- By default, POCO libraries in macports are missing libCrypto and libNetSSL. If you have the POCO libraries already installed, uninstall them:
sudo port uninstall poco
, then install as:sudo port install poco +ssl
- Install OpenCascade libraries as:
sudo port install oce -tbb
- libNeXus: macports do not contain libNeXus.
- Download the source code from the [developers website] (http://download.nexusformat.org/kits/)
- Build and install it:
You may need to install additional packages to be able to build libNeXus. 3. Warning: libNeXus must be recompiled after update of the macports if it's dependencies have been updated. Otherwise it may depend on some non-existent libraries.% ./configure --prefix=/opt/local % make % sudo make install
- jsoncpp: mantid/Code/Mantid/Framework/DataObjects/src/NoShape.cpp line 3 contains:
#include <jsoncpp/json/json.h>
but in macports there is no ‘jsoncpp’ folder in the/opt/local/include
,json.h
is located in/opt/local/include/json
. As a temporary solution, you may create a symbolic link:
% sudo mkdir /opt/local/include/jsoncpp
% cd /opt/local/include/jsoncpp
% sudo ln -s ../json
- By default, POCO libraries in macports are missing libCrypto and libNetSSL. If you have the POCO libraries already installed, uninstall them:
-
Run cmake. It may be needed to specify the compiler as well as the path to include files. I use the following cmake options:
cmake -DCMAKE_C_COMPILER=/usr/bin/clang \
-DCMAKE_CXX_COMPILER=/usr/bin/clang++ -G 'Unix Makefiles' \
-DCMAKE_PREFIX_PATH=/opt/local \
-DCMAKE_BUILD_TYPE=Release \
-DENABLE_CPACK=True \
-DPOCO_INCLUDE_DIR=/opt/local/include \
-DQWTPLOT3D_INCLUDE_DIR=/opt/local/include/qwtplot3d \
-DJSONCPP_INCLUDE_DIR=/opt/local/include \
-DOPENCASCADE_INCLUDE_DIR=/opt/local/include/oce \
-DPYTHON_INCLUDE_DIR=/opt/local/Library/Frameworks/Python.framework/Headers \
-DSIP_INCLUDE_DIR=/opt/local/Library/Frameworks/Python.framework/Headers \
-DPYTHON_NUMPY_INCLUDE_DIR=/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include \
-DPYTHON_EXECUTABLE=/opt/local/bin/python \
-DPYLINT_EXECUTABLE=/opt/local/bin/pylint-2.7 \
-DSPHINX_EXECUTABLE=/opt/local/bin/sphinx-build-2.7 \
-DPACKAGE_DOCS=FALSE \
-DDOCS_HTML=TRUE \
-DPYQT4_PATH=/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/PyQt4 \
-DSITEPACKAGES_PATH=/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages \
-DOPENSSL_ROOT_DIR=/opt/local \
-DMAKE_VATES=FALSE \
-DMACPORTS=TRUE \
-DCMAKE_INSTALL_PREFIX=path_where_to_install_mantid /path_to_repository/mantid/Code/Mantid
-
Pay attention that packaging of the documentation is switched off. I did not manage to build it for the moment.
-
Build mantid running
make
ormake -j number_of_threads
-
You may create the dmg package running the
make package
command -
You may also install Mantid using the
make install
command. Warning: if you do not want to install Mantid in /Applications, correct the CMAKE_INSTALL_PREFIX in the cmake_install.cmake file in your build directory.
Starting from Mantid 3.4, it is possible to build it with VATES support using macports.
-
Build Paraview using the [following instruction] (http://www.mantidproject.org/Building_VATES).
-
Set cmake option
-DMAKE_VATES=TRUE
-
Set path to the paraview build directory:
-DParaView_DIR=/put_your_path_here
-
Run steps 6-7(8) to build/install Mantid