Skip to content

Commit 29158a7

Browse files
committed
CMake: Updates
Issue #294: "apple silicon build problem(s?)": If the "--flavor/-f" flag is not specified on the command line, then complain loudly, print help and exit. The script used to default to "Unix Makefiles". Updates: - Add missing "-DHAVE_LIBPNG" compiler command line define when the PNG library is detected/present for screen capture support. - Add "clang64" to the list of MinGW64 platforms for which the .travis/deps.sh script can install build dependencies. - Add PThread4W_FOUND to the condition that sets async I/O for Win32 when using vcpkg for build dependencies. - Add vs2022-x64, vs2019-x64 and vs2017-x64 build environments to build 64-bit Windows executables. - Use simulator AIO only where needed by the simulator (i.e., the simulator calls/uses AIO_CHECK_EVENT in sim_instr()) - Add "USES_AIO" flag to add_simulator() to mark a simulator that acutally uses asynchronous I/O. - Build "_aio" SIMH core library variants that have AIO turned on, link with the "_aio" variant when a simulator sets USES_AIO. - Emit a warning message when WITH_ASYNC is False (CMake configuration option) to notify the user/developer that some functionality will be crippled. Affected simulator builds: 3b2 family, PDP-6, PDP-11, VAX family, IMLAC and TT2500. The makefile and cmake/generate.py also updated to remain in sync with CMake. N.B.: Simulators still link with the underlying platform's threading library. SEL32 requires pthreads or equivalent threading library, independent of AIO. - cmake/cmake-builder.sh - New "--no-aio" flag: Build simulators without async I/O. - New "--no-aio-intrinsics" flag: Don't build async I/O using compiler compare-exchange, atomic load intrinsics. - cmake/cmake-builder.ps1 - New "-noaio" flag: Build simulators without async I/O. - New "-noaiointrinsics" flag: Don't build async I/O using compiler compare-exchange, atomic load intrinsics. CMake 3.28.1 INTERFACE_LINK_LIBRARIES behavior change: The file name must now be an absolute path. Relative paths no longer accepted. Internally, SIMH enforces this if CMAKE_VERSION >= 3.19, when REAL_PATH was first implemented.
1 parent c077c22 commit 29158a7

18 files changed

Lines changed: 326 additions & 141 deletions

.travis/deps.sh

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,22 @@ install_ucrt64() {
4545
mingw-w64-ucrt-x86_64-libpcap
4646
}
4747

48+
install_clang64() {
49+
pacman -S --needed mingw-w64-clang-x86_64-ninja \
50+
mingw-w64-clang-x86_64-cmake \
51+
mingw-w64-clang-x86_64-extra-cmake-modules \
52+
mingw-w64-clang-x86_64-clang \
53+
mingw-w64-clang-x86_64-make \
54+
mingw-w64-clang-x86_64-pcre \
55+
mingw-w64-clang-x86_64-freetype \
56+
mingw-w64-clang-x86_64-SDL2 \
57+
mingw-w64-clang-x86_64-SDL2_ttf \
58+
mingw-w64-clang-x86_64-libpcap
59+
}
60+
61+
4862
case "$1" in
49-
osx|linux|mingw64|ucrt64)
63+
osx|linux|mingw64|ucrt64|clang64)
5064
install_"$1"
5165
;;
5266
*)

3B2/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ add_simulator(3b2
3838
DEFINES
3939
REV2
4040
FEATURE_FULL64
41+
USES_AIO
4142
LABEL 3B2
4243
PKG_FAMILY att3b2_family
4344
TEST 3b2)
@@ -65,6 +66,7 @@ add_simulator(3b2-700
6566
DEFINES
6667
REV3
6768
FEATURE_FULL64
69+
USES_AIO
6870
LABEL 3B2
6971
PKG_FAMILY att3b2_family
7072
TEST 3b2-700)

CMakeLists.txt

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@ if (CMAKE_VERSION VERSION_LESS "3.21" AND NOT DEFINED SIMH_INSTALLER_WARNING)
2828
set(SIMH_INSTALLER_WARNING TRUE CACHE BOOL "Installer/CPack warning issued when CMAKE_VERSION < 3.21" FORCE)
2929
endif ()
3030

31+
## SIMH Version variables:
32+
set(SIMH_VERSION_MAJOR 4)
33+
set(SIMH_VERSION_MINOR 1)
34+
set(SIMH_VERSION_PATCH 0)
35+
set(SIMH_VERSION "${SIMH_VERSION_MAJOR}.${SIMH_VERSION_MINOR}.${SIMH_VERSION_PATCH}"
36+
CACHE PATH "Open-Simh version string.")
37+
3138
# Places to look for CMake modules/includes
3239
set(SIMH_INCLUDE_PATH_LIST
3340
${CMAKE_SOURCE_DIR}/cmake
@@ -73,12 +80,6 @@ if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.15)
7380
cmake_policy(SET CMP0091 NEW)
7481
endif()
7582

76-
## SIMH Version variables:
77-
set(SIMH_VERSION_MAJOR 4)
78-
set(SIMH_VERSION_MINOR 1)
79-
set(SIMH_VERSION_PATCH 0)
80-
set(SIMH_VERSION "${SIMH_VERSION_MAJOR}.${SIMH_VERSION_MINOR}.${SIMH_VERSION_PATCH}")
81-
8283
project(simh VERSION "${SIMH_VERSION}" LANGUAGES C CXX)
8384

8485
include(vcpkg-setup)

PDP10/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ add_simulator(pdp6
226226
FEATURE_INT64
227227
FEATURE_VIDEO
228228
FEATURE_DISPLAY
229+
USES_AIO
229230
LABEL PDP10
230231
PKG_FAMILY decpdp_family
231232
TEST pdp6)

PDP11/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ add_simulator(pdp11
7474
VM_PDP11
7575
FEATURE_VIDEO
7676
FEATURE_DISPLAY
77+
USES_AIO
7778
BUILDROMS
7879
LABEL PDP11
7980
PKG_FAMILY pdp11_family

README-CMake.md

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1189,13 +1189,15 @@ add_simulator(3b2
11891189
convention `[sim]_test.ini` -- the argument to the `TEST` parameter is the
11901190
`[sim]` portion of the test script's name.
11911191
1192-
- Option keywords: These determine which of [six (6) simulator core libraries](#simulator-core-libraries) is
1192+
- Option keywords: These determine which of [simulator core libraries](#simulator-core-libraries) is
11931193
linked with the simulator.
11941194
11951195
- `FEATURE_INT64`: 64-bit integers, 32-bit pointers
11961196
- `FEATURE_FULL64`: 64-bit integers, 64-bit pointers
11971197
- `FEATURE_VIDEO`: Simulator video support.
11981198
- `FEATURE_DISPLAY`: Video display support.
1199+
- `USES_AIO`: Asynchronous I/O support (primarily useful for simulator
1200+
network devices.)
11991201
12001202
- `PKG_FAMILY` option: This option adds the simulator to a package "family" or
12011203
simulator packaging group, e.g., "DEC PDP simulators". The default package
@@ -1213,14 +1215,31 @@ The `CMake` build infrastructure avoids repeatedly compiling the simulator
12131215
libraries that represents the combination of required features: 32/64 bit
12141216
support and video:
12151217
1216-
| Library | Video | Integer size | Address size | `add_simulator` flags |
1217-
| :--------------- | :---: | -----------: | -----------: | :-------------------- |
1218-
| simhcore.a | N | 32 | 32 | |
1219-
| simhi64.a | N | 64 | 32 | `FEATURE_INT64` |
1220-
| simhz64.a | N | 64 | 64 | `FEATURE_FULL64` |
1221-
| simhcore_video.a | Y | 32 | 32 | `FEATURE_VIDEO` |
1222-
| simhi64_video.a | Y | 64 | 32 | `FEATURE_INT64`, `FEATURE_VIDEO` |
1223-
| simhz64_video.a | Y | 64 | 64 | `FEATURE_FULL64`, `FEATURE_VIDEO` |
1218+
| Library | Video | Integer size | Address size | `add_simulator` flags |
1219+
| :---------------- | :---: | -----------: | -----------: | :-------------------- |
1220+
| simhcore.a | N | 32 | 32 | |
1221+
| simhi64.a | N | 64 | 32 | `FEATURE_INT64` |
1222+
| simhz64.a | N | 64 | 64 | `FEATURE_FULL64` |
1223+
| simhcore\_video.a | Y | 32 | 32 | `FEATURE_VIDEO` |
1224+
| simhi64\_video.a | Y | 64 | 32 | `FEATURE_INT64`, `FEATURE_VIDEO` |
1225+
| simhz64\_video.a | Y | 64 | 64 | `FEATURE_FULL64`, `FEATURE_VIDEO` |
1226+
1227+
In addition to these six libraries, there are six asynchronous I/O (AIO)
1228+
variants that are built and linked into a simulator when the `USES_AIO` feature
1229+
flag is present in `add_simulator()`'s arguments:
1230+
1231+
| Library variant | Description |
1232+
| :--------------------- | :---------: |
1233+
| simhcore\_aio.a | simhcore.a with AIO support. |
1234+
| simhi64\_aio.a | simhi64.a with AIO support. |
1235+
| simhz64\_aio.a | simhz64.a with AIO support. |
1236+
| simhcore\_video\_aio.a | simhcore\_video.a with AIO support. |
1237+
| simhi64\_video\_aio.a | simhi64\_video.a with AIO support. |
1238+
| simhz64\_video\_aio.a | simhz64\_video.a with AIO support. |
1239+
1240+
The `EXCLUDE_FROM_ALL` property is set on each of theses libraries in CMake to
1241+
avoid building the entire matrix. Practically speaking, 10 out of the 12 total
1242+
libraries actually build for the entire simulator suite.
12241243
12251244
Internally, these core libraries are [`CMake` interface libraries][cmake_interface_library] -- when they
12261245
are added to a simulator's executable via `target_link_libraries`, the simulator
@@ -1265,6 +1284,10 @@ add_simulator(simulator_name
12651284
## in conjunction with FEATURE_VIDEO
12661285
FEATURE_DISPLAY
12671286
1287+
## Simulator uses asynchronous I/O, i.e., calls AIO_CHECK_EVENT
1288+
## in its sim_instr() instruction simulation loop:
1289+
USES_AIO
1290+
12681291
## Packaging "family" (group) to which the simulator belongs,
12691292
## for packagers that support grouping (Windows: NSIS .exe,
12701293
## WIX .msi; macOS)

VAX/CMakeLists.txt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ add_simulator(infoserver100
140140
VAX_411
141141
FEATURE_FULL64
142142
FEATURE_VIDEO
143+
USES_AIO
143144
BUILDROMS
144145
LABEL VAX
145146
PKG_FAMILY vax_family
@@ -169,6 +170,7 @@ add_simulator(infoserver1000
169170
VM_VAX
170171
IS_1000
171172
FEATURE_FULL64
173+
USES_AIO
172174
BUILDROMS
173175
LABEL VAX
174176
PKG_FAMILY vax_family
@@ -186,6 +188,7 @@ add_simulator(infoserver150vxt
186188
VAX_412
187189
FEATURE_FULL64
188190
FEATURE_VIDEO
191+
USES_AIO
189192
BUILDROMS
190193
LABEL VAX
191194
PKG_FAMILY vax_family
@@ -230,6 +233,7 @@ add_simulator(microvax1
230233
VAX_610
231234
FEATURE_FULL64
232235
FEATURE_VIDEO
236+
USES_AIO
233237
BUILDROMS
234238
LABEL VAX
235239
PKG_FAMILY vax_family
@@ -246,6 +250,7 @@ add_simulator(microvax2
246250
VAX_630
247251
FEATURE_FULL64
248252
FEATURE_VIDEO
253+
USES_AIO
249254
BUILDROMS
250255
LABEL VAX
251256
PKG_FAMILY vax_family
@@ -283,6 +288,7 @@ add_simulator(microvax2000
283288
VAX_410
284289
FEATURE_FULL64
285290
FEATURE_VIDEO
291+
USES_AIO
286292
BUILDROMS
287293
LABEL VAX
288294
PKG_FAMILY vax_family
@@ -300,6 +306,7 @@ add_simulator(microvax3100
300306
VAX_41A
301307
FEATURE_FULL64
302308
FEATURE_VIDEO
309+
USES_AIO
303310
BUILDROMS
304311
LABEL VAX
305312
PKG_FAMILY vax_family
@@ -317,6 +324,7 @@ add_simulator(microvax3100e
317324
VAX_41D
318325
FEATURE_FULL64
319326
FEATURE_VIDEO
327+
USES_AIO
320328
BUILDROMS
321329
LABEL VAX
322330
PKG_FAMILY vax_family
@@ -332,6 +340,7 @@ add_simulator(microvax3100m80
332340
VAX_440
333341
VAX_47
334342
FEATURE_FULL64
343+
USES_AIO
335344
BUILDROMS
336345
LABEL VAX
337346
PKG_FAMILY vax_family
@@ -362,6 +371,7 @@ add_simulator(vax
362371
VM_VAX
363372
FEATURE_FULL64
364373
FEATURE_VIDEO
374+
USES_AIO
365375
BUILDROMS
366376
LABEL VAX
367377
PKG_FAMILY vax_family
@@ -435,6 +445,7 @@ add_simulator(vax730
435445
VM_VAX
436446
VAX_730
437447
FEATURE_FULL64
448+
USES_AIO
438449
BUILDROMS
439450
LABEL VAX
440451
PKG_FAMILY vax_family
@@ -485,6 +496,7 @@ add_simulator(vax750
485496
VM_VAX
486497
VAX_750
487498
FEATURE_FULL64
499+
USES_AIO
488500
BUILDROMS
489501
LABEL VAX
490502
PKG_FAMILY vax_family
@@ -536,6 +548,7 @@ add_simulator(vax780
536548
VM_VAX
537549
VAX_780
538550
FEATURE_FULL64
551+
USES_AIO
539552
BUILDROMS
540553
LABEL VAX
541554
PKG_FAMILY vax_family
@@ -584,6 +597,7 @@ add_simulator(vax8200
584597
VM_VAX
585598
VAX_820
586599
FEATURE_FULL64
600+
USES_AIO
587601
BUILDROMS
588602
LABEL VAX
589603
PKG_FAMILY vax_family
@@ -633,6 +647,7 @@ add_simulator(vax8600
633647
VM_VAX
634648
VAX_860
635649
FEATURE_FULL64
650+
USES_AIO
636651
BUILDROMS
637652
LABEL VAX
638653
PKG_FAMILY vax_family
@@ -650,6 +665,7 @@ add_simulator(vaxstation3100m30
650665
VAX_42A
651666
FEATURE_FULL64
652667
FEATURE_VIDEO
668+
USES_AIO
653669
BUILDROMS
654670
LABEL VAX
655671
PKG_FAMILY vax_family
@@ -667,6 +683,7 @@ add_simulator(vaxstation3100m38
667683
VAX_42B
668684
FEATURE_FULL64
669685
FEATURE_VIDEO
686+
USES_AIO
670687
BUILDROMS
671688
LABEL VAX
672689
PKG_FAMILY vax_family
@@ -702,6 +719,7 @@ add_simulator(vaxstation3100m76
702719
VAX_43
703720
FEATURE_FULL64
704721
FEATURE_VIDEO
722+
USES_AIO
705723
BUILDROMS
706724
LABEL VAX
707725
PKG_FAMILY vax_family
@@ -717,6 +735,7 @@ add_simulator(vaxstation4000m60
717735
VAX_440
718736
VAX_46
719737
FEATURE_FULL64
738+
USES_AIO
720739
BUILDROMS
721740
LABEL VAX
722741
PKG_FAMILY vax_family
@@ -732,6 +751,7 @@ add_simulator(vaxstation4000vlc
732751
VAX_440
733752
VAX_48
734753
FEATURE_FULL64
754+
USES_AIO
735755
BUILDROMS
736756
LABEL VAX
737757
PKG_FAMILY vax_family

0 commit comments

Comments
 (0)