Preparing a Mac machine for Bilder » History » Version 27
John Cary, 01/12/2018 05:03 PM
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 | 2 | Redmine Admin | sudo xcode-select --install |
31 | 1 | Redmine Admin | ~~~~~~ |
32 | |||
33 | |||
34 | 6 | Redmine Admin | ## X11 ## |
35 | 1 | Redmine Admin | |
36 | 14 | John Cary | X11 should not be needed, but if it is needed: |
37 | |||
38 | 2 | Redmine Admin | Install [XQuartz X11](http://xquartz.macosforge.org/landing/). |
39 | 1 | Redmine Admin | |
40 | Create a symbolic link so that the X11 headers can be found by the compiler: |
||
41 | |||
42 | ~~~~~~ |
||
43 | sudo ln -s /opt/X11/include/X11 /usr/local/include/X11 |
||
44 | ~~~~~~ |
||
45 | |||
46 | ## HomeBrew ## |
||
47 | |||
48 | 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. |
||
49 | |||
50 | 14 | John Cary | HomeBrew requires that one not have root privileges. So we make the directory into which we can write: |
51 | 1 | Redmine Admin | |
52 | ~~~~~~ |
||
53 | sudo -s |
||
54 | mkdir -p /opt/homebrew |
||
55 | chgrp -R admin /opt |
||
56 | chmod -R 775 /opt |
||
57 | chmod -R 2775 /opt/homebrew |
||
58 | 14 | John Cary | exit |
59 | ~~~~~~ |
||
60 | |||
61 | and then we work as nonroot: |
||
62 | |||
63 | ~~~~~~ |
||
64 | 1 | Redmine Admin | cd /opt |
65 | 14 | John Cary | curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C homebrew |
66 | 1 | Redmine Admin | chmod -R a+rX /opt/homebrew |
67 | 15 | John Cary | find /opt/homebrew -type l -exec chmod -h a+r '{}' \; |
68 | 14 | John Cary | ~~~~~~ |
69 | 1 | Redmine Admin | |
70 | 15 | John Cary | and finally as root to pick up the paths by default: |
71 | 14 | John Cary | |
72 | 1 | Redmine Admin | ~~~~~~ |
73 | 18 | David Alexander | sudo -s |
74 | echo "/opt/homebrew/bin" > /etc/paths.d/homebrew |
||
75 | echo "/opt/homebrew/share/man" > /etc/manpaths.d/homebrew |
||
76 | chmod a+r /etc/paths.d/homebrew /etc/manpaths.d/homebrew |
||
77 | exit |
||
78 | 1 | Redmine Admin | ~~~~~~ |
79 | |||
80 | Get the required packages... |
||
81 | |||
82 | ~~~~~~ |
||
83 | 21 | John Cary | brew install gnupg libpng freetype gd ghostscript |
84 | 1 | Redmine Admin | ~~~~~~ |
85 | |||
86 | 16 | John Cary | Nice to have: |
87 | 1 | Redmine Admin | |
88 | 16 | John Cary | ~~~~~~ |
89 | brew install imagemagick |
||
90 | ~~~~~~ |
||
91 | |||
92 | 25 | David Howdle | For Qt5: |
93 | |||
94 | ~~~~~~ |
||
95 | brew install bison flex gperf libcapn |
||
96 | ~~~~~~ |
||
97 | |||
98 | If you receive a error regarding ruby version: |
||
99 | |||
100 | ~~~~~~ |
||
101 | brew install ruby@2.3 |
||
102 | ~~~~~~ |
||
103 | |||
104 | 1 | Redmine Admin | If permissions end up wrong, the commands |
105 | |||
106 | ~~~~~~ |
||
107 | 14 | John Cary | chmod -R a+rX /opt/homebrew |
108 | find /opt/homebrew -type l -exec chmod -h a+r '{}' \; |
||
109 | 1 | Redmine Admin | ~~~~~~ |
110 | |||
111 | may help. |
||
112 | |||
113 | 16 | John Cary | To get fortran and a more recent version of the gcc compiler |
114 | 1 | Redmine Admin | |
115 | 14 | John Cary | ~~~~~~ |
116 | brew install gcc49 --with-fortran |
||
117 | 1 | Redmine Admin | ~~~~~~ |
118 | |||
119 | __NOT REQUIRED:__ If your computer is a __Jenkins Slave Only__, then you will need svn 1.7 (__skip otherwise__) |
||
120 | |||
121 | If your Jenkins is set to use svn 1.7 (which means you'd need your local svn client to be 1.7 as well), then you can upgrade via HomeBrew as follows: |
||
122 | |||
123 | ~~~~~~ |
||
124 | # Only for Jenkins Slave!! |
||
125 | 14 | John Cary | brew install subversion17 |
126 | 1 | Redmine Admin | ~~~~~~ |
127 | |||
128 | 11 | Redmine Admin | In the process of building svn 1.7, you may find that subversion fails to build because scons is not installed properly. If that's the case, go to /opt/homebrew/opt/scons/bin and do the following: |
129 | 1 | Redmine Admin | |
130 | ~~~~~~ |
||
131 | # Only for Jenkins Slave and SVN fails to build!! |
||
132 | 8 | Redmine Admin | brew update |
133 | 1 | Redmine Admin | brew doctor |
134 | 11 | Redmine Admin | brew install subversion17 |
135 | 8 | Redmine Admin | ~~~~~~ |
136 | 11 | Redmine Admin | |
137 | 1 | Redmine Admin | ## gfortran ## |
138 | 12 | Redmine Admin | |
139 | 1 | Redmine Admin | ### *Recommended Option:* HomeBrew ### |
140 | 11 | Redmine Admin | |
141 | 1 | Redmine Admin | Install gcc with HomeBrew as detailed above, using the --with-fortran option to the gcc install. If you have done that, then you can skip this section. |
142 | 11 | Redmine Admin | |
143 | 1 | Redmine Admin | As of this writing, Bilder will look for gfortran-4.9 as a backup to gfortran. |
144 | 11 | Redmine Admin | |
145 | 1 | Redmine Admin | ### Option 2: HPC ### |
146 | 11 | Redmine Admin | |
147 | 1 | Redmine Admin | Install gfortran from [SourceForge HPC](http://hpc.sourceforge.net). (Do not also install the other gcc compilers.) |
148 | 11 | Redmine Admin | |
149 | 1 | Redmine Admin | As of March 29, 2015, the version is 4.9.0. |
150 | |||
151 | 11 | Redmine Admin | Install via |
152 | 1 | Redmine Admin | |
153 | ~~~~~~ |
||
154 | 11 | Redmine Admin | $ tar xzf gfortran-4.9-bin.tar.gz -C / |
155 | 1 | Redmine Admin | ~~~~~~ |
156 | 11 | Redmine Admin | |
157 | ### Option 3: GNU ### |
||
158 | |||
159 | Install gfortran using the installer from <http://gcc.gnu.org/wiki/GFortranBinaries>. |
||
160 | |||
161 | As of March 29, 2015, the version is 4.9.0. |
||
162 | |||
163 | The binaries will end up being installed in /usr/local/bin |
||
164 | 1 | Redmine Admin | |
165 | ## LaTeX ## |
||
166 | |||
167 | 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: |
||
168 | |||
169 | ~~~~~~ |
||
170 | setenv PATH /usr/texbin:${PATH} # For tcsh |
||
171 | 13 | Redmine Admin | export PATH=/usr/texbin:${PATH} # For bash |
172 | 1 | Redmine Admin | ~~~~~~ |
173 | 13 | Redmine Admin | |
174 | 1 | Redmine Admin | For those who like GUIs, the !TeXworks in /Applications/TeX/TeXworks should work fine. |
175 | |||
176 | 13 | Redmine Admin | For those with limited space, install BasicTeX from <https://tug.org/mactex/morepackages.html>. Add to your PATH: |
177 | |||
178 | ~~~~~~ |
||
179 | 16 | John Cary | /usr/local/texlive/2016/bin/universal-darwin/ |
180 | 13 | Redmine Admin | ~~~~~~ |
181 | |||
182 | 1 | Redmine Admin | and run |
183 | |||
184 | ~~~~~~ |
||
185 | sudo tlmgr update --self |
||
186 | 22 | John Cary | sudo tlmgr install breakurl capt-of cmap comment courier ec eepic environ epstopdf eqparbox |
187 | 27 | John Cary | sudo tlmgr install fancybox fancyvrb footnote fncychap framed gensymb helvetic latexmk lineno |
188 | 22 | John Cary | sudo tlmgr install mdwtools mmap mptopdf multirow newfloat overpic palatino parskip pdftex pifont |
189 | sudo tlmgr install revtex4 siunitx subfiles symbol tabulary threeparttable titlesec trimspaces txfonts |
||
190 | sudo tlmgr install units upquote url wrapfig xcite xcolor xypic zapfding |
||
191 | 1 | Redmine Admin | ~~~~~~ |
192 | 13 | Redmine Admin | |
193 | 1 | 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.) |
194 | |||
195 | You many also need |
||
196 | |||
197 | ~~~~~~ |
||
198 | 23 | John Cary | sudo chmod -R a+rX /usr/local/texlive/2016basic/texmf-dist/{tex,fonts} |
199 | 1 | Redmine Admin | ~~~~~~ |
200 | |||
201 | as it seems that tlmgr does not get the permissions correct. |
||
202 | |||
203 | ## Disable spindump ## |
||
204 | |||
205 | for faster compilations via |
||
206 | |||
207 | ~~~~~~ |
||
208 | sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.spindump.plist |
||
209 | ~~~~~~ |
||
210 | |||
211 | 2 | Redmine Admin | |
212 | 1 | Redmine Admin | ## Git ## |
213 | 11 | Redmine Admin | |
214 | 1 | Redmine Admin | 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. |
215 | 11 | Redmine Admin | |
216 | ## Java ## |
||
217 | |||
218 | You will need to install java by invoking the executable in any way such as... |
||
219 | |||
220 | ~~~~~~ |
||
221 | java -version |
||
222 | ~~~~~~ |
||
223 | 1 | Redmine Admin | |
224 | 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) |
||
225 | |||
226 | ## HostName ## |
||
227 | |||
228 | 2 | Redmine Admin | For bilder to properly send emails the fully qualified hostname must set on the machine. To check this try... |
229 | 1 | Redmine Admin | |
230 | ~~~~~~ |
||
231 | hostname -f |
||
232 | ~~~~~~ |
||
233 | |||
234 | 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. |
||
235 | |||
236 | ~~~~~~ |
||
237 | 26 | David Alexander | sudo scutil --set ComputerName "machinename" |
238 | sudo scutil --set LocalHostName "machinename" |
||
239 | sudo scutil --set HostName "machinename.domainname.com" |
||
240 | 1 | Redmine Admin | dscacheutil -flushcache |
241 | ~~~~~~ |
||
242 | |||
243 | Restart your Mac after this. |
||
244 | |||
245 | ## Power Saving Modes ## |
||
246 | |||
247 | For build machines that are not personal machines, disabling certain options will help in connectivity and responsiveness: |
||
248 | |||
249 | ~~~~~~ |
||
250 | 2 | Redmine Admin | Under Spotlight |
251 | 1 | Redmine Admin | - disabled the main HD. (multiple mdworkers taking up a lot of cpu.) |
252 | ~~~~~~ |
||
253 | |||
254 | ~~~~~~ |
||
255 | Under Energy Saver |
||
256 | - Computer sleep: Set to never |
||
257 | - Unchecked Put hard disks to sleep when possible |
||
258 | 11 | Redmine Admin | - Unchecked Wake for network access |
259 | ~~~~~~ |
||
260 | 1 | Redmine Admin | |
261 | |||
262 | |||
263 | |
||
264 | |
||
265 | |
||
266 | |
||
267 | 9 | Redmine Admin | |
268 | |
||
269 | |
||
270 | |
||
271 | 11 | Redmine Admin | |
272 | 9 | Redmine Admin | |
273 | 11 | Redmine Admin | |
274 | 9 | Redmine Admin | --- |
275 | 11 | Redmine Admin | |
276 | --- |
||
277 | |||
278 | |||
279 | # DEPRECATED INSTRUCTIONS # |
||
280 | |||
281 | 1 | Redmine Admin | |
282 | 10 | Redmine Admin | ### Macports ### |
283 | |||
284 | This provides wget, freetype, and other utilities. Get macports from <http://www.macports.org/install.php> and install. |
||
285 | 11 | Redmine Admin | |
286 | Note: Before proceeding with the installation of various macports packages noted below on Lion machines with Xcode 4.3, one needs to run |
||
287 | |||
288 | 10 | Redmine Admin | ~~~~~~ |
289 | sudo xcode-select -switch /Applications/Xcode.app |
||
290 | ~~~~~~ |
||
291 | |||
292 | Otherwise, there will be an error installing zlib during the wget installation below. |
||
293 | 11 | Redmine Admin | |
294 | After the macports installation, do |
||
295 | |||
296 | ~~~~~~ |
||
297 | sudo port install wget |
||
298 | 10 | Redmine Admin | sudo port install ImageMagick +no_x11 |
299 | sudo port install f2c |
||
300 | ~~~~~~ |
||
301 | 2 | Redmine Admin | |
302 | |||
303 | 1 | Redmine Admin | ### XCode ### |
304 | ### Lion ### |
||
305 | |||
306 | On Lion, the command line compilers are not installed automatically. After installing Xcode, navigate to the |
||
307 | Preferences->Download dialog |
||
308 | and install the Command Line Tools. The dialog is.. |
||
309 | |||
310 | !screenShotCommandLineTools.png! |
||
311 | |||
312 | or from the command line do |
||
313 | |||
314 | ~~~~~~ |
||
315 | sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer/ |
||
316 | xcodebuild |
||
317 | (hit agree) |
||
318 | ~~~~~~ |
||
319 | 11 | Redmine Admin | |
320 | 1 | Redmine Admin | You may subsequently need to build your first package with sudo in order to accept the Xcode licenses. |
321 | |||
322 | ### Mountain Lion ### |
||
323 | 2 | Redmine Admin | |
324 | 1 | Redmine Admin | Same as Mavericks? |
325 | |||
326 | ### Mavericks ### |
||
327 | |||
328 | 11 | Redmine Admin | ~~~~~~ |
329 | 1 | Redmine Admin | sudo xcode-select --install |
330 | 2 | Redmine Admin | ~~~~~~ |
331 | 1 | Redmine Admin | |
332 | |||
333 | ## Java ## |
||
334 | |||
335 | (The below does not apply to yosemite.) |
||
336 | |||
337 | The cmake build may fail due to missing java headers linked to in /System/Library/Frameworks/JavaVM.framework/Headers. To fix: |
||
338 | |||
339 | ~~~~~~ |
||
340 | cd /System/Library/Frameworks/JavaVM.framework/Headers |
||
341 | sudo mv jni.h jni.h.missing |
||
342 | 2 | Redmine Admin | ~~~~~~ |
343 | 1 | Redmine Admin | |
344 | |||
345 | ## Moving aside the system MPI (Snow Leopard and earlier) ## |
||
346 | |||
347 | The system MPI can interfere with the Bilder built MPI, so we recommend moving aside the system MPI: |
||
348 | |||
349 | ~~~~~~ |
||
350 | cd /usr/lib |
||
351 | mkdir openmpi-save |
||
352 | mv libopen-* libmpi* openmpi-save |
||
353 | cd /usr/bin |
||
354 | mkdir openmpi-save |
||
355 | mv mpi* openmpi-save |
||
356 | ~~~~~~ |