Target Platform |
Description |
Download |
Instructions |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Any |
Complete source code. |
Current at GitHub | Building
Virtual AGC from source |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Windows, Mac OS, Linux, Solaris, FreeBSD | 64-bit 'x86 Virtual Machine (VM) prepared
for use with the VirtualBox
hypervisor. This VM provides the ability to run or build all software related to Gemini, Apollo, or the Space Shuttle that's publicly provided freely by the Virtual AGC Project. That includes even software not covered by the generic build-from-source instructions found later on this page. Using the VM avoids the necessity of manually performing tricky builds and installations, as well as the risk that those builds or installations could fail on your particular computer platform. After downloading the compressed VM, I'd recommend verifying that it has the same MD5 checksum as listed in the next column to the right, if only to insure that the download was not corrupted. The commands to compute the MD5 checksum from the command line are:
Recommended Updates
Though designed with VirtualBox in mind, the VM can instead be used with a little effort in some other types of hypervisors if you so desire. (I've read, but have no personal knowledge, that some hypervisors, VirtualBox and QEMU in particular, can even be used to run 'x86 VMs such as ours on ARM-based computers.) Here's a brief survey of some of the more-popular hypervisors in which I know or speculate that the VM will run:
|
Download the
compressed VM The compressed VM's MD5 checksum: 094ca9ec03ac8c52d42f4e756c0985f6 Release 2025-01-07 Download: 3.7GB Uncompressed: 20.8GB Maximum in use: Up to 40GB
|
Installation
of the VM Using the VM |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Any | Pre-built versions of Virtual AGC are no longer provided,
other than via the VM. Obsolete downloads of pre-built
Virtual AGC and instructions for them can still be found on
our superseded
download page(s). |
n/a | n/a |
If you were to run the Virtual AGC application from its desktop icon
Calls up an information screen, similar to the tour you're reading now but with much more information ... particularly about the numerous features such as assemblers, compilers, and simulators that are available from the command line rather than from desktop icons.
Opens the VirtualAGC GUI application, which is a portal that allows you to run an AGC/AGS simulation in a multitude of configurations.
Updates the Virtual AGC software in the VM by downloading all of the latest source code from the GitHub repository, and rebuilding it.
Lets you perform visual debugging on a variety of different AGC software versions.
Lets you view/edit the electrical schematics for the AGC and DSKY as transcribed into a modern computer-aided design (CAD) system.
(Requires update 2025-02-20 or later.) Re-displays the signal traces of the last-performed electrical simulation of the AGC. The simulations themselves are performed from a command line.
Opens a simulation of the original test panel used for debugging Apollo Launch Vehicle Digital Computer (LVDC) software.
Aside: Actually, if you close the window labeled "Simulation Status", it won't close the simulation at all, but rather it closes the simulation manager. That's a bug, not a feature, but one which I'm at a loss to fix at present.
TS 0023
being executed at
address 4076, followed by instruction AD
0020
at address 4077, AD
0022
at 4100, and so on. The simulation of a
full AGC provides about 5000 separate signals, of which I'm
displaying a small, somewhat-random selection in the screenshot, but
you naturally have complete control over the signal traces that the
waveform-viewing software shows.
- Highlight the VirtualAGC-VM64-Release entry in VirtualBox's left-hand pane.
- Select Settings/Display/Screen, and change the Scale Factor to 100%.
- Select Settings/Shared-Folders, and remove the shared folder /mnt/STORAGE/home/rburkey
Perhaps of more concern to you, I've endowed the VM with a
virtual disk that's nominally 40GB. The way VirtualBox
virtual disks work, they are actually usually smaller than the
nominal size, but physically expand as they fill up. So as
delivered, the virtual disk appears to you to be only about 20GB,
but you may later find it using 40GB of your disk. I made it
this large to allow for future expansion of capabilities.
You may think that 40GB is excessive and prefer to shave off a few
(or a lot) of gigabytes. The procedure to do so is trickier
than I'd like, so I won't explain it unless somebody actually asks
me about it. Personally, I'd suggest just googling it if
you're interested, though I'd more-vigorously suggest not
decreasing the virtual-disk size at all.
Finally, technically, for any Linux pros, the VM does not have a
swap partition. You can adjust the VM itself to give
yourself one, but if you're pro enough to desire this, you're too
much of a pro for me to instruct you on the details of how to do
it.
Here's a brief survey of some popular hypervisors:
As I mentioned earlier, the VM is intended for 64-bit 'x86
computers, but that some hypervisors like VirtualBox and QEMU
supposedly have the capability of running on an ARM host system
while running an 'x86 guest system like the VirtualAGC VM.
If you try it, let me know how it turns out.
The Virtual AGC VM is downloaded in a form specific to
VirtualBox. The VirtualBox native virtual-disk format (VDI)
that we provide in the VirtualAGC VM can be converted to any of
the following virtual-disk formats native to other hypervisors:
As for how to perform such a conversion, either
VirtualBox or QEMU can convert VDI-format disks to any of the
formats listed above.
Details: At least in v7.1 of VirtualBox, conversion of a VDI file can be performed from the VirtualBox Manager application, from it's main menu: Select File/Tools/Virtual-Media-Manager. Then right-click on any VDI file, choose the Copy operation, and select the desired format to create. Alternately, conversion can be performed from a command line with a command of the form "vboxmanage clonemedium ...".
QEMU is more convenient in some ways, since to perform a conversion you don't even need a full installation of QEMU, but merely the qemu-img command-line program, which at least in Linux Mint is a separate installation ("apt install qemu-utils"). The command to convert to VMDK, for example, is "qemu-img -f VDI -F VMDK VirtualAGC-VM64.vdi VirtualAGC-VM64.vmdk". I've not actually tried it myself, though. It's good that a full QEMU installation isn't needed for conversion, since the technique for performing a full install of QEMU can be a tad unobvious. At least in Linux Mint, the technique is to use "sudo apt intall bridge-utils virt-manager" and then reboot; QEMU itself can then be run as the "Virtual Machine Manager". Who would have guessed?
Additionally, for hypervisors other than VirtualBox,
you'll have to manually create a VM using the native tools
provided by the particular hypervisor, and then attach the
VirtualAGC virtual disk to that VM. In my experience,
creating a VM that uses a pre-existing virtual disk may prove to
be a tricky feat in some hypervisors — which like to create the
virtual disk for you at the time the VM itself is created,
instead of admitting you might already have one —, but I have
faith in you!
Of course, just being able to create a VM with a virtual disk in
the appropriate format for a given hypervisor does not necessarily
imply the ability of that hypervisor to run that virtual
machine! One would hope so, but believe me, it ain't
necessarily so. (I've made some conversions that won't
boot up afterward.) But in the case of the VirtualAGC VM, it
does seem okay. Here's some testing I performed:
In all of the cases I was able to try, some of the features I
like that are provided by VirtualBox were absent, though nothing
that would seriously prevent running the Virtual AGC VM in one of
these alternate virtualization systems.
Building Virtual AGC from source actually has a limitation
compared to running the VM as described above, which is that while
the VM is already set up for visual debugging of AGC code using
Code::Blocks, this capability is not a part of Virtual AGC
proper. That is, Code::Blocks based AGC debugging has its
own set of installations, requirements, and setups, distinct from
those of building Virtual AGC proper ... which is all that's
discussed below. If (once Virtual AGC is built and working
satisfactorily) you want to do visual debugging, you need to
install Code::Blocks and should consult the
instructions for development using Code::Blocks on our GitHub
wiki, as well as the
instructions
for visual debugging.
Of course, it also has the limitation that we can't actually deal
with every platform people might try to use. So I
make a pretty strong effort to make sure it works on Ubuntu- and
Debian-based 64-bit 'x86 Linux, which I use every day, and
occasionally (rarely) try to check that the process still works on
whatever versions of Raspberry Pi, Windows, Mac OS X, FreeBSD, and
Solaris it happens to be convenient for me to run personally.
The complete up-to-the-moment source code is available from GitHub.
There
are several ways which one might choose to download it, such as in a
zipfile or using the 'git' program, which in Linux (for
example) would look like this:
The "git clone" method has the great advantage that the download can be updated later with a simply command ("git pull"), whereas the zipfile methods basically requires starting over again from scratch. In either case, you end up with a folder called virtualagc.git clone --depth 1 https://github.com/virtualagc/virtualagc
The advent of high-resolution displays such 4K, in which the
number of pixels per inch has increased drastically but the
physical dimensions of the display have barely changed, has a
dramatic effect on graphical programs such as our yaDSKY2,
yaDEDA2, VirtualAGC, and so on, whose
user-interfaces were developed with pixel-based positioning in
mind rather than distance-based positioning. In other words,
if you run (say) yaDSKY2, designed for a 1920×1080
display, on a 3840×2160 display that's roughly the same size
physical dimensions, it's going to look very tiny. Possibly
it will be unreadable. Alas, this effect cannot always be
detected in an automated way by the software itself.
In Windows and Linux you can work around this in Virtual AGC by
defining an environment variable called AGC_SCALE
which controls the "scaling" of the graphical user interfaces in
Virtual AGC programs. In Mac OS there is a subtle
difference, in that this environment variable must be set before building
Virtual AGC, whereas in Windows and Linux it merely needs to be
set prior to running Virtual AGC. In the 4K vs
1080p example just given, you might use
AGC_SCALE=2.0
If the AGC_SCALE
variable isn't defined at all, the
scaling defaults to 1.0, so you needn't bother with it unless the
Virtual AGC programs don't look right. And it doesn't matter
exactly what the scale factor is, as long as it's something
comfortable to you. In the example above, it didn't need to
be 2.0; perhaps you found 1.5 to be good enough, or 2.25 to be
better. However, not all Virtual AGC programs treat scaling
with equal grace, so 2.0 is ultimately likely to prove to be the
best choice anyway. Note too that the scaling is going to be
more "exact" if it's an exact integer. For fractional values
like 2.25, various controls in the user interface might be
positioned incorrectly by fractions of a pixel. And if large
scaling factors are used, imperfections in the graphics designed
into the user interface will become exaggerated, causing them to
appear blocky.
The method for making such environment variables permanently
available to all Virtual AGC programs — i.e., both to
programs run from desktop icons and to those run from a
command line — varies by operating-system type:
Tcl/Tk, and in particular the Tcl program wish, is
required for running the optional Virtual AGC component LM_Simulator.
If wish already works for you, then you can just skip this
section.
You may find, however, that wish does not work on your
computer, making LM_Simulator is unusable.
Additional setup is needed.
Aside: Why might this happen? For example, in Mac OS versions at least from Monterey through Sequoia:
- The version of Tcl/Tk in a base Mac OS installation is defective. (The symptom is that the Tcl/Tk program wish crashes instantly when invoked.)
- The defective version of Tcl/Tk cannot be uninstalled, since Mac OS regards it as essential.
- A new, non-defective version of Tcl/Tk can be installed by various means that bypass the Apple Store. (But even then, the new version would typically be installed in a folder that may have a lower priority in the PATH environment variable than the original defective version, invoking wish from a command line may continue to run the defective version rather than the new installation.)
If you haven't done so already, the first step is to install a
correctly-working version of Tcl/Tk on your computer, using
whatever method is appropriate for your computer. On Mac OS,
for example, appropriate methods might be via Homebrew, MacPorts,
or (my recommendation) building Tcl/Tk from source. As long
as wish works after doing so, you're fine!
If wish is not working once you've installed a
good version of Tcl/Tk, it's presumably because the version of
Tcl/Tk you've installed is not the one being found when wish
is used from a command line. You could just alter
your PATH to insure that your chosen version of Tcl/Tk is one
being found, though in principle such a change to your PATH could
have undesirable side effects. A workaround that eliminates
any undesirable side effects by isolating any effects to Virtual
AGC alone is to create an environment variable called AGC_WISH
.
This environment variable must be assigned a value which is the
path to your preferred correctly-working installation of
Tcl/Tk. Specifically, it's the name of the folder in which
the Tcl program called wish is found. This path must
include a trailing path separator native to your system: \
for Windows or / for all others. For example, on Linux or
Mac OS, a default installation of Tcl/Tk would place wish
at /usr/bin/wish, whereas an alternate installation might put it
in /usr/local/bin/wish, so you would assign AGC_WISH=/usr/local/bin/
.
The methods for permanently creating an environment variable are
described in the preceding section.
wxWidgets is a cross-platform toolkit, suitable for
writing software have a graphical user interface (GUI) that can be
used with a simple recompilation on any platform supported by wxWidgets.
In other words, using a single base of source code, Virtual AGC
can be recompiled to run on Windows or Mac OS or Linux or
wherever.
In building Virtual AGC from source, version 2.8 of wxWidgets
has been recommended for a long time, and the instructions given
below often rely on this fact. However, I have observed that
it is becoming increasingly difficult to even put together a setup
having a working version of wxWidgets 2.8 in Linux,
because its prerequisites often conflict seemingly irreconcilably
with components of default installations of Linux. Indeed,
it's not even clear to me if the current Virtual AGC code base
compiles with wxWidgets 2.8, or it it works once compiled,
because I seem to have to working installation upon which to test
it. Moreover, I have no working installations of 2.8 on Mac
OS or Windows to work with.
Virtual AGC is thus currently being developed using wxWidgets
version 3.2. Given a choice between wxWidgets 2.8,
3.0, or 3.2, choose 3.2.
Because I am lazy, I prefer to develop software only with the
tools I already know and understand. Usually, roughly
speaking, those end up being the minimalist tools that there's a
fighting chance the majority of developers can also work with
somewhat easily. For better or worse, that's why all of the
"official" build instructions for Virtual AGC on various target
platforms in the following sections are based simply on 'make'
(specifically, GNU 'make'), without the fancier kind of build
environments that may be easier for the user but have a steeper
learning curve for the developer. For example, among the
"fancy" build environments I'm referring to are those based on
autoconf/automake or CMake, which many would prefer. I
myself might prefer them ... as a user rather than a maintainer!
However, not everyone is as lazy as I or philosophically inclined
in quite the same way, so sometimes others step up to fill in the
gaps I've left. This is the case with CMake-based builds of
Virtual AGC. Michael Hirsch has stepped up to do so (thanks,
Michael!), and if the "official" instructions below don't appeal
to you, or if you simply like the idea of using CMake, Michael's documentation
for the CMake-based build process can be found in our GitHub
repository's wiki. Whether those instructions are
up-to-date or not is a question I'd prefer not to address.
Since Michael maintains both that wiki page and the CMake process
itself, please don't attempt to get any sensible response from me
(RSB) if you encounter problems with them or have questions.
You'll want to use our GitHub repository's issue system to report
problems, or direct inquiries via the GitHub communication system
to Michael's tag (@scivision).
![]() |
This works! Last verified (Ubuntu 24.04 64-bit): 2024-12-29 Last verified (Linux Mint 21.3): 2024-12-29 Last verified (Linux Mint 22.01): 2025-02-06 |
Note: Python 2 has essentially been discontinued insofar as Ubuntu 24 is concerned, and I suppose that other Linux distributions are not far behind. In other words, it has become quite difficult to install. If that's the case in your setup, don't worry! Very few Python 2 scripts are present in Virtual AGC, and all critical scripts are in Python 3. Therefore, if you cannot install Python 2 it's almost certainly okay, but you'll be missing some very minor features of Virtual AGC until I can convert all remaining Python 2 scripts into Python 3.
By the way, it's preferable to build Virtual AGC on a clean
Linux installation. If (like me) you have a system that's
used extensively for software development, you may have lots of
stuff installed beyond what's mentioned above. That extra
stuff may cause you problems. Hopefully that won't happen to
most people, but I suspect that a higher percentage of folks
interested in Virtual AGC would have this kind of problem than
those picked at random from the general population.
Sometimes, extra command-line switches for 'make' can be used to
eliminate conflicts by overriding the default compiler
choices. There are two such switches, FORCE_cc and FORCE_CC,
which respectively override the C compiler and the C++
compiler. See the comments in the
Makefile itself for more explanation. The switches can
override not merely the filesystem paths for locating the compiler
(when you have multiple versions of gcc or g++ installed), but can
be used to specify completely different C/C++ compilers, such as
clang (which might be installed using a command such as "sudo
apt-get install clang-3.9 libclang-3.9-dev"). As an
example, the command I use to build Virtual AGC using clang rather
than gcc/g++ is:
The switch FORCE_clang in this case provides some additional clang tweaks beyond just the compiler locations. (Don't interpret this as a claim that clang is supported. It's not! But you may be able to get away with using it, if you're adventurous.)make FORCE_clang=yes FORCE_cc=/usr/bin/clang-3.9 FORCE_CC=/usr/bin/clang++-3.9 clean install
cd ~/VirtualAGC/Resources
../bin/VirtualAGC
![]() |
This worked Last verified (Raspbian Jessie): 2017-11-20 Last verified (Raspbian Stretch): 2018-05-11 See notes below for Raspbian Buster |
![]() |
This worked Last verified: 2017-08-31 |
Building Virtual AGC:
![]() |
This worked Last verified: 2017-08-31 |
Build Virtual AGC:
![]() |
This works! Last verified (older Macs): 2021-11-12 Last verified without LM_Simulator (Monterey): 2024-12-22 See notes below for Sequoia |
Building Virtual AGC:
However, not all features of the VirtualAGC GUI program
necessarily work. For example, while you can run simulated
AGCs (which is the main thing!), you may not be able to browse the
AGC source code from within VirtualAGC. What is supposed
to happen when you use VirtualAGC's source-browsing feature is
that it simply launches whatever default web-browser you have set
up on your system, and shows you the AGC/AEA source code within
that browser ... and indeed, this approach used to work in
Mac OS X. But what happens for me is that there's simply an
error message complaining that "There is no default application
configured for HTML files". However, I can certainly
configure the default browser, and have changed it back and forth
between Safari and Chrome, so I'm not sure what this message is
complaining about. Perhaps it's an X11 error. At any
rate, I have not been able to solve it. You can still browse
the source, of course: simply right-click on the VirtualAGC
app icon on the desktop, and select "show package contents";
navigate down to Contents/Resources/source/, select the mission
you're interested in, and double-click on the MAIN.agc.html file
you find in that directory. It will open up in your default
browser, just as it should have done in the VirtualAGC
program.
Another quirk that may be of interest on the Mac is how to run
individual GUI applications like yaDSKY2 or yaTelemetry, without
having to run the VirtualAGC application. Again, right-click
on the VirtualAGC desktop icon and select "show package
contents". Navigate down to Contents/MacOS/, and you'll find
the various individual GUI applications there, where you can
simply run them by double-clicking on them.
(The instructions in the next section are recommended
for Monterey rather than the ones in this section. This
section uses Macports to speed up the installation process, but
there are drawbacks to doing so, because the side effects can be
hard to undo later. You have been warned! These
instructions do seem to work if you don't mind inviting later
difficulties. On the other hand, if you happen to be using
Macports already anyway then you may as well proceed!)
Ludo Visser has sent me instructions for building Virtual AGC on
a clean installation of MacOS 12.0.1 (Monterey). Virtual AGC
itself required no changes. He does mention that he didn't
try it out with a joystick, but other than that indicates that
Virtual AGC does work "out of the box" after he builds it.
Recall the comments
already made about high-resolution displays. If your
Mac has such a display and you will use the environment variable AGC_SCALE
to correct for it, make sure that AGC_SCALE
is
properly set (and exported) before proceeding.
Here are Ludo's instructions, verbatim:
xcode-select --install
sudo port selfupdateThe various
sudo port install git +credential_osxkeychain sudo port install wxWidgets-3.2 port contents wxWidgets-3.2 | grep bin # note path export PATH=/opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxWidgets/3.1/bin:$PATH # path from command above export cc=clang export CC=clang++ git clone https://github.com/virtualagc/virtualagc.git cd virtualagc make MACOSX=yes FORCE_clang=yes clean install
export
commands listed above make changes
to the associated environment variables that are only
temporary. The associated environment variables will thus
disappear after the command-line shell is closed. In other
words, you'll have to use these very same commands every time you
open a command-line window to rebuild Virtual AGC. So you may
want to make the changes permanent instead. Unfortunately, the
method for making permanent changes to environment variables varies
by Mac OS version, as well as according to which command-shell
program is being used. If the zsh
command shell
is being used, as is the case by default in Monterey, then the export
commands can be added to a file called ~/.zprofile to make them
permanent. If that doesn't work for you, I'm afraid you'll
have to research it yourself.python
" or "python3
" can be used
interchangeably to run Python 3, and thus certain uses will fail if
that's not true, so some additional setup is needed to restore the
expected functionality. Alas, there are so many possibilities
as to how this might fail and how it might be fixed that I cannot
much helpful guidance. I will limit myself to the following
observation: Verilog simulation of AGC electronics will fail
if the command "python
"
does not run Python 3, but if the command "/usr/local/bin/python3
"
does run Python 3, then the commandwill allow the command "ln -s /usr/local/bin/python3 /usr/local/bin/python
python
"
subsequently to work as expected and Verilog simulations to
function.Note: The first time you run VirtualAGC from its desktop icon after installation, it may take a considerable amount of time to start up. There will be no such delays on subsequent startups.
Moreover, the first time you run it you may see a pop-up window prompting you to grant it permission to modify files on your desktop, which you should accept. The desktop files it modifies are within the VirtualAGC app folder itself, which just happens to reside on your desktop. In other words, nothing outside of VirtualAGC itself is modified. However, if you are security-conscious enough that permitting this access seems scary, you can avoid the problem by moving the VirtualAGC app to some other folder not on the desktop. Perhaps to a dedicated folder you create yourself. You'll still be asked for permission, but it will be for the folder you've selected and not for your desktop.
Indeed, I expect you could actually move the entire VirtualAGC app from the desktop onto any Mac OS machine of the same version or later as the machine on which you built it, though I have not tried it and do not guarantee it.
I'm told that the instructions given above for Mac OS Monterey do
not work as-is for some later versions of Mac OS, such as
Sequoia. Gavin Eadie (thanks, Gavin!) has sent me modified
instructions. The executive summary is that these
instructions are the same as for Monterey, except that wxWidgets
is built from source rather than installed via Macports.
That being the case, it would be my supposition that these
instructions should work just as well on Mac OS Monterey, Ventura,
or Sonoma as in Sequoia, but only time will tell.
Note: A full installation of Xcode is not needed, though it's fine if present. It's only necessary to have the so-called Xcode command-line tools, which can either be installed stand-alone or else as part of a full Xcode installation.Recall the comments already made about high-resolution displays. If your Mac has such a display and you will use the environment variable
AGC_SCALE
to correct for it, make sure that AGC_SCALE
is
properly set (and exported) before proceeding. This causes AGC_SCALE
to be hard-coded into the Virtual AGC application. (But it can
be changed anytime afterward by modifying the file
VirtualAGC.app/Contents/Info.plist with a text editor.)cc
(as described in the next step) before building
wxWidgets. If you do have such an environment variable,
get rid of it until after building of wxWidgets is complete.export cc=clang export CC=clang++ git clone --depth=1 https://github.com/virtualagc/virtualagc.git cd virtualagc make MACOSX=yes FORCE_clang=yes clean installThe various
export
commands listed above make changes
to the associated environment variables that are only
temporary. The associated environment variables will thus
disappear after the command-line shell is closed. In other
words, you'll have to use these very same commands every time you
open a command-line window to rebuild Virtual AGC. So you may
want to make the changes permanent instead. Unfortunately, the
method for making permanent changes to environment variables varies
by Mac OS version, as well as according to which command-shell
program is being used. If the zsh
command shell
is being used, as is the case by default in Monterey, then the export
commands can be added to a file called ~/.zprofile to make them
permanent. If the bash
command shell is used,
then the file you need to edit is ~/.bashrc. If these don't
work for you, I'm afraid you'll have to research it yourself.python
" or "python3
" can be used
interchangeably to run Python 3, and thus certain uses will fail if
that's not true, so some additional setup is needed to restore the
expected functionality. Alas, there are so many possibilities
as to how this might fail and how it might be fixed that I cannot
much helpful guidance. I will limit myself to the following
observation: Verilog simulation of AGC electronics will fail
if the command "python
"
does not run Python 3, but if the command "/usr/local/bin/python3
"
does run Python 3, then the commandwill allow the command "ln -s /usr/local/bin/python3 /usr/local/bin/python
python
"
subsequently to work as expected and Verilog simulations to
function.Note: If you do decide to use ApoDisKey and discover some problem or think of a suggestion, report it directly to Gavin and not to me! I've got enough problems of my own to worry about, and couldn't fix a problem in Swift if I had a flying laboratory to help me do so.
To "install" ApoDisKey for use with the VirtualAGC
GUI, I found that all I had to do was to download the zip-file
containing the executable. There were no other installation
steps. I simply left the zip-file in my downloads
folder. I was even able to download multiple versions of ApoDisKey
over time, without bothering to erase or even rename the old ones,
because I have arranged for VirtualAGC to always use the
most-recently "installed" version. All of which I think is
pretty nifty.
The presence of ApoDisKey does not automatically override
the use of yaDSKY2. Rather, when you run VirtualAGC,
you'll see choices of DSKY "interface styles", as in the image to
the right. The COM and COM/2 styles refer to yaDSKY2
(full-size and half-size respectively), while the Mac and Mac/2
styles refer instead to ApoDisKey. The Mac and Mac/2
options will be grayed-out and disabled if ApoDisKey isn't
found.
Having trouble deciding whether to install ApoDisKey or
not? The screenshots below give you a side-by-side
comparison of yaDSKY2 vs an actual DSKY vs ApoDisKey
on Mac OS Monterey, in which I mentioned above that ApoDisKey
has some visual deficiencies due to the obsolescence of the
Monterey system libraries. See if you can spot them!
(Hint: It's not the color of the metal face! Nor the labels
on the 2×7 array of indicator
lamps, which vary by mission anyway.)
![]() |
![]() |
![]() |
![]() |
This works! Last verified (RSB, Windows 11): 2024-12-22 See notes below for discrepancies |
This section describes installation instructions nominally for
Windows 11, and may or may not work on other versions of Windows
not specifically mentioned in the box above as having been
checked. The build will be performed using a Linux/Mac-like
command-line development environment called MSYS2, via
Linux/Mac-like tools available in that environment. But the
Virtual AGC programs produced by the build can be run directly
from your Windows desktop without any dependence on the
Linux/Mac-like process which created them.
Note: At this writing, MSYS2 supports only Windows 10 or later.
Aside: Presumably, a true Windows user (unlike myself) would prefer a build process based on Visual Studio, or at worst, on the Windows Subsystem for Linux (WSL). I am not in a position to try these things personally, but am willing to be instructed by anyone who can get it working and give me the exact instructions without any expectation that I can personally try them or debug them. I'd guess that there would be a much better chance for WSL than for Visual Studio, and that the standard Linux build instructions could be a better place to start than these Windows build instructions. On the other hand, my guess about that has essentially zero value.
One-time setup:
Note: If you already have installed MSYS2 but with an environment other than UCRT64, it may become confusing with multiple environments installed. Therefore, perhaps continuing with your already-installed environment would be advisable instead of installing UCRT64. Personally, I have not tried anything other than UCRT64 for building Virtual AGC, so I cannot claim that I know it will work.
pacman -S make grep diffutils python3 python3-pip git wget unzip \ $MINGW_PACKAGE_PREFIX-gcc \
$MINGW_PACKAGE_PREFIX-libc++ \
$MINGW_PACKAGE_PREFIX-winpthreads \ $MINGW_PACKAGE_PREFIX-libsystre \ $MINGW_PACKAGE_PREFIX-ncurses \ $MINGW_PACKAGE_PREFIX-clang \
$MINGW_PACKAGE_PREFIX-wxwidgets3.2-msw \
$MINGW_PACKAGE_PREFIX-tcl \
$MINGW_PACKAGE_PREFIX-tk
git pull
":Having performed the one-time setup, you can build Virtual AGC via one of the following command sequences,git clone --depth=1 https://github.com/virtualagc/virtualagc.git
Which particular command you choose depends on whether you prefer to compile using GNU gcc/g++, or whether you prefer to compile using clang/clang++, and on whether you have clutter from previous builds that you want to clear away.cd virtualagcor
make WIN32=yes install
make WIN32=yes clean installor
make cc=clang CC=clang++ WIN32=yes installor
make cc=clang CC=clang++ WIN32=yes clean install
cd VirtualAGC.installed\Resources
VirtualAGC.bat
Aside: Incidentally, while I don't expect you'd have any occasion to do so, the directory VirtualAGC.installed mentioned above should be self-contained, in that it includes all executables and DLL's, so I expect you could probably just copy the entire directory to any Windows machine of the same version on which you built it or later. I have not tried that, though, so I wouldn't bet any money on it.
![]() |
This worked Last verified (RSB, Linux Mint 21): 2022-09-25 |
I probably don't need to describe what WebAssembly (Wasm) is, since
anybody interested enough in reading about how to build Virtual
AGC for it almost certainly would know much more about it than I
do anyway. Nevertheless, here's what little I do know.
While WebAssembly apparently has a number of potential use cases,
the main use case for it at present seems to be as a way to port
applications so that they can run within a web browser ... but to
run somewhat faster than if they were instead ported to
JavaScript. Pragmatically, WebAssembly requires a browser
which actually supports the WebAssembly virtual machine, though as
of this writing (2021-05-26) such support is pretty widespread and
includes Firefox, Chrome, Edge, and Safari.
Of course, for some years there has already been a JavaScript
port of Virtual AGC: moonjs
by Shahriar Iravanian (live
demo), which runs the Colossus 249 AGC program (Apollo 9
CM). Moonjs is based on a
subset of JavaScript called asm.js, which is optimized to
allow faster-execution than arbitrarily-coded full-featured
JavaScript programs would. It would be interesting some day
to have a head-to-head speed competition between webAGC and
moonjs, though of course if both could achieve speed parity with a
physical AGC, then anything beyond that is gravy. Shahriar's
build
instructions for moonjs are pretty straightforward, and I
won't repeat them here. I should note that moonjs relies on
emscripten to port yaAGC.c
to asm.js, but that emscripten now seems to target WebAssembly
rather than asm.js, so that train may have left the station!
But as far as the WebAssembly port is concerned, here's my
interpretation of Michael's
build instructions for Linux Mint 19 or later, 64-bit.
The instructions won't work in Mint 17 or earlier because of
library-versioning problems. First, here is the one-time
setup:
Note that although I called this a one-time setup, the environment variable WASI_SDK_PATH will remain set only in this particular instance of the command line window, and will not persist if you open another command line afterward. This lack of persistence only becomes a problem if you later need to compile the WebAssembly target for Virtual AGC again in a new command-line window, and hence need to set WASI_SDK_PATH again. But you may wish to permanently set this environment variable to avoid confusion later.cd ~/wasi-sdk
wget https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-16/wasi-sdk-16.0-linux.tar.gz
tar xvf wasi-sdk-16.0-linux.tar.gz
export WASI_SDK_PATH=~/wasi-sdk/wasi-sdk-16.0
cd yaAGCThe file yaAGC/yaAGC.wasm is what you actually need for your web page, so this is the end of the build process for Virtual AGC
WASI=yes make [clean] yaAGC.wasm
Browsers can read files even from hard disk and display static websites (html, js, css) just like, say, a word processor displays a word document. Strictly speaking, no HTTP servers are required in that scenario. However, when using more modern browser features, like JavaScript modules, WebAssembly, WebRTC etc., the browser insists that content be served over the network. This doesn't mean that servers need to have any 'business logic' implemented; they can just be static content delivery pipes. In this sense, the webAGC demo is indeed a pure browser/client solution; it is completely unaware of a server.Which just reminds me of why I have always preferred not to become involved in web programming, and came away frustrated every time I was forced to do so.
![]() |
Sorry! |
If that's too much for you, there are some things you may be able to do to make it more efficient. First, note that the VirtualAGC program — which isn't a component of the simulation, but merely a convenient graphical interface so that you don't have to memorize command-line options for the actual components — actually takes 25-30% of the CPU (for either of the two Pi models mentioned above) all by itself. You don't really need to run it if you don't want to. But how do you run a simulation easily without VirtualAGC? Well, if you run the simulation just once from VirtualAGC, and exit the simulation immediately after starting it, you'll find that it has automatically created a script called "simulate" which can be used to start that exact configuration of the simulation without running VirtualAGC itself. As a result, you get CPU utilizations closer to 50% or 10%, respectively, on the two Pi models mentioned above. To just run that script, you do this:
cd VirtualAGC/temp/lVirtualAGC/Resources
./simulate