Project

General

Profile

Preparing a Mac machine for Bilder » History » Version 111

John Cary, 11/24/2024 08:59 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
sudo chmod -R -o+rX /usr/local/texlive/
132
~~~~~~
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
You may need to use sudo.
143 1 Redmine Admin
144 29 John Cary
~~~~~~
145 32 John Cary
sudo tlmgr update --self
146
sudo tlmgr install <needed packages>
147 1 Redmine Admin
~~~~~~
148
149
and then used the autoupdate feature to get any additionally needed packages.  This minimal installation is 230 M instead of the usual 2GB.
150
151
152
## Disable spindump ##
153
154
for faster compilations via
155
156 58 John Cary
~~~~~~
157
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.spindump.plist
158 67 David Alexander
~~~~~~
159 97 John Cary
160 11 Redmine Admin
## Java ##
161
162
You will need to install java by invoking the executable in any way such as...
163
164 1 Redmine Admin
~~~~~~
165
java -version
166 74 Tech-X Corporation
~~~~~~
167
168
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.)
169
170 1 Redmine Admin
Chose the macOS installer from
171
https://www.oracle.com/java/technologies/javase-jdk16-downloads.html
172 2 Redmine Admin
173 1 Redmine Admin
## HostName ##
174 31 John Cary
175 29 John Cary
For bilder to properly send emails the fully qualified hostname must set on the machine. To check this try...
176 1 Redmine Admin
177
~~~~~~
178
hostname -f
179
~~~~~~
180
181
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.
182
183
~~~~~~
184
sudo scutil --set ComputerName "machinename"
185
sudo scutil --set LocalHostName "machinename"
186
sudo scutil --set HostName "machinename.domainname.com"
187
dscacheutil -flushcache
188
~~~~~~
189
190
Restart your Mac after this.
191
192
## Power Saving Modes ##
193
194
For build machines that are not personal machines, disabling certain options will help in connectivity and responsiveness:
195
196
~~~~~~
197
Under Spotlight
198
 - disabled the main HD. (multiple mdworkers taking up a lot of cpu.)
199
~~~~~~
200
201
~~~~~~
202
Under Energy Saver
203
 - Computer sleep: Set to never
204 99 David Alexander
 - Unchecked Put hard disks to sleep when possible
205
 - Unchecked Wake for network access
206
~~~~~~
207
208
## Python ##
209
210
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.
211 1 Redmine Admin
212
&nbsp;
213
&nbsp;
214
&nbsp;
215
&nbsp;
216
&nbsp;
217
&nbsp;
218
&nbsp;
219 29 John Cary
&nbsp;
220
&nbsp;
221
&nbsp;
222
223 31 John Cary
---
224 1 Redmine Admin
225 31 John Cary
---
226
227 108 John Cary
228
# DEPRECATED INSTRUCTIONS #
229
230 31 John Cary
## X11 ##
231
232
X11 should not be needed, but if it is needed:
233
234
Install [XQuartz X11](http://xquartz.macosforge.org/landing/).
235
236
Create a symbolic link so that the X11 headers can be found by the compiler:
237
238
~~~~~~
239
sudo ln -s /opt/X11/include/X11 /usr/local/include/X11
240
~~~~~~
241
242
## Other gfortran options (besides HomeBrew) ##
243
244
### Option 2: HPC ###
245
246
Install gfortran from [SourceForge HPC](http://hpc.sourceforge.net).  (Do not also install the other gcc compilers.)
247
248
As of March 29, 2015, the version is 4.9.0.
249
250
Install via
251
252
~~~~~~
253
$ tar xzf gfortran-4.9-bin.tar.gz -C /
254
~~~~~~
255
256
### Option 3: GNU ###
257
258
Install gfortran using the installer from <http://gcc.gnu.org/wiki/GFortranBinaries>.
259
260 30 John Cary
As of March 29, 2015, the version is 4.9.0.
261
262
The binaries will end up being installed in /usr/local/bin
263
264 11 Redmine Admin
265 1 Redmine Admin
## Git ##
266 10 Redmine Admin
267
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.
268
269 11 Redmine Admin
270
### Macports ### 
271
272 10 Redmine Admin
This provides wget, freetype, and other utilities. Get macports from <http://www.macports.org/install.php> and install.
273 29 John Cary
274 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
275
276
~~~~~~
277 11 Redmine Admin
sudo xcode-select -switch /Applications/Xcode.app
278
~~~~~~
279 1 Redmine Admin
280
Otherwise, there will be an error installing zlib during the wget installation below.
281 29 John Cary
282
After the macports installation, do
283
284 1 Redmine Admin
~~~~~~
285
sudo port install wget
286
sudo port install ImageMagick +no_x11
287
sudo port install f2c
288
~~~~~~
289 11 Redmine Admin
290 1 Redmine Admin
291
### XCode ###
292
### Lion ###
293 2 Redmine Admin
294 1 Redmine Admin
On Lion, the command line compilers are not installed automatically. After installing Xcode, navigate to the 
295
Preferences->Download dialog 
296
and install the Command Line Tools. The dialog is.. 
297
298 11 Redmine Admin
!screenShotCommandLineTools.png!
299 29 John Cary
300
or from the command line do
301 1 Redmine Admin
302
~~~~~~
303
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer/
304
xcodebuild
305
      (hit agree)
306
~~~~~~
307
308
You may subsequently need to build your first package with sudo in order to accept the Xcode licenses.
309
310
### Mountain Lion ### 
311
312 2 Redmine Admin
Same as Mavericks?
313 29 John Cary
314 1 Redmine Admin
### Mavericks ###
315
316
~~~~~~
317
sudo xcode-select --install
318
~~~~~~
319
320
321
## Java ##
322
323
(The below does not apply to yosemite.)
324 29 John Cary
325
The cmake build may fail due to missing java headers linked to in /System/Library/Frameworks/JavaVM.framework/Headers. To fix:
326 1 Redmine Admin
327
~~~~~~
328
cd /System/Library/Frameworks/JavaVM.framework/Headers
329
sudo mv jni.h jni.h.missing
330
~~~~~~