Project

General

Profile

Preparing a Mac machine for Bilder » History » Version 31

John Cary, 02/14/2018 07:25 AM

1 2 Redmine Admin
# Preparing a Mac machine for Bilder #
2 1 Redmine Admin
3 24 John Cary
__If all you need is python and sphinx__ (e.g., for builds of documentation), then you need only
4
5
* XCode with command line tools
6
* Latex installed as noted below
7
8
and then you can add the arguments,  -W python, and your installed Python and CMake will be used if your path is correct.
9
10
11 2 Redmine Admin
## Bilder on Darwin ##
12 1 Redmine Admin
13 16 John Cary
Darwin comes with bash, so it is Bilder ready for the most part.
14 1 Redmine Admin
15 16 John Cary
### OS X Versions ###
16 1 Redmine Admin
17 16 John Cary
Yosemite's XCode that supports C++ 11 by default.
18 1 Redmine Admin
19 16 John Cary
El Capitan's clang compiler supports OpenMP.
20
21 1 Redmine Admin
## Case insensitive file system ##
22
23
We have noted and filed bugs for CMake errors on OS X when using the case-sensitive file system. To fix we use the case-insensitive file system. There may be problems with various packages and the case-insensitive file system.
24
25 2 Redmine Admin
## C and C++ compilers and Xcode command line tools ##
26 1 Redmine Admin
27
Install Xcode. To obtain version 6, visit https://developer.apple.com/xcode/download, then at the bottom third of the page, click on the "Additional Tools" link . Sign in with your Apple ID.  
28
29
~~~~~~
30 31 John Cary
sudo xcode-select --install
31 1 Redmine Admin
~~~~~~
32
33
## HomeBrew ##
34
35
One must select a non-OSX package manager for some additional packages. The candidates are HomeBrew, MacPorts, and Fink, with the HomeBrew being our recommendation at this time, as it is active, and it has the philosophy of not building extraneous stuff that is already present on OSX, which MacPorts tends to do, thus using up more disk space.  HomeBrew also installs packages in their own subdirs with links to other places in /opt, thus making removal a matter removing a directory and then removing broken links in /opt/homebrew.
36
37 14 John Cary
HomeBrew requires that one not have root privileges.  So we make the directory into which we can write:
38 1 Redmine Admin
39
~~~~~~
40 29 John Cary
sudo -s
41
mkdir -p /opt/homebrew
42
chgrp -R admin /opt
43
chmod -R 775 /opt
44
chmod -R 2775 /opt/homebrew
45
exit
46 14 John Cary
~~~~~~
47
48
and then we work as nonroot:
49
50
~~~~~~
51 29 John Cary
cd /opt
52
curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C homebrew
53
chmod -R a+rX /opt/homebrew
54
find /opt/homebrew -type l -exec chmod -h a+r '{}' \;
55 14 John Cary
~~~~~~
56 1 Redmine Admin
57 15 John Cary
and finally as root to pick up the paths by default:
58 14 John Cary
59 1 Redmine Admin
~~~~~~
60 29 John Cary
sudo -s
61
echo "/opt/homebrew/bin" > /etc/paths.d/homebrew
62
echo "/opt/homebrew/share/man" > /etc/manpaths.d/homebrew
63
chmod a+r /etc/paths.d/homebrew /etc/manpaths.d/homebrew
64
exit
65 1 Redmine Admin
~~~~~~
66
67
Get the required packages...
68
69
~~~~~~
70 29 John Cary
brew install gnupg libpng freetype gd ghostscript
71 1 Redmine Admin
~~~~~~
72
73 16 John Cary
Nice to have:
74 1 Redmine Admin
75 16 John Cary
~~~~~~
76 29 John Cary
brew install imagemagick
77 16 John Cary
~~~~~~
78
79 25 David Howdle
For Qt5:
80
81
~~~~~~
82 29 John Cary
brew install bison flex gperf libcapn
83 25 David Howdle
~~~~~~
84
85
If you receive a error regarding ruby version:
86
87
~~~~~~
88 29 John Cary
brew install ruby@2.3
89 25 David Howdle
~~~~~~
90
91 1 Redmine Admin
If permissions end up wrong, the commands
92
93
~~~~~~
94 29 John Cary
chmod -R a+rX /opt/homebrew
95
find /opt/homebrew -type l -exec chmod -h a+r '{}' \;
96 1 Redmine Admin
~~~~~~
97
98
may help.
99
100 16 John Cary
To get fortran and a more recent version of the gcc compiler
101 1 Redmine Admin
102 14 John Cary
~~~~~~
103 29 John Cary
brew install gcc@6 --with-fortran
104 1 Redmine Admin
~~~~~~
105 8 Redmine Admin
106 1 Redmine Admin
107
108
## LaTeX ##
109
110
Those with sufficient hard drive space (3.4GB after install) may wish to download the full MacTeX package from <http://www.tug.org/mactex/downloading.html>. After installing, one can see the 'README ME FIRST.pdf' in /Applications/Tex. You will likely need to add /usr/texbin to your path:
111
112
~~~~~~
113 29 John Cary
setenv PATH /usr/texbin:${PATH}  # For tcsh
114
export PATH=/usr/texbin:${PATH}  # For bash
115 1 Redmine Admin
~~~~~~
116 13 Redmine Admin
117 1 Redmine Admin
For those who like GUIs, the !TeXworks in /Applications/TeX/TeXworks should work fine.
118
119 13 Redmine Admin
For those with limited space, install BasicTeX from <https://tug.org/mactex/morepackages.html>. Add to your PATH:
120
121
~~~~~~
122 16 John Cary
    /usr/local/texlive/2016/bin/universal-darwin/
123 13 Redmine Admin
~~~~~~
124
125 1 Redmine Admin
and run
126
127
~~~~~~
128
sudo tlmgr update --self
129 29 John Cary
sudo tlmgr install breakurl capt-of cmap comment courier ec eepic environ epstopdf eqparbox
130
sudo tlmgr install fancybox fancyvrb footnote fncychap framed gensymb helvetic latexmk lineno
131
sudo tlmgr install mdwtools mmap mptopdf multirow newfloat overpic palatino parskip pdftex pifont
132
sudo tlmgr install revtex4 siunitx subfiles symbol tabulary threeparttable titlesec trimspaces txfonts
133
sudo tlmgr install units upquote url wrapfig xcite xcolor xypic zapfding
134
~~~~~~
135 1 Redmine Admin
136 13 Redmine Admin
and then used the autoupdate feature to get any additionally needed packages. Gives a 230 M installation. (As opposed to the usual 2GB installation.)
137 1 Redmine Admin
138
You many also need
139
140
~~~~~~
141
sudo chmod -R a+rX /usr/local/texlive/2016basic/texmf-dist/{tex,fonts}
142 29 John Cary
~~~~~~
143 1 Redmine Admin
144
as it seems that tlmgr does not get the permissions correct.
145
146
## Disable spindump ##
147
148
for faster compilations via
149
150
~~~~~~
151
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.spindump.plist
152 29 John Cary
~~~~~~
153 11 Redmine Admin
154
## Java ##
155
156
You will need to install java by invoking the executable in any way such as...
157
158
~~~~~~
159
java -version
160
~~~~~~
161
162 1 Redmine Admin
Follow the instructions in the dialog that takes you to the Oracle website and choose the latest version to download.  (as of Nov 2015 this is 1.8)
163
164
## HostName ##
165
166
For bilder to properly send emails the fully qualified hostname must set on the machine. To check this try...
167 2 Redmine Admin
168 1 Redmine Admin
~~~~~~
169 31 John Cary
hostname -f
170 29 John Cary
~~~~~~
171 1 Redmine Admin
172
this should return machinename.domainname.com rather than just machinename.  If it does not, then set the hostname of the machine by typing the following commands.
173
174
~~~~~~
175
sudo scutil --set ComputerName "machinename"
176
sudo scutil --set LocalHostName "machinename"
177
sudo scutil --set HostName "machinename.domainname.com"
178
dscacheutil -flushcache
179
~~~~~~
180
181
Restart your Mac after this.
182
183
## Power Saving Modes ##
184
185
For build machines that are not personal machines, disabling certain options will help in connectivity and responsiveness:
186
187
~~~~~~
188
Under Spotlight
189
 - disabled the main HD. (multiple mdworkers taking up a lot of cpu.)
190
~~~~~~
191
192
~~~~~~
193
Under Energy Saver
194
 - Computer sleep: Set to never
195
 - Unchecked Put hard disks to sleep when possible
196
 - Unchecked Wake for network access
197
~~~~~~
198
199
&nbsp;
200
&nbsp;
201
&nbsp;
202
&nbsp;
203
&nbsp;
204
&nbsp;
205
&nbsp;
206
&nbsp;
207
&nbsp;
208
&nbsp;
209
210 29 John Cary
---
211
212
---
213
214 31 John Cary
## X11 ##
215 1 Redmine Admin
216 31 John Cary
X11 should not be needed, but if it is needed:
217
218
Install [XQuartz X11](http://xquartz.macosforge.org/landing/).
219
220
Create a symbolic link so that the X11 headers can be found by the compiler:
221
222
~~~~~~
223
sudo ln -s /opt/X11/include/X11 /usr/local/include/X11
224
~~~~~~
225
226 1 Redmine Admin
# DEPRECATED INSTRUCTIONS #
227 31 John Cary
228
229
## Other gfortran options (besides HomeBrew) ##
230
231
### Option 2: HPC ###
232
233
Install gfortran from [SourceForge HPC](http://hpc.sourceforge.net).  (Do not also install the other gcc compilers.)
234
235
As of March 29, 2015, the version is 4.9.0.
236
237
Install via
238
239
~~~~~~
240
$ tar xzf gfortran-4.9-bin.tar.gz -C /
241
~~~~~~
242
243
### Option 3: GNU ###
244
245
Install gfortran using the installer from <http://gcc.gnu.org/wiki/GFortranBinaries>.
246
247
As of March 29, 2015, the version is 4.9.0.
248
249
The binaries will end up being installed in /usr/local/bin
250
251 30 John Cary
252
## Git ##
253
254
If any repository package requires Git protocol, then for Lion and earlier you may need Git from <http://git-scm.com/download/mac> and add /usr/local/git/bin to your path.
255 11 Redmine Admin
256 1 Redmine Admin
257 10 Redmine Admin
### Macports ### 
258
259
This provides wget, freetype, and other utilities. Get macports from <http://www.macports.org/install.php> and install.
260 11 Redmine Admin
261
Note: Before proceeding with the installation of various macports packages noted below on Lion machines with Xcode 4.3, one needs to run
262
263 10 Redmine Admin
~~~~~~
264 29 John Cary
sudo xcode-select -switch /Applications/Xcode.app
265 10 Redmine Admin
~~~~~~
266
267
Otherwise, there will be an error installing zlib during the wget installation below.
268 11 Redmine Admin
269
After the macports installation, do
270 1 Redmine Admin
271
~~~~~~
272 29 John Cary
sudo port install wget
273
sudo port install ImageMagick +no_x11
274
sudo port install f2c
275 1 Redmine Admin
~~~~~~
276
277
278
### XCode ###
279
### Lion ###
280 11 Redmine Admin
281 1 Redmine Admin
On Lion, the command line compilers are not installed automatically. After installing Xcode, navigate to the 
282
Preferences->Download dialog 
283
and install the Command Line Tools. The dialog is.. 
284 2 Redmine Admin
285 1 Redmine Admin
!screenShotCommandLineTools.png!
286
287
or from the command line do
288
289 11 Redmine Admin
~~~~~~
290 29 John Cary
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer/
291
xcodebuild
292 1 Redmine Admin
      (hit agree)
293
~~~~~~
294
295
You may subsequently need to build your first package with sudo in order to accept the Xcode licenses.
296
297
### Mountain Lion ### 
298
299
Same as Mavericks?
300
301
### Mavericks ###
302
303 2 Redmine Admin
~~~~~~
304 29 John Cary
sudo xcode-select --install
305 1 Redmine Admin
~~~~~~
306
307
308
## Java ##
309
310
(The below does not apply to yosemite.)
311
312
The cmake build may fail due to missing java headers linked to in /System/Library/Frameworks/JavaVM.framework/Headers. To fix:
313
314
~~~~~~
315 29 John Cary
cd /System/Library/Frameworks/JavaVM.framework/Headers
316
sudo mv jni.h jni.h.missing
317 1 Redmine Admin
~~~~~~