Preparing a Mac machine for Bilder » History » Version 102
David Alexander, 06/05/2024 10:44 AM
1 | 2 | Redmine Admin | # Preparing a Mac machine for Bilder # |
---|---|---|---|
2 | 1 | Redmine Admin | |
3 | 70 | John Cary | *NOTE: as of Catalina, installing in /opt is no longer an option, so we have moved to /usr/local* |
4 | |||
5 | 24 | John Cary | __If all you need is python and sphinx__ (e.g., for builds of documentation), then you need only |
6 | |||
7 | * XCode with command line tools |
||
8 | * Latex installed as noted below |
||
9 | |||
10 | and then you can add the arguments, -W python, and your installed Python and CMake will be used if your path is correct. |
||
11 | |||
12 | |||
13 | 2 | Redmine Admin | ## Bilder on Darwin ## |
14 | 1 | Redmine Admin | |
15 | 16 | John Cary | Darwin comes with bash, so it is Bilder ready for the most part. |
16 | 1 | Redmine Admin | |
17 | 16 | John Cary | ### OS X Versions ### |
18 | 1 | Redmine Admin | |
19 | 16 | John Cary | Yosemite's XCode that supports C++ 11 by default. |
20 | 1 | Redmine Admin | |
21 | 16 | John Cary | El Capitan's clang compiler supports OpenMP. |
22 | |||
23 | 1 | Redmine Admin | ## Case insensitive file system ## |
24 | |||
25 | 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. |
||
26 | |||
27 | 2 | Redmine Admin | ## C and C++ compilers and Xcode command line tools ## |
28 | 1 | Redmine Admin | |
29 | 101 | David Alexander | Install at least Xcode 14.2 (14.2 has been tested as of 2024 Jun 5, but later version might work as well). For Mojave & Apple/Intel Chip, LLVM is also required (but LLVM@12 is brew installed later). |
30 | |||
31 | To obtain Xcode visit https://developer.apple.com/download/all/ (you will need to sign in with your Apple ID) and search for "XCode 14.2". Also download the Command Line Tools to match the version of Xcode that you are getting. The Xcode.app directory that is unpacked by opening the .xip file should be moved to the /Applications/ folder. The Command Line Tools is a DMG that has a PKG installer, so just run that. One must additionally execute this command before using any command line tools: |
||
32 | 1 | Redmine Admin | |
33 | ~~~~~~ |
||
34 | 83 | David Alexander | sudo xcodebuild -license |
35 | 1 | Redmine Admin | ~~~~~~ |
36 | |||
37 | 83 | David Alexander | If you are upgrading from a previous installation you will want/need to run the following command |
38 | 35 | John Cary | |
39 | ~~~~~~ |
||
40 | 83 | David Alexander | sudo xcode-select -s /Applications/Xcode.app |
41 | 1 | Redmine Admin | ~~~~~~ |
42 | |||
43 | 83 | David Alexander | One can check the version of Xcode from the command-line with |
44 | 69 | John Cary | |
45 | 83 | David Alexander | ~~~~~ |
46 | xcodebuild -version |
||
47 | /usr/bin/clang --version |
||
48 | 69 | John Cary | ~~~~~~ |
49 | 65 | David Alexander | |
50 | 102 | David Alexander | The clang should be version 14.0.0 with Xcode 14.2. |
51 | 1 | Redmine Admin | |
52 | ## HomeBrew ## |
||
53 | 70 | John Cary | |
54 | 90 | David Alexander | 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 `$HOMEBREWDIR` with $HOMEBREWDIR being either `/usr/local/homebrew` if on Intel Mac, or `/opt/homebrew` if on Apple ARM architecture (M1, M2, etc.). Thus removal of a package a matter removing a directory and then removing broken links in $HOMEBREWDIR. |
55 | 14 | John Cary | |
56 | 86 | Scott Kruger | To install homebrew, go to https://brew.sh and follow the installation directions. |
57 | 1 | Redmine Admin | |
58 | 82 | John Cary | Get various packages... |
59 | 16 | John Cary | |
60 | 82 | John Cary | ~~~~~~ |
61 | 100 | David Alexander | brew install subversion gnupg libpng freetype gd ghostscript ninja wget imagemagick bison flex gperf libcapn pkg-config |
62 | 16 | John Cary | ~~~~~~ |
63 | 45 | Nathan Neri | |
64 | git large file support (for VisIt) |
||
65 | |||
66 | ~~~~~~ |
||
67 | 56 | Nathan Neri | brew install git-lfs |
68 | 39 | David Alexander | git lfs install --force --skip-smudge |
69 | 1 | Redmine Admin | ~~~~~~ |
70 | 79 | John Cary | |
71 | 92 | David Alexander | Fortran comes with the homebrew gcc compiler. |
72 | 88 | John Cary | |
73 | ~~~~~~ |
||
74 | 92 | David Alexander | brew install gcc # Intel architecture |
75 | 88 | John Cary | ~~~~~~ |
76 | |||
77 | 90 | David Alexander | On Apple ARM architecture gcc needs to be installed from source and there are some other packages to install |
78 | 75 | Tech-X Corporation | |
79 | 81 | David Alexander | ~~~~~~ |
80 | 92 | David Alexander | brew install --build-from-source gcc # ARM architecture |
81 | 100 | David Alexander | brew install qt@5 curl # ARM only. Qt is version 5.15.10 as of 7/3/2023 |
82 | 1 | Redmine Admin | ~~~~~~ |
83 | 39 | David Alexander | |
84 | OPTIONAL: |
||
85 | |||
86 | If you receive an error regarding ruby version: |
||
87 | |||
88 | ~~~~~~ |
||
89 | brew install ruby@2.3 |
||
90 | ~~~~~~ |
||
91 | |||
92 | may help. |
||
93 | 1 | Redmine Admin | |
94 | |||
95 | ## LaTeX ## |
||
96 | |||
97 | 29 | John Cary | 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: |
98 | |||
99 | 1 | Redmine Admin | ~~~~~~ |
100 | 13 | Redmine Admin | setenv PATH /usr/texbin:${PATH} # For tcsh |
101 | 1 | Redmine Admin | export PATH=/usr/texbin:${PATH} # For bash |
102 | ~~~~~~ |
||
103 | 13 | Redmine Admin | |
104 | For those who like GUIs, the !TeXworks in /Applications/TeX/TeXworks should work fine. |
||
105 | |||
106 | 32 | John Cary | For those with limited space, install BasicTeX from <https://tug.org/mactex/morepackages.html>. Add to your PATH: |
107 | 13 | Redmine Admin | |
108 | ~~~~~~ |
||
109 | 32 | John Cary | /usr/local/texlive/2017/bin/universal-darwin/ |
110 | 1 | Redmine Admin | ~~~~~~ |
111 | 32 | John Cary | |
112 | 29 | John Cary | and then install the packages noted at |
113 | 32 | John Cary | |
114 | 1 | Redmine Admin | [[LaTeX packages needed by Bilder]] |
115 | |||
116 | 32 | John Cary | You may need to use sudo. |
117 | |||
118 | 1 | Redmine Admin | ~~~~~~ |
119 | 29 | John Cary | sudo tlmgr update --self |
120 | 32 | John Cary | sudo tlmgr install <needed packages> |
121 | ~~~~~~ |
||
122 | 1 | Redmine Admin | |
123 | and then used the autoupdate feature to get any additionally needed packages. This minimal installation is 230 M instead of the usual 2GB. |
||
124 | |||
125 | |||
126 | ## Disable spindump ## |
||
127 | |||
128 | for faster compilations via |
||
129 | |||
130 | ~~~~~~ |
||
131 | 58 | John Cary | sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.spindump.plist |
132 | ~~~~~~ |
||
133 | 67 | David Alexander | |
134 | 97 | John Cary | ## LLVM-Clang ## |
135 | 58 | John Cary | |
136 | LLVM-Clang (aka LlvmClang) is different from AppleClang. It has support for target attributes and openmp, and provides a build chain for high-performance computing. Check out the llvm-project of your chosen version. |
||
137 | |||
138 | We use homebrew to install this with |
||
139 | 61 | John Cary | |
140 | 71 | David Alexander | ~~~~~~ |
141 | 98 | John Cary | brew install llvm@15 |
142 | 48 | Nathan Neri | ~~~~~~ |
143 | 44 | Tech-X Corporation | |
144 | 98 | John Cary | As of Jul 2023, the default llvm version is 16, but it will not build Trilinos. LLVM-15 is the first version to have OpenMP support on the M1 chips. LLVM-12 is well tested for non-M1 Mac's. |
145 | 11 | Redmine Admin | |
146 | ## Java ## |
||
147 | |||
148 | You will need to install java by invoking the executable in any way such as... |
||
149 | |||
150 | ~~~~~~ |
||
151 | 1 | Redmine Admin | java -version |
152 | ~~~~~~ |
||
153 | 74 | Tech-X Corporation | |
154 | Follow the instructions in the dialog that takes you to the Oracle website and choose the latest version to download. (As of March 2021 this is 16.) |
||
155 | |||
156 | Chose the macOS installer from |
||
157 | 1 | Redmine Admin | https://www.oracle.com/java/technologies/javase-jdk16-downloads.html |
158 | |||
159 | 2 | Redmine Admin | ## HostName ## |
160 | 1 | Redmine Admin | |
161 | 31 | John Cary | For bilder to properly send emails the fully qualified hostname must set on the machine. To check this try... |
162 | 29 | John Cary | |
163 | 1 | Redmine Admin | ~~~~~~ |
164 | hostname -f |
||
165 | ~~~~~~ |
||
166 | |||
167 | 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. |
||
168 | |||
169 | ~~~~~~ |
||
170 | sudo scutil --set ComputerName "machinename" |
||
171 | sudo scutil --set LocalHostName "machinename" |
||
172 | sudo scutil --set HostName "machinename.domainname.com" |
||
173 | dscacheutil -flushcache |
||
174 | ~~~~~~ |
||
175 | |||
176 | Restart your Mac after this. |
||
177 | |||
178 | ## Power Saving Modes ## |
||
179 | |||
180 | For build machines that are not personal machines, disabling certain options will help in connectivity and responsiveness: |
||
181 | |||
182 | ~~~~~~ |
||
183 | Under Spotlight |
||
184 | - disabled the main HD. (multiple mdworkers taking up a lot of cpu.) |
||
185 | ~~~~~~ |
||
186 | |||
187 | ~~~~~~ |
||
188 | Under Energy Saver |
||
189 | - Computer sleep: Set to never |
||
190 | - Unchecked Put hard disks to sleep when possible |
||
191 | - Unchecked Wake for network access |
||
192 | ~~~~~~ |
||
193 | |||
194 | 99 | David Alexander | ## Python ## |
195 | |||
196 | For some older packages the "python" binary might be needed. Homebrew no longer supports installing Python2. Individual packages may expect "python" to be from Python2 or Python3, so it not clear if Python2 is needed to be installed or if one can link the python executable to the python3 one. One can install Python2, in any case from https://python.org/downloads. |
||
197 | |||
198 | |||
199 | |||
200 | |||
201 | 1 | Redmine Admin | |
202 | |
||
203 | |
||
204 | |
||
205 | |
||
206 | |
||
207 | |
||
208 | |
||
209 | 29 | John Cary | |
210 | |
||
211 | |||
212 | --- |
||
213 | 31 | John Cary | |
214 | 1 | Redmine Admin | --- |
215 | 31 | John Cary | |
216 | ## X11 ## |
||
217 | |||
218 | X11 should not be needed, but if it is needed: |
||
219 | |||
220 | Install [XQuartz X11](http://xquartz.macosforge.org/landing/). |
||
221 | |||
222 | Create a symbolic link so that the X11 headers can be found by the compiler: |
||
223 | |||
224 | ~~~~~~ |
||
225 | 1 | Redmine Admin | sudo ln -s /opt/X11/include/X11 /usr/local/include/X11 |
226 | 31 | John Cary | ~~~~~~ |
227 | |||
228 | # DEPRECATED INSTRUCTIONS # |
||
229 | |||
230 | |||
231 | ## Other gfortran options (besides HomeBrew) ## |
||
232 | |||
233 | ### Option 2: HPC ### |
||
234 | |||
235 | Install gfortran from [SourceForge HPC](http://hpc.sourceforge.net). (Do not also install the other gcc compilers.) |
||
236 | |||
237 | As of March 29, 2015, the version is 4.9.0. |
||
238 | |||
239 | Install via |
||
240 | |||
241 | ~~~~~~ |
||
242 | $ tar xzf gfortran-4.9-bin.tar.gz -C / |
||
243 | ~~~~~~ |
||
244 | |||
245 | ### Option 3: GNU ### |
||
246 | |||
247 | Install gfortran using the installer from <http://gcc.gnu.org/wiki/GFortranBinaries>. |
||
248 | |||
249 | As of March 29, 2015, the version is 4.9.0. |
||
250 | 30 | John Cary | |
251 | The binaries will end up being installed in /usr/local/bin |
||
252 | |||
253 | |||
254 | 11 | Redmine Admin | ## Git ## |
255 | 1 | Redmine Admin | |
256 | 10 | 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. |
257 | |||
258 | |||
259 | 11 | Redmine Admin | ### Macports ### |
260 | |||
261 | This provides wget, freetype, and other utilities. Get macports from <http://www.macports.org/install.php> and install. |
||
262 | 10 | Redmine Admin | |
263 | 29 | John Cary | Note: Before proceeding with the installation of various macports packages noted below on Lion machines with Xcode 4.3, one needs to run |
264 | 10 | Redmine Admin | |
265 | ~~~~~~ |
||
266 | sudo xcode-select -switch /Applications/Xcode.app |
||
267 | 11 | Redmine Admin | ~~~~~~ |
268 | |||
269 | 1 | Redmine Admin | Otherwise, there will be an error installing zlib during the wget installation below. |
270 | |||
271 | 29 | John Cary | After the macports installation, do |
272 | |||
273 | ~~~~~~ |
||
274 | 1 | Redmine Admin | sudo port install wget |
275 | sudo port install ImageMagick +no_x11 |
||
276 | sudo port install f2c |
||
277 | ~~~~~~ |
||
278 | |||
279 | 11 | Redmine Admin | |
280 | 1 | Redmine Admin | ### XCode ### |
281 | ### Lion ### |
||
282 | |||
283 | 2 | Redmine Admin | On Lion, the command line compilers are not installed automatically. After installing Xcode, navigate to the |
284 | 1 | Redmine Admin | Preferences->Download dialog |
285 | and install the Command Line Tools. The dialog is.. |
||
286 | |||
287 | !screenShotCommandLineTools.png! |
||
288 | 11 | Redmine Admin | |
289 | 29 | John Cary | or from the command line do |
290 | |||
291 | 1 | Redmine Admin | ~~~~~~ |
292 | sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer/ |
||
293 | xcodebuild |
||
294 | (hit agree) |
||
295 | ~~~~~~ |
||
296 | |||
297 | You may subsequently need to build your first package with sudo in order to accept the Xcode licenses. |
||
298 | |||
299 | ### Mountain Lion ### |
||
300 | |||
301 | Same as Mavericks? |
||
302 | 2 | Redmine Admin | |
303 | 29 | John Cary | ### Mavericks ### |
304 | 1 | Redmine Admin | |
305 | ~~~~~~ |
||
306 | sudo xcode-select --install |
||
307 | ~~~~~~ |
||
308 | |||
309 | |||
310 | ## Java ## |
||
311 | |||
312 | (The below does not apply to yosemite.) |
||
313 | |||
314 | 29 | John Cary | The cmake build may fail due to missing java headers linked to in /System/Library/Frameworks/JavaVM.framework/Headers. To fix: |
315 | |||
316 | 1 | Redmine Admin | ~~~~~~ |
317 | cd /System/Library/Frameworks/JavaVM.framework/Headers |
||
318 | sudo mv jni.h jni.h.missing |
||
319 | ~~~~~~ |