1
0
mirror of https://github.com/open-simh/simh.git synced 2026-04-29 21:27:07 +00:00

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.
This commit is contained in:
B. Scott Michel
2023-12-04 11:33:00 -08:00
committed by Paul Koning
parent f4c39a325c
commit d9d0e8bd74
18 changed files with 324 additions and 139 deletions

View File

@@ -1189,13 +1189,15 @@ add_simulator(3b2
convention `[sim]_test.ini` -- the argument to the `TEST` parameter is the
`[sim]` portion of the test script's name.
- Option keywords: These determine which of [six (6) simulator core libraries](#simulator-core-libraries) is
- Option keywords: These determine which of [simulator core libraries](#simulator-core-libraries) is
linked with the simulator.
- `FEATURE_INT64`: 64-bit integers, 32-bit pointers
- `FEATURE_FULL64`: 64-bit integers, 64-bit pointers
- `FEATURE_VIDEO`: Simulator video support.
- `FEATURE_DISPLAY`: Video display support.
- `USES_AIO`: Asynchronous I/O support (primarily useful for simulator
network devices.)
- `PKG_FAMILY` option: This option adds the simulator to a package "family" or
simulator packaging group, e.g., "DEC PDP simulators". The default package
@@ -1213,14 +1215,31 @@ The `CMake` build infrastructure avoids repeatedly compiling the simulator
libraries that represents the combination of required features: 32/64 bit
support and video:
| Library | Video | Integer size | Address size | `add_simulator` flags |
| :--------------- | :---: | -----------: | -----------: | :-------------------- |
| simhcore.a | N | 32 | 32 | |
| simhi64.a | N | 64 | 32 | `FEATURE_INT64` |
| simhz64.a | N | 64 | 64 | `FEATURE_FULL64` |
| simhcore_video.a | Y | 32 | 32 | `FEATURE_VIDEO` |
| simhi64_video.a | Y | 64 | 32 | `FEATURE_INT64`, `FEATURE_VIDEO` |
| simhz64_video.a | Y | 64 | 64 | `FEATURE_FULL64`, `FEATURE_VIDEO` |
| Library | Video | Integer size | Address size | `add_simulator` flags |
| :---------------- | :---: | -----------: | -----------: | :-------------------- |
| simhcore.a | N | 32 | 32 | |
| simhi64.a | N | 64 | 32 | `FEATURE_INT64` |
| simhz64.a | N | 64 | 64 | `FEATURE_FULL64` |
| simhcore\_video.a | Y | 32 | 32 | `FEATURE_VIDEO` |
| simhi64\_video.a | Y | 64 | 32 | `FEATURE_INT64`, `FEATURE_VIDEO` |
| simhz64\_video.a | Y | 64 | 64 | `FEATURE_FULL64`, `FEATURE_VIDEO` |
In addition to these six libraries, there are six asynchronous I/O (AIO)
variants that are built and linked into a simulator when the `USES_AIO` feature
flag is present in `add_simulator()`'s arguments:
| Library variant | Description |
| :--------------------- | :---------: |
| simhcore\_aio.a | simhcore.a with AIO support. |
| simhi64\_aio.a | simhi64.a with AIO support. |
| simhz64\_aio.a | simhz64.a with AIO support. |
| simhcore\_video\_aio.a | simhcore\_video.a with AIO support. |
| simhi64\_video\_aio.a | simhi64\_video.a with AIO support. |
| simhz64\_video\_aio.a | simhz64\_video.a with AIO support. |
The `EXCLUDE_FROM_ALL` property is set on each of theses libraries in CMake to
avoid building the entire matrix. Practically speaking, 10 out of the 12 total
libraries actually build for the entire simulator suite.
Internally, these core libraries are [`CMake` interface libraries][cmake_interface_library] -- when they
are added to a simulator's executable via `target_link_libraries`, the simulator
@@ -1265,6 +1284,10 @@ add_simulator(simulator_name
## in conjunction with FEATURE_VIDEO
FEATURE_DISPLAY
## Simulator uses asynchronous I/O, i.e., calls AIO_CHECK_EVENT
## in its sim_instr() instruction simulation loop:
USES_AIO
## Packaging "family" (group) to which the simulator belongs,
## for packagers that support grouping (Windows: NSIS .exe,
## WIX .msi; macOS)