Project

General

Profile

Preparing a Mac machine for Bilder » History » Version 113

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