forked from pistacheio/pistache
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Building on macOS.txt
127 lines (100 loc) · 4.01 KB
/
Building on macOS.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# SPDX-FileCopyrightText: 2024 Duncan Greatwood
#
# SPDX-License-Identifier: Apache-2.0
Pistache on macOS
=================
Apple's clang compiler must be installed. It comes as part of
Xcode. If not already installed, at terminal command line do:
xcode-select --install
Homebrew (also known as "brew") is required. If not already installed,
follow the Homebrew instructions to install:
In your browser: https://brew.sh/
The simplest way to install Pistache on macOS is to use brew. For the
latest version of Pistache, do:
brew install --HEAD pistache
For the most recent officially designated release, do:
brew install pistache
We normally suggest using the most recent ("HEAD") Pistache version.
In case of difficultly, please see later Troubleshooting note.
Building Pistache from Source on macOS
======================================
If you prefer not to install with brew, Pistache can be built from
source.
Install the necessary brew packages via terminal command line:
brew install meson
brew install doxygen
brew install googletest (skip this if installing with gcc - see later)
brew install openssl
brew install rapidjson
brew install howard-hinnant-date
brew install libevent
brew install brotli
brew install zstd
(You may be able to skip howard-hinnant-date)
Convenience shell scripts are provided to make the build. At terminal,
do:
bldscripts/mesbuild.sh
To test:
bldscripts/mestest.sh
To install:
bldscripts/mesinstall.sh
See later section for more details on teh conveinence scripts.
Troubleshooting brew install on Intel Macs
------------------------------------------
On some Intel-based MACs, when installing Pistache with brew you may
see errors like:
==> meson setup build ...
Traceback (most recent call last):
File "/usr/local/opt/meson/bin/meson", line 5, in <module>
from mesonbuild.mesonmain import main
ModuleNotFoundError: No module named 'mesonbuild'
...
Error: Testing requires the latest version of pistache
This a problem installing Python3, a dependency of meson. We found it
could be fixed by:
sudo mkdir /usr/local/Frameworks
sudo chown <your-user-name> /usr/local/Frameworks
(Substituting your own macOS username for <your-user-name>)
NB: This applies solely to Intel-based Macs. Homebrew uses a different
location for files on Apple-silicon("M")/Arm-based MACs.
Building with GCC
-----------------
By default, Pistache on macOS builds with clang, which is the default
Apple compiler. If you prefer to use gcc, you can utilize the
gccmacsetup.sh script provided by Pistache before doing the build,
like this:
source bldscripts/gccmacsetup.sh
bldscripts/mesbuild.sh
bldscripts/mestest.sh
bldscripts/mesinstall.sh
Convenience Scripts
-------------------
The following scripts cna be used in any environment except
Windows. The meaning of each convenience script is as follows:
mesbuild.sh - build release version
mestest.sh - test release version
mesinstall.sh - install release version
mesbuilddebug.sh - build debug version
mestestdebug.sh - test debug version with meson
mesinstalldebug.sh - install debug version
Linux-only scripts. Note - all environments except Linux use libevent
by default. libevent is optional on Linux:
mesbuildflibev.sh - build version forcing libevent use
mestestflibev.sh - test version with libevent use
mesinstallflibev.sh - install version with libevent use
mesbuildflibevdebug.sh - build debug version forcing libevent use
mestestflibevdebug.sh - test debug version with libevent use
mesinstallflibevdebug.sh - install debug version with libevent use
Also:
clean.sh - remove build directories
gccmacsetup.sh - configure for GCC build on macOS
Building with GCC
-----------------
By default, Pistache on macOS builds with clang, which is the default
Apple compiler. If you prefer to use gcc, you can utilize the
gccmacsetup.sh script provided by Pistache before doing the build,
like this:
source bldscripts/gccmacsetup.sh
bldscripts/mesbuild.sh
bldscripts/mestest.sh
bldscripts/mesinstall.sh