Installing SPIM

COMP1521 uses SPIM, which is already available to you on CSE systems.

If you want to set up SPIM on your own computer, download it from, or from one of these links:

For Windows, run the .MSI installer bundle, which will set up QtSPIM for you.

For macOS, run the .PKG installer bundle, which will set up QtSPIM for you.

For 64-bit Debian Linux, including Ubuntu and Mint, install the .deb file, which will set up QtSPIM for you.

Building your own SPIM

On other platforms, you may need to compile from source.

We suggest the patched version of SPIM, linked above. You'll need CMake, a C/C++ compiler, flex, and bison; if you want XSPIM, you'll need X11 (including Xt and Xaw) development files installed; if you want QtSPIM, you'll need Qt development files installed. These should be available from your package manager.

apt install cmake gcc flex bison lib{xt6,xaw7}-dev qtbase5-dev
dnf install cmake gcc flex bison lib{Xt,Xaw}-devel qt5-qtbase-devel
pkg install cmake flex bison lib{Xt,Xaw} qt5-core

Extract the tarball —

tar -xzf spim-simulator-spim-pkg.tar.gz
cd spim-simulator-spim-pkg

And run CMake to configure, build, and install SPIM. You should probably set the value of CMAKE_INSTALL_PREFIX to your home directory, which we do here; by default, it will install into /usr/local, so the installation may need administrative permissions.

[... some output ...]
cmake --build obj
[... lots more output ...]
cmake --build obj -t install
[... some output, ending in ...]
-- Install configuration: ""
-- Installing: $HOME/share/spim/exceptions.s
-- Installing: $HOME/share/spim/helloworld.s
-- Installing: $HOME/bin/spim
-- Installing: $HOME/bin/xspim                  [if X11 was found]
-- Installing: $HOME/bin/qtspim                 [if Qt was found]

If all went well, you should now be able to run the spim or qtspim commands.

If you have questions, please ask on the course forum, and we'll try and help you out.