-
Notifications
You must be signed in to change notification settings - Fork 0
/
BuildingOnOSXHistoric.html
545 lines (505 loc) · 30.5 KB
/
BuildingOnOSXHistoric.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
<title>Building on Older Versions of OS X</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="_static/bootstrap-sphinx.css" />
<link rel="stylesheet" type="text/css" href="_static/custom.css" />
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/sphinx_highlight.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Building with CMake" href="BuildingWithCMake.html" />
<link rel="prev" title="Building on OS X" href="BuildingOnOSX.html" />
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-59110517-1', 'auto');
ga('send', 'pageview');
</script>
</head><body>
<div id="navbar" class="navbar navbar-default ">
<div class="container">
<div class="navbar-header">
<!-- .btn-navbar is used as the toggle for collapsed navbar content -->
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="http://www.mantidproject.org"><img src="_static/Mantid_Logo_Transparent.png">
</a>
<span class="navbar-text navbar-version pull-left"><b>master</b></span>
</div>
<div class="collapse navbar-collapse nav-collapse">
<ul class="nav navbar-nav">
<li class="divider-vertical"></li>
<li><a href="index.html">Home</a></li>
<li><a href="http://download.mantidproject.org">Download</a></li>
<li><a href="http://www.mantidproject.org">Wiki</a></li>
<li><a href="http://docs.mantidproject.org">User Documentation</a></li>
<li><a href="http://www.mantidproject.org/Contact">Contact Us</a></li>
</ul>
<form class="navbar-form navbar-right" action="search.html" method="get">
<div class="form-group">
<input type="text" name="q" class="form-control" placeholder="Search" />
</div>
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="body col-md-12 content" role="main">
<section id="building-on-older-versions-of-os-x">
<span id="buildingonosxhistoric"></span><h1>Building on Older Versions of OS X<a class="headerlink" href="#building-on-older-versions-of-os-x" title="Permalink to this heading">¶</a></h1>
<nav class="contents local" id="contents">
<ul class="simple">
<li><p><a class="reference internal" href="#os-x-10-9-using-clang-and-macports" id="id1">OS X 10.9 using clang and macports</a></p>
<ul>
<li><p><a class="reference internal" href="#instruction" id="id2">Instruction</a></p>
<ul>
<li><p><a class="reference internal" href="#os-x-10-10-and-10-11-using-clang-and-xcode" id="id3">OS X 10.10 and 10.11 using clang and Xcode</a></p></li>
</ul>
</li>
<li><p><a class="reference internal" href="#troubleshooting" id="id4">Troubleshooting</a></p>
<ul>
<li><p><a class="reference internal" href="#os-x-10-12" id="id5">OS X 10.12</a></p></li>
</ul>
</li>
</ul>
</li>
</ul>
</nav>
<p>These instructions are provided as reference for building on older versions of OSX. They almost certainly won’t work with the latest version of mantid.
See <a class="reference internal" href="BuildingOnOSX.html#buildingonosx"><span class="std std-ref">Building on OS X</span></a> for the latest instructions.</p>
<section id="os-x-10-9-using-clang-and-macports">
<h2><a class="toc-backref" href="#id1" role="doc-backlink">OS X 10.9 using clang and macports</a><a class="headerlink" href="#os-x-10-9-using-clang-and-macports" title="Permalink to this heading">¶</a></h2>
<p><em>Disclaimer</em></p>
<p>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 <a class="reference external" href="http://download.mantidproject.org/">download a Mantid dmg package</a> or follow the instructions below. Warning:
it is not recommended to have both, homebrew and macports installed simultaneously on one mac.</p>
<section id="instruction">
<h3><a class="toc-backref" href="#id2" role="doc-backlink">Instruction</a><a class="headerlink" href="#instruction" title="Permalink to this heading">¶</a></h3>
<ol class="arabic simple">
<li><p>Install Xcode and macports following the instructions on <a class="reference external" href="https://guide.macports.org/chunked/installing.html">https://guide.macports.org/chunked/installing.html</a> if needed.</p></li>
<li><p>Install Mantid prerequisites via <code class="docutils literal notranslate"><span class="pre">sudo</span> <span class="pre">port</span> <span class="pre">install</span> <span class="pre">package_name</span></code></p></li>
<li><p>Things to take care about:</p></li>
</ol>
<ul>
<li><p>By default, POCO libraries in macports are missing libCrypto and libNetSSL. If you have the POCO libraries already installed, uninstall them: <code class="docutils literal notranslate"><span class="pre">sudo</span> <span class="pre">port</span> <span class="pre">uninstall</span> <span class="pre">poco</span></code>, then install as: <code class="docutils literal notranslate"><span class="pre">sudo</span> <span class="pre">port</span> <span class="pre">install</span> <span class="pre">poco</span> <span class="pre">+ssl</span></code>.</p></li>
<li><p>Install OpenCascade libraries as: <code class="docutils literal notranslate"><span class="pre">sudo</span> <span class="pre">port</span> <span class="pre">install</span> <span class="pre">oce</span> <span class="pre">-tbb</span></code>.</p></li>
<li><p>libNeXus: macports do not contain libNeXus.</p>
<ol class="arabic">
<li><p>Download the source code from the <a class="reference external" href="http://download.nexusformat.org/kits/">NeXus developers website</a>.</p></li>
<li><p>Build and install it:</p>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span> % ./configure --prefix<span class="o">=</span>/opt/local
% make
% sudo make install
You may need to install additional packages to be able to build libNeXus.
</pre></div>
</div>
</li>
<li><p>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.</p></li>
</ol>
</li>
<li><p>jsoncpp: <code class="docutils literal notranslate"><span class="pre">mantid/Code/Mantid/Framework/DataObjects/src/NoShape.cpp</span></code> line 3 contains: <code class="docutils literal notranslate"><span class="pre">#include</span> <span class="pre"><jsoncpp/json/json.h></span></code> but in macports there is no <code class="docutils literal notranslate"><span class="pre">jsoncpp</span></code> folder in the <code class="docutils literal notranslate"><span class="pre">/opt/local/include</span></code>, <code class="docutils literal notranslate"><span class="pre">json.h</span></code> is located in <code class="docutils literal notranslate"><span class="pre">/opt/local/include/json</span></code>. As a temporary solution, you may create a symbolic link:</p>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>% sudo mkdir /opt/local/include/jsoncpp
% <span class="nb">cd</span> /opt/local/include/jsoncpp
% sudo ln -s ../json
</pre></div>
</div>
</li>
</ul>
<ol class="arabic simple" start="4">
<li><p>Run cmake. It may be needed to specify the compiler as well as the path to include files. I use the following cmake options:</p></li>
</ol>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>cmake -DCMAKE_C_COMPILER<span class="o">=</span>/usr/bin/clang <span class="se">\</span>
-DCMAKE_CXX_COMPILER<span class="o">=</span>/usr/bin/clang++ -G <span class="s1">'Unix Makefiles'</span> <span class="se">\</span>
-DCMAKE_PREFIX_PATH<span class="o">=</span>/opt/local <span class="se">\</span>
-DCMAKE_BUILD_TYPE<span class="o">=</span>Release <span class="se">\</span>
-DENABLE_CPACK<span class="o">=</span>True <span class="se">\</span>
-DPOCO_INCLUDE_DIR<span class="o">=</span>/opt/local/include <span class="se">\</span>
-DQWTPLOT3D_INCLUDE_DIR<span class="o">=</span>/opt/local/include/qwtplot3d <span class="se">\</span>
-DJSONCPP_INCLUDE_DIR<span class="o">=</span>/opt/local/include <span class="se">\</span>
-DOPENCASCADE_INCLUDE_DIR<span class="o">=</span>/opt/local/include/oce <span class="se">\</span>
-DPYTHON_INCLUDE_DIR<span class="o">=</span>/opt/local/Library/Frameworks/Python.framework/Headers <span class="se">\</span>
-DSIP_INCLUDE_DIR<span class="o">=</span>/opt/local/Library/Frameworks/Python.framework/Headers <span class="se">\</span>
-DPYTHON_NUMPY_INCLUDE_DIR<span class="o">=</span>/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include <span class="se">\</span>
-DPYTHON_EXECUTABLE<span class="o">=</span>/opt/local/bin/python <span class="se">\</span>
-DPYLINT_EXECUTABLE<span class="o">=</span>/opt/local/bin/pylint-2.7 <span class="se">\</span>
-DSPHINX_EXECUTABLE<span class="o">=</span>/opt/local/bin/sphinx-build-2.7 <span class="se">\</span>
-DPACKAGE_DOCS<span class="o">=</span>FALSE <span class="se">\</span>
-DDOCS_HTML<span class="o">=</span>TRUE <span class="se">\</span>
-DPYQT4_PATH<span class="o">=</span>/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/PyQt4 <span class="se">\</span>
-DSITEPACKAGES_PATH<span class="o">=</span>/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages <span class="se">\</span>
-DOPENSSL_ROOT_DIR<span class="o">=</span>/opt/local <span class="se">\</span>
-DMACPORTS<span class="o">=</span>TRUE <span class="se">\</span>
-DCMAKE_INSTALL_PREFIX<span class="o">=</span>path_where_to_install_mantid /path_to_repository/mantid/Code/Mantid
</pre></div>
</div>
<ol class="arabic simple" start="5">
<li><p>Pay attention that packaging of the documentation is switched off. I did not manage to build it for the moment.</p></li>
<li><p>Build mantid running <code class="docutils literal notranslate"><span class="pre">make</span></code> or <code class="docutils literal notranslate"><span class="pre">make</span> <span class="pre">-j</span> <span class="pre">number_of_threads</span></code></p></li>
<li><p>You may create the dmg package running the <code class="docutils literal notranslate"><span class="pre">make</span> <span class="pre">package</span></code> command</p></li>
<li><p>You may also install Mantid using the <code class="docutils literal notranslate"><span class="pre">make</span> <span class="pre">install</span></code> command. <em>Warning</em>: if you do not want to install Mantid in /Applications, correct the CMAKE_INSTALL_PREFIX in the <code class="docutils literal notranslate"><span class="pre">cmake_install.cmake</span></code> file in your build directory.</p></li>
</ol>
<section id="os-x-10-10-and-10-11-using-clang-and-xcode">
<h4><a class="toc-backref" href="#id3" role="doc-backlink">OS X 10.10 and 10.11 using clang and Xcode</a><a class="headerlink" href="#os-x-10-10-and-10-11-using-clang-and-xcode" title="Permalink to this heading">¶</a></h4>
<p>These instructions are from the assumptions of a blank newly installed Mac and want to use the system python. Other python distributions may work but have not been tested.</p>
<ol class="arabic simple">
<li><p>First install Xcode and then clone the mantid git repository.</p></li>
</ol>
<ul class="simple">
<li><p>The last version to support OS X Mavericks is Xcode 6.2</p></li>
<li><p>The last version to support OS X Yosemite is Xcode 7.2.1</p></li>
<li><p>As of August 1, 2016, our OS X El Capitan build server is running Xcode 7.3.1</p></li>
</ul>
<ol class="arabic simple" start="2">
<li><p>Install Apple’s Command Line tools (without this then /usr/include will not exist)</p></li>
</ol>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>xcode-select --install
</pre></div>
</div>
<ol class="arabic simple" start="2">
<li><p>Install <a class="reference external" href="http://brew.sh">Homebrew</a>. If you already have Homebrew and are upgrading the OS follow the <a class="reference external" href="http://ryantvenge.com/2014/09/ruby-homebrea-yosemite/">instructions here</a>:</p></li>
</ol>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>ruby -e <span class="s2">"</span><span class="k">$(</span>curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install<span class="k">)</span><span class="s2">"</span>
</pre></div>
</div>
<ol class="arabic simple" start="3">
<li><p>Add the necessary ‘taps’. The last 4 are to use qt4.</p></li>
</ol>
<p>In order to be able to ‘tap’ the <code class="docutils literal notranslate"><span class="pre">mantidproject/mantid</span></code> ‘tap’ we need to have a couple of packages installed</p>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>brew install git
brew install git-lfs
brew tap homebrew/science
brew tap mantidproject/mantid
brew tap caskroom/cask
brew tap cartr/qt4
brew tap-pin cartr/qt4
</pre></div>
</div>
<ol class="arabic simple" start="5">
<li><p>Install required dependencies (will make a mantid-developer formula soon)
If you plan on distributing your application bundle, change <code class="docutils literal notranslate"><span class="pre">brew</span> <span class="pre">install</span></code> to <code class="docutils literal notranslate"><span class="pre">brew</span> <span class="pre">install</span> <span class="pre">--build-bottle</span></code></p></li>
</ol>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>brew cask install xquartz
<span class="c1"># mactex is optional, needed for parsing equations in qthelp documentation.</span>
brew cask install mactex
brew install openssl
brew install cmake
brew install qt@4 --with-qt3support --build-bottle
<span class="c1"># sip,pyqt and qscintilla2 bring in homebrew's python if</span>
<span class="c1"># installed with --build-bottle. And add --build-from-source.</span>
brew install sip --build-from-source --without-python3
brew install pyqt@4 --build-from-source --without-python3
brew install qscintilla2qt4 --build-from-source
brew install qt --build-bottle
brew install pyqt --build-from-source
brew install qscintilla2 --build-from-source --without-python3
brew install poco --c++11
brew install boost --c++11
<span class="c1"># boost-python brings in homebrew's python if installed with --build-bottle.</span>
brew install boost-python --c++11 --build-from-source
brew install gsl
brew install hdf5 --c++11
brew install libmxml
brew install muparser
<span class="c1">#Several unit tests fail with NeXus v4.4.2</span>
<span class="c1">#https://github.com/mantidproject/mantid/issues/17001</span>
brew install nexusformat --c++11
brew install jsoncpp
brew install tbb --c++11
brew install opencascade --build-bottle
brew install qwt5
brew install qwtplot3d
brew install google-perftools
brew install librdkafka
</pre></div>
</div>
<ol class="arabic simple" start="6">
<li><p>Uninstall homebrew Python that some of the dependencies insist on installing</p></li>
</ol>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>brew uninstall python
</pre></div>
</div>
<ol class="arabic simple" start="6">
<li><p>Optional: for cmake-gui</p></li>
</ol>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>brew cask install cmake
</pre></div>
</div>
<ol class="arabic simple" start="7">
<li><p>Now to install the other python package dependencies:</p></li>
</ol>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>sudo easy_install pip
sudo -H pip install sphinx
<span class="c1"># https://github.com/mantidproject/mantid/issues/13481</span>
sudo -H pip install <span class="s2">"ipython[notebook]==3.2.1"</span>
<span class="c1"># qtconsole only required with ipython 4+</span>
<span class="c1">#sudo -H pip install qtconsole</span>
sudo -H pip install qtpy
sudo -H pip install pygments
sudo -H pip install pyzmq
sudo -H pip install pycifrw
<span class="c1"># Version matches Windows/RHEL/Ubuntu (trusty)</span>
sudo -H pip install <span class="nv">PyYAML</span><span class="o">==</span><span class="m">3</span>.10
<span class="c1"># Version matches Windows/RHEL/Ubuntu (trusty)</span>
sudo -H pip install <span class="nv">mock</span><span class="o">==</span><span class="m">1</span>.0.1
sudo -H pip install <span class="nv">requests</span><span class="o">==</span><span class="m">2</span>.9.1
</pre></div>
</div>
<ol class="arabic simple" start="8">
<li><p>Install the theme for sphinx</p></li>
</ol>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>sudo pip install sphinx_bootstrap_theme
</pre></div>
</div>
<ol class="arabic simple" start="9">
<li><p>Install other python dependencies</p></li>
</ol>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>sudo pip install psutil
brew install h5py
</pre></div>
</div>
<ol class="arabic simple" start="9">
<li><p>Add Homebrew’s site-packages to your python path.</p></li>
</ol>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>mkdir -p ~/Library/Python/2.7/lib/python/site-packages
<span class="nb">echo</span> <span class="s1">'/usr/local/lib/python2.7/site-packages'</span> > ~/Library/Python/2.7/lib/python/site-packages/homebrew.pth
</pre></div>
</div>
<ol class="arabic simple" start="10">
<li><p>Now you need to patch a header in your python!</p></li>
</ol>
<ul>
<li><p>If building on the command line with make or ninja.</p>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span><span class="nb">cd</span> /usr/include/python2.7
</pre></div>
</div>
<p>or</p>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span><span class="nb">cd</span> /System/Library/Frameworks/Python.framework/Headers
</pre></div>
</div>
<p>then</p>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>sudo cp pyport.h pyport.h.original
sudo patch pyport.h <span class="nv">$MANTIDCHECKOUTROOT</span>/buildconfig/pyport.patch
</pre></div>
</div>
</li>
<li><p>If building with Xcode on OS X Yosemite</p>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span><span class="nb">cd</span> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7
</pre></div>
</div>
<p>then</p>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>sudo cp pyport.h pyport.h.original
sudo patch pyport.h <span class="nv">$MANTIDCHECKOUTROOT</span>/buildconfig/pyport.patch
</pre></div>
</div>
<p><strong>Note</strong>: If Xcode updates for any reason, the patch will be lost.</p>
</li>
</ul>
<ol class="arabic" start="11">
<li><p>Now run CMake and select the Xcode generator with the default native compilers.</p></li>
<li><p>Now open the project in Xcode (doing this from the command line to ensure the PYTHONPATH is correctly picked up by Xcode).</p>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span><span class="nb">cd</span> /path/to/my/build/dir
open Mantid.xcodeproj
</pre></div>
</div>
</li>
</ol>
</section>
</section>
<section id="troubleshooting">
<h3><a class="toc-backref" href="#id4" role="doc-backlink">Troubleshooting</a><a class="headerlink" href="#troubleshooting" title="Permalink to this heading">¶</a></h3>
<ol class="arabic simple">
<li><p>The main problem that can arise is due to python path issues. This usually either arises at the CMake or Run from Xcode steps. It is because the PYTHONPATH is not being picked up.</p></li>
<li><p>If you have upgraded to Mavericks (OS X 10.9) from a previous version of OS X with homebrew already installed then you may encounter some issues related to the fact that the default std lib has changed. The easiest way to avoid this is to remove and then re-install all your formulas.</p></li>
<li><p>You may find that if you build the <code class="docutils literal notranslate"><span class="pre">MantidPlot</span></code> target then you will get errors when you run, such as <em>Can’t start python</em> and <em>Cannot load Curve Fitting Plugins</em>, this is due to the fact that the MantidPlot target does not contain all the dependencies. You are best, if you are unsure of the hierarchy, to just use the ALL_BUILD target and then just switch to the MantidPlot target in order to run.</p></li>
<li><p>NOTE that you might need to run <code class="docutils literal notranslate"><span class="pre">./MantidPlot.app/Contents/MacOS/MantidPlot</span></code> from the <code class="docutils literal notranslate"><span class="pre">BUILD-DIR/bin</span></code> (instead of <code class="docutils literal notranslate"><span class="pre">open</span> <span class="pre">MantidPlot.app</span></code> OR <code class="docutils literal notranslate"><span class="pre">./MantidPlot</span></code> from <code class="docutils literal notranslate"><span class="pre">BUILD-DIR/bin/MantidPlot.app/Contents/MacOS/</span></code>) to get the library paths correct. Otherwise the issues above might show up (at least on OS X 10.11 El Capitan).</p></li>
<li><p>Upgrading HDF5 requires also rebuilding nexusformat, and h5py.</p></li>
</ol>
<section id="os-x-10-12">
<h4><a class="toc-backref" href="#id5" role="doc-backlink">OS X 10.12</a><a class="headerlink" href="#os-x-10-12" title="Permalink to this heading">¶</a></h4>
<p>The following instructions setup the build environment for mantid using clang compiler and python provided by the system, and all the other dependencies installed with brew. The drawback is that one has little control over python version and OpenMP will not be found. Make sure you have Qt Creator IDE and optionally cmake (GUI) app installed.</p>
<ol class="arabic simple">
<li><p>Install Xcode from AppStore</p></li>
<li><p>Install Xcode command line tools</p></li>
</ol>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>xcode-select --install
</pre></div>
</div>
<ol class="arabic simple" start="3">
<li><p>Install home-brew package manager</p></li>
</ol>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>ruby -e <span class="s2">"</span><span class="k">$(</span>curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install<span class="k">)</span><span class="s2">"</span>
</pre></div>
</div>
<ol class="arabic simple" start="4">
<li><p>Add the necessary ‘taps’</p></li>
</ol>
<p>In order to be able to ‘tap’ the <cite>mantidproject/mantid</cite> ‘tap’ we need to have a couple of packages installed</p>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>brew install git
brew install git-lfs
brew tap mantidproject/mantid
brew tap caskroom/cask
brew tap cartr/qt4
brew tap-pin cartr/qt4
</pre></div>
</div>
<ol class="arabic simple" start="5">
<li><p>Install the necessary dependencies. Note that some of these will bring brew python with them as dependency.</p></li>
</ol>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>brew cask install xquartz
brew cask install mactex
brew install openssl
brew install cmake
brew install ninja --without-test
brew install qt@4 --build-bottle
brew install sip --build-from-source --without-python
brew install pyqt@4 --build-from-source
brew install qscintilla2qt4 --build-from-source --without-python
brew install qt --build-bottle
brew install pyqt --build-from-source
brew install qscintilla2 --build-from-source --without-python
brew install poco
brew install boost --c++11
brew install boost-python --c++11 --build-from-source
brew install gsl
brew install gcc
brew install hdf5 --c++11
brew install libmxml
brew install muparser
brew install nexusformat --c++11
brew install jsoncpp
brew install tbb --c++11
brew install opencascade --build-bottle
brew install qwt5
brew install qwtplot3d
brew install google-perftools
brew install librdkafka
</pre></div>
</div>
<p>If, while configuring Mantid, cmake complains that it cannot find sip, uninstall the package by <code class="docutils literal notranslate"><span class="pre">brew</span> <span class="pre">uninstall</span> <span class="pre">--ignore-dependencies</span> <span class="pre">sip</span></code>, reinstall it using the line above and follow the instructions on how to add Homebrew’s site-packages to Python <code class="docutils literal notranslate"><span class="pre">sys.path</span></code>.</p>
<ol class="arabic simple" start="6">
<li><p>Uninstall the brew python if it has been previously installed</p></li>
</ol>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>brew uninstall --ignore-dependencies python3
</pre></div>
</div>
<ol class="arabic simple" start="7">
<li><p>Install pip python package manager</p></li>
</ol>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>sudo easy_install pip
</pre></div>
</div>
<ol class="arabic simple" start="8">
<li><p>Install necessary python packages with pip</p></li>
</ol>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>sudo -H pip install sphinx --ignore-installed
sudo -H pip install <span class="s2">"ipython[notebook]==3.2.1"</span>
sudo -H pip install qtpy
sudo -H pip install pycifrw
sudo -H pip install <span class="nv">PyYAML</span><span class="o">==</span><span class="m">3</span>.10
sudo -H pip install <span class="nv">mock</span><span class="o">==</span><span class="m">1</span>.0.1
sudo pip install sphinx_bootstrap_theme
sudo pip install psutil
sudo pip install <span class="s2">"matplotlib>=2.1.2"</span>
sudo pip install <span class="nv">requests</span><span class="o">==</span><span class="m">2</span>.9.1
</pre></div>
</div>
<ol class="arabic simple" start="9">
<li><p>Install h5py</p></li>
</ol>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>brew install h5py
</pre></div>
</div>
<ol class="arabic simple" start="10">
<li><p>Add Homebrew’s site-packages to your python path.</p></li>
</ol>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>mkdir -p ~/Library/Python/2.7/lib/python/site-packages
<span class="nb">echo</span> <span class="s1">'/usr/local/lib/python2.7/site-packages'</span> > ~/Library/Python/2.7/lib/python/site-packages/homebrew.pth
</pre></div>
</div>
<ol class="arabic" start="11">
<li><p>Git clone the mantid repository</p></li>
<li><p>Disable the system integrity protection (SIP). To do this</p>
<ul>
<li><p>restart the computer</p></li>
<li><p>before the apple logo appears press <cite>Command+R</cite> to enter the recovery mode</p></li>
<li><p>when in recovery mode, go to <cite>Utilities>Terminal</cite> and type</p>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>csrutil disable
</pre></div>
</div>
</li>
<li><p>reboot again</p></li>
</ul>
</li>
<li><p>Now that SIP is disabled we can do the necessary patch:</p></li>
</ol>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span><span class="nb">cd</span> /usr/include/python2.7
sudo cp pyport.h pyport.h.original
sudo patch pyport.h <span class="nv">$MANTIDCHECKOUTROOT</span>/buildconfig/pyport.patch
</pre></div>
</div>
<ol class="arabic simple" start="14">
<li><p>Enable again the system integrity protection by repeating Step 12 and typing this time:</p></li>
</ol>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>csrutil <span class="nb">enable</span>
</pre></div>
</div>
<ol class="arabic simple" start="15">
<li><p>Open mantid project from Qt Creator, and you should be able to run cmake and build, given the right environment:</p></li>
</ol>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span><span class="nv">CC</span><span class="o">=</span>/usr/bin/clang
<span class="nv">CXX</span><span class="o">=</span>/usr/bin/clang++
<span class="nv">PATH</span><span class="o">=</span>/usr/local/bin/:<span class="nv">$PATH</span>
</pre></div>
</div>
<p>Local bin contains the symlink to the brew packages, which have to come first in path, before <cite>/usr/bin</cite>. That’s why it is important not to have python or clang (with this setup) in brew.</p>
<ol class="arabic simple" start="16">
<li><p>Add to your <cite>.profile</cite></p></li>
</ol>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span><span class="nb">export</span> <span class="nv">PYTHONPATH</span><span class="o">=</span><span class="nv">$BUILDMANTID</span>/bin
</pre></div>
</div>
<ol class="arabic simple" start="17">
<li><p>You should now be able to mantid.</p></li>
</ol>
</section>
</section>
</section>
</section>
</div>
</div>
</div>
<footer class="footer">
<div class="container">
<ul class="nav navbar-nav" style=" float: right;">
<li>
<a href="BuildingOnOSX.html" title="Previous Chapter: Building on OS X"><span class="glyphicon glyphicon-chevron-left visible-sm"></span><span class="hidden-sm hidden-tablet">« Building on OS X</span>
</a>
</li>
<li>
<a href="BuildingWithCMake.html" title="Next Chapter: Building with CMake"><span class="glyphicon glyphicon-chevron-right visible-sm"></span><span class="hidden-sm hidden-tablet">Building with CMake »</span>
</a>
</li>
<li><a href="#">Back to top</a></li>
</ul>
<p>
</p>
</div>
</footer>
</body>
</html>