Welcome to the ECE 467 labs homepage for 2020 Fall. See here for the latest version of the course.
For these labs, you may use the ECF machines, where the required software has been installed, or your own Linux virtual machine, where you will likely need to build some dependencies from source. Instructions for both setups are shown below.
If you are SSH-ing into the ECF machines (i.e. ssh <your utorid>@remote.ecf.utoronto.ca
),
learning to use GNU screen
is recommended (a reference is provided below, but google is your friend as well).
screen
is a terminal multiplexer which
1. allows you to have multiple terminal instances within a single SSH connection; and
2. allows you to detach from your terminal sessions and reattach later.
ecf-sw-env -a ECE467
.
This will enable the ECE467 environment for your account
(you can remove it with ecf-sw-env -r ECE467
).
You will need to relog for the changes to take effect.
Test it by running which bison
;
it should produce /n/share/copy/ece467/bin/bison
git clone http://individual.utoronto.ca/dfr/ece467/ece467-starter.git ece467-<student number 1>-<student number 2>
mkdir build
and cd build
cmake -DCMAKE_PREFIX_PATH=/n/share/copy/ece467 ..
make
The executable is build/src/ece467c
.
Note: CMake is arguably the de-facto build tool for C++. Although you should not have to edit the CMake files for these labs, it would be useful to learn how it works. You can read more about it starting here.
$HOME/ece467
(quote this path if your $HOME
includes spaces).
Replace this with whatever path you have chosen.
Unless specified otherwise, shell commands should be run in this directory
mkdir $HOME/ece467/prefix
bash
.
Usually this is the default shell
$HOME/ece467/prefix/bin
to your path:
PATH=$HOME/ece467/prefix/bin:$PATH
.
You can add this to your ~/.bashrc
to do this automatically on login/new shell
wget <url>
.
tar -xvf <file>
).
This may take a while
cd
into your extracted gcc directoryln -s ../gmp-4.3.2 gmp
(do the same for mpfr and mpc)
mkdir build
and cd build
../configure --prefix=$HOME/ece467/prefix --enable-languages=c++ --disable-multilib
make -j 32
(32 parallel jobs).
This will take a while
(it took me about an hour on the ECF machines,
hence why using screen
here is recommended,
so you can detach, disconnect, and come back later)
make install
. This will install gcc in $HOME/ece467/prefix/bin
which gcc
and gcc --version
(you should have added $HOME/ece467/prefix/bin
to your PATH
in the prerequisites)
export LD_LIBRARY_PATH=$HOME/ece467/prefix/lib64
so that your new GLIBC can be found
(again, you may want to add this to your ~/.bashrc
so that it gets set automatically)
cd
into your cmake directorymkdir build
and cd build
../bootstrap -- -DCMAKE_INSTALL_PREFIX=$HOME/ece467/prefix -DCMAKE_BUILD_TYPE=Release ..
make -j 32
and make install
which cmake
and cmake --version
git clone https://github.com/llvm/llvm-project
.
This will take a while
git checkout llvmorg-10.0.1
mkdir build
and cd build
CC=gcc cmake -DCMAKE_INSTALL_PREFIX=$HOME/ece467/prefix -DCMAKE_BUILD_TYPE=RelWithDebInfo ../llvm
make -j 32
and make install
.
As with GCC, this will take a while.
Again, screen or tmux are recommended for SSH sessions
cd
into your bison directorymkdir build
and cd build
../configure --prefix=$HOME/ece467/prefix
make -j 32
and make install
which bison
and bison --version
git clone https://github.com/westes/flex
./autogen.sh
mkdir build
and cd build
../configure --prefix=$HOME/ece467/prefix
make -j 32
and make install
To build your project, follow the instructions above for the ECF machines,
replacing /n/share/copy/ece467
with your prefix, i.e. $HOME/ece467
if you followed the instructions verbatim.