Welcome to the CS2413 lab repository.
This repository contains the starter code, lab exercises, and programming assignments for this semester.
The main goals of this repo are:
- Use a consistent workflow for all labs and code assignments
- Help you practice professional software development habits (Git + GitHub)
- Provide a clean structure for compiling and running C programs
To ensure everyone can compile and run the same code successfully, this course officially supports:
✅ Ubuntu Linux (including WSL Ubuntu on Windows)
✅ macOS (Terminal + Xcode Command Line Tools)
❌ Not supported (do not use these for this course):
- Native Windows builds (PowerShell / CMD)
- MinGW / MSVC
- Code::Blocks / Dev-C++
All grading will be done in a Linux-compatible environment.
If your setup is not Ubuntu/macOS, your code may fail even if it works on your machine.
Install required packages:
sudo apt update
sudo apt install -y build-essential gitVerify installation:
gcc --version
make --version
git --versionInstall Apple Command Line Tools:
xcode-select --installVerify installation:
clang --version
make --version
git --versionRecommended editor: VS Code
You will use GitHub for:
- Lab sessions
- Coding assignments
- Submitting your work
- Fork this repository to your GitHub account
- Clone your fork to your computer
- Work in the correct lab folder
- Commit and push your changes to GitHub
Example:
git add .
git commit -m "lab01: complete two_sum"
git push origin mainEach lab is in its own folder (example):
lab00/ -> starter demo (practice Git + compile/run)
lab01/ -> first real lab
lab02/ -> future labs...
Inside each lab folder, you will typically see:
src/ -> where you write/modify code
tests/ -> runner / verification code
Makefile -> compile/run commands
README.md -> lab instructions
Go into the lab folder first. Example:
cd lab01make runSome labs include a small self-benchmark for self-comparison only.
To disable it:
make run_nobenchmake cleanNotes:
- The self-benchmark is NOT used for grading.
- It is only for self-comparison (e.g., after optimizing your code).
Your submission is your latest commit pushed to GitHub.
Before you push, always check:
git statusThen submit:
git add .
git commit -m "labXX: complete"
git push origin mainNew labs (lab02, lab03, …) will be released by adding new folders to the course repository.
Your fork will NOT update automatically.
Step 1: Sync your fork on GitHub
-
Go to your forked repo on GitHub
-
Click Sync fork → Update branch
Step 2: Update your local repo (your laptop)
- Open Ubuntu/macOS Terminal inside your repo folder and run:
git pull
After that, you should see the new lab folder (for example lab02/) in your local files.
You are encouraged to:
- discuss ideas
- ask questions
- help others understand concepts
You are NOT allowed to:
- copy another student’s code
- share your code publicly
- submit code that is not your own work
If you are unsure what is allowed, ask the instructor/TA before submitting.
Ubuntu/WSL:
sudo apt install -y build-essentialmacOS:
xcode-select --installYou are likely compiling in the wrong folder or missing the correct include path.
Try:
cd labXX
make clean
make runGitHub does not allow password login for command-line pushes.
Use one of the following:
- GitHub web login prompt, or
- Personal Access Token (PAT), or
- SSH keys
We will cover this in class if needed.
Recommended: Ubuntu 22.04 LTS (stable and widely used)
Other LTS versions are also OK (ex: 24.04 LTS), but we recommend 22.04 LTS to reduce unexpected issues.
If Ubuntu fails to open, you may need to enable required Windows features first:
✅ Turn on these Windows Features:
- Windows Subsystem for Linux
- Virtual Machine Platform
After enabling them, restart your computer and try opening Ubuntu again.
This happens because your folder name contains a space. You folder should be "cs2413" or "cs-2413", not "cs 2413"
https://www.youtube.com/watch?v=uTw50U9sMO8
If Ctrl+V does not work, use Ctrl+Shift+V or right-click to paste. Recommended: run Ubuntu inside Windows Terminal for normal copy/paste.
Open Windows Terminal, then type: wsl
If you run into setup issues, come a few minutes early to lab/class or ask during office hours.