-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.txt
227 lines (176 loc) · 7 KB
/
build.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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
BUILD NOTES
static site checker
https://ssc.lu/
(c) 2020-2025 Dylan Harris
Introduction
============
SSC can be built on various unii with CMake and clang or gcc for C++ 17
or better, or Visual Studios 2017 / 2019 / 2022 under Windows. I have
built & tested it in various OSs on some amd64 & arm64 architectures,
including various flavours of Linux, MacOS, OpenBSD, and Windows.
Although ssc builds with some older compilers on some older systems,
not all features are available.
Libraries
=========
Common dependencies
-------------------
ssc needs boost version 1.75 or better (https://boost.org),
a recent copy of the ICU libraries (https://icu-project.org/) (or
define NOICU). Microsoft's GSL (https://github.com/Microsoft/GSL)
(or define NO_GSL), and a recent version of libcurl (https://curl.se/)*
(or define NOCURL). If you want to experiment with the still-in-
development GUI version, you'll also need a recent version of wX.
Usually, an Operating System's package manager has appropriate versions
ready to install.
You may need to set these environment variables:
- BOOST: if you're not using your operating system's packaged flavour
of boost, then set BOOST to your boost source root directory;
- CURL: if you're not using your operating system's packaged flavour
of curl, then set CURL to your curl source root directory;
- GSL: set it to your GSL root directory.
- ICU_ROOT: if you're not using your operating system's packaged ICU,
set ICU_ROOT to your ICU source root directory;
- WX_ROOT: if you're building the gui version of ssc, you'll need to
install wxWidgets and set WX_ROOT to its installation directory.
*libcurl requires a thread-safe underlying SSL library: see
https://curl.se/libcurl/c/threadsafe.html.
Note that the Windows solutions no longer require vcpkg; it proved too
unreliable. However, if you wish to use it, go ahead: you may have
better luck than me.
hunspell
--------
Building SSC under unii, including macos, requires a development
installation of hunspell (https://hunspell.github.io/).
winspell
--------
The Windows build, by default, uses the native Windows spellchecker,
although, preceding Windows 11, that doesn't seem to work so well in
contexts unimpaired by monolingualism.
Notes on the GUI
================
wxWidgets
---------
Why use this ancient behemoth given the good number of somewhat less
archaic C++ GUI libraries? The requirements were: (i) Open Source;
(ii) supports Windows/MacOS/Linux/OpenBSD. Of those libraries I found,
only wxWidgets was documented to support OpenBSD.
Polylingualism
--------------
ssc is written for coders. HTML/etc. code is based on English, so
ssc's GUI text is similarly monolingual.
Unstable
--------
The GUI will evolve rapidly over the coming few months, so expect it to
change significantly.
Building
========
Windows
-------
To build from Visual Studio, navigate to recipe/tea, open the
appropriate .sln file, then build. Only Visual Studios 2017, 2019 and
2022 have been built & tested for amd64 (x64), and only 2022 has been
tested for arm64 under Windows 10 & 11. Older versions for amd64 and
i386 were tested on older versions of Windows.
On low memory machines, disable the /MP switch.
Some versions of the Visual Studio solutions used vcpkg, which
sometimes resolves dependencies. For all such versions, except recent
editions of Visual Studio 2022, you may need to first download and
install vcpkg yourself, from https://vcpkg.io/.
Unii & mock Unii
----------------
I wrote ssc using visual C++ and clang. It turns out that, regretfully,
some of the choices I made left gcc ridiculously slow. I suggest, if
you have the choice, that you avoid it.
You will need CMake 3.24 or better. On Linux, you will also need
lsb-release. These can be found in most distributions' standard
packages. For macos, I used macports, but I expect brew is good too.
From the home ssc directory, compile a normal build thus:
cmake .
make
ctest
make install
For a debug build:
cmake -DCMAKE_BUILD_TYPE=Debug .
make
ctest
make install
If everything works correctly, then everything will be built, a series
of tests run, with a final result at the very end saying no failures.
Having said that, given SSC is alpha, don't be too surprised to see
some warnings or some final test errors. Note in particular that
complaints about being unable to find or copy files during testing are
not of concern, these come from scripts that set up or tear down
individual tests, and the standard commands used sometimes complain if
they can't find files they're supposed to delete, which is a bit silly
given that means things are already in the required state.
ssc has been successfully built in OpenBSD, FreeBSD, Linux & MacOS on
AMD64, and in recent versions of OpenBSD, Linux & MacOS under ARM64.
The current version of ssc requires the current version of an operating
system. Older operating systems require older versions of ssc. Not all
features work on all systems.
I've sometimes found it necessary to use cmake's
-DCMAKE_CXX_COMPILER=... switch.
Linux
-----
I tend to build under Ubuntu, but some other flavours work too.
OpenBSD
-------
You may need to increase significantly the available memory setting
for your build account in login.conf.
Macos
-----
Certain versions of macos clang produce buggy code, whether or not
optimisations are applied. Use an alternative compiler if you want
a stable executable. I accept a bug could be in ssc code, but I've not
found it.
Testing
=======
Windows
-------
Under Visual Studio, run ssc??-test using these arguments:
-v -x $(ProjectDir)..\..\ssc.exe
-f $(ProjectDir)..\toast\ssc-test\win.lst
(on one line)
Add '-d' if you want the test utility to retain temporary files.
CMake
-----
Under CMake, run ctest:
ctest -V
(which runs ssc-test for you, using nix.lst).
Dimitude
--------
The testing utility is rather dim; it will test unbuilt features,
causing failures.
Spelling test results depend on the dictionaries installed.
Supporting libraries
====================
GSL
---
If you can't find a copy of Microsoft's GSL in your system's standard
package suite, then grab a current copy from its github repository
(https://github.com/Microsoft/GSL), then unpack, build and install it.
In Windows, remember to add its root directory to your local path.
Boost
-----
Boost is to C++ as breakfast to the working day.
Most package managers support it, including vcpkg. Alternatively, build
your own version using the source found at boost.org.
Curl
----
curl is used for link checking and, where necessary, obtaining remote
resources. Most package managers support it.
ICU4C
-----
ICU4C is used to process unicode.
Most package managers support it. Alternatively, build your own version
using the source found at icu.unicode.org.
wxWidgets
---------
This is only required if you make a GUI build. It can be found at
wxwidgets.org. Note that it has not been tested for many of the systems
supported by wxWidgets.
Editions
========
Currently, there is a new, work-in-progress, gui edition in the Visual
Studio solution. It does not work and should not be used. Stick to the
standard edition.