1 Installing Required Software
You will need to install the following software on your laptop to work on labs in this course -
- IDE - Visual Studio Code
- Java (JDK 17) - OS-specific installation instructions are below.
- Git - Version control system. OS-specific installation instructions are below.
- Autograder - OS-specific installation instructions below.
1.1 One-Liner Install (Experimental)
1.1.1 Windows
Follow the instructions in the first comment on this gist - https://gist.github.com/DhruvDh/71d90635a528db1318a36ea35da6d56d
To run the script on Windows:
- Open a PowerShell window.
- Go to the gist and click the
Raw
button next to the file name at the top. - Copy the URL from your browser’s address bar (this is the
PASTE_RAW_URL
). - Replace
PASTE_RAW_URL
in the command below with the URL you copied. - Run the command in PowerShell:
Invoke-RestMethod -Uri PASTE_RAW_URL | iex
For the current version (at the time of writing), you can use this command:
Invoke-RestMethod -Uri https://gist.githubusercontent.com/DhruvDh/71d90635a528db1318a36ea35da6d56d/raw/38aa59f4c8ee3698dd2f266321c74f81c171858e/lab-prep-windows.ps1 | iex
1.1.2 MacOS
Follow the instructions in the first comment on this gist - https://gist.github.com/DhruvDh/f313bf5edd929949a31995e247e28c53
To run the script on macOS:
- Open a Terminal window.
- Go to the gist and click the
Raw
button next to the file name at the top. - Copy the URL from your browser’s address bar (this is the
PASTE_RAW_URL
). - Replace
PASTE_RAW_URL
in the command below with the URL you copied. - Run the command in Terminal:
curl -sL PASTE_RAW_URL | bash
For the current version (at the time of writing), you can use this command:
curl -sL https://gist.githubusercontent.com/DhruvDh/f313bf5edd929949a31995e247e28c53/raw/8be0c2ff7f8e28763944497e41114a69492e3a9f/lab-prep-macos.sh | bash
This will download and execute the script, installing all necessary software and configurations for your lab preparation.
1.2 IDE - Visual Studio Code
Download and install Visual Studio Code from here.
Please go through the following videos to get familiar with Visual Studio Code - https://code.visualstudio.com/docs
Then, install the following extensions -
- https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-java-pack
- https://marketplace.visualstudio.com/items?itemName=MS-vsliveshare.vsliveshare
- https://marketplace.visualstudio.com/items?itemName=Codeium.codeium
Finally, you may be collaborating in labs with other students. Please go to https://code.visualstudio.com/learn/collaboration/live-share and learn about how to do the same.
1.3 Windows
1.3.1 Git
- We will be using
scoop
again to install git. Ensure you’ve gone through the previous steps. Copy and paste the following command into the terminal and press enter:
scoop install git
- Verify that git is installed. Copy and paste the following command into a NEW terminal window and press enter:
--version git
If you don’t get an error, you should be good to go.
1.3.2 Java (JDK 17)
We will be using a “package manager” to install the software we need, called scoop
. A package manager is a tool that allows you to install software from the command line. It is similar to the apt
package manager on Ubuntu, or brew
on MacOS.
- To start, please open a terminal by opening the start menu, typing
Terminal
, and selecting theWindows Terminal
app.
You should see a Powershell window open up. If you see a different shell, please click the down arrow in the top bar and select Powershell
. You should see a prompt like this:
PS C:\Users\yourusername>
- If you see a different prompt, please let the instructor know.
Now, copy and paste the following command into the terminal and press enter:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
This will allow the “current user” (you) to run scripts that you download from the internet.
- Next, copy and paste the following command into the terminal and press enter:
Invoke-RestMethod -Uri https://get.scoop.sh | Invoke-Expression
This will download and run the installer for the scoop
package manager.
- We will now add a “bucket” to scoop, which is a “bucket” of software
scoop
can install. Java is not in the default “main” bucket. Copy and paste the following command into the terminal and press enter:
scoop bucket add java
- Now, we can install Java. Copy and paste the following command into the terminal and press enter:
scoop install openjdk
- Finally, we can verify that Java is installed. Copy and paste the following command into a NEW terminal window and press enter:
--version javac
If you don’t get an error, you should be good to go.
1.3.3 Autograder
- We will need to install a compiler for a different programming language, called
rust
. The compiler will download, compile, and finally install the autograder. Before we begin, we need to install a few dependencies. Copy and paste the following command into the terminal and press enter:
scoop install mingw
- Now, let’s install
rust
. Go to https://rustup.rs/ and download and runrustup-init.exe
. This will open a terminal window, and you should see a window that asks you whether or not you want to install pre-requisites. The third option should say Don’t install pre-requisites and that is the one you choose by pressing3
and then Enter.
info: downloading installer
Welcome to Rust!
This will download and install the official compiler for the Rust
programming language, and its package manager, Cargo.
...
...
Current installation options:
default host triple: ...
default toolchain: ...
profile: ...
modify PATH variable: ...
1) Proceed with installation (default)
2) Customize installation
3) Cancel installation
- This is a CLI menu-driven installer. Please configure it as follows, by first pressing
2
to customize installation.
You should then see -
'm going to ask you the value of each of these installation options.
IYou may simply press the Enter key to leave unchanged.
Default host triple? [aarch64-apple-darwin]
- Please type
x86_64-pc-windows-gnu
and press enter.
You should then see -
? [stable] Default toolchain
- Please type
nightly
and press enter.
You should then see -
(minimal default, default, complete)? [default] Profile
- Please type
minimal
and press enter.
You should then see -
? (y/n) [y] Modify PATH variable
- Please type
y
and press enter.
You should then see -
:
Current installation options
: x86_64-pc-windows-gnu
default host triple: nightly
default toolchain: minimal
profile: yes
modify PATH variable
1) Proceed with installation (default)
2) Customize installation
3) Cancel installation
>
Please press enter or
1
to proceed with installation as configured.Open a NEW terminal window, type
cargo --version
and press enter. You should see something similar to -
1.77.0-nightly (2ce45605d 2024-01-04) cargo
The version number may be different, but as long as you don’t see an error, you should be good to go.
- Finally, we can install the autograder. Copy and paste the following command into the terminal and press enter:
--git=https://github.com/DhruvDh/umm.git cargo install
- You can now run
umm --help
to check if it was installed correctly. If you don’t see any errors, you should be good to go.
1.4 MacOS
1.4.1 Java (JDK 17)
We will be using a “package manager” to install the software we need, called brew
. A package manager is a tool that allows you to install software from the command line. It is similar to the apt
package manager on Ubuntu, or scoop
on Windows.
- To start, please open a terminal by opening the spotlight search and typing
Terminal
and selecting theTerminal
app.
You should see a terminal window open up. You should see a prompt like this:
yourusername@yourcomputername ~ %
If you see a different prompt, please let the instructor know.
- Before we begin, we need to install a few dependencies. Copy and paste the following command into the terminal and press enter:
xcode-select --install
- Next, copy and paste the following command into the terminal and press enter:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
This will download and run the installer for the brew
package manager.
Once the installation is complete, we need to add brew
to the path, so all future terminals will know where to find it. You can do this by running -
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
Followed by -
eval "$(/opt/homebrew/bin/brew shellenv)"
- Nex, try opening a new terminal window and typing
brew --
version` and pressing enter. You should see something similar to -
Homebrew 3.2.12
Homebrew/homebrew-core (git revision 3c2b; last commit 2021-10-13)
The version number may be different, but as long as you don’t see an error, you should be good to go.
- We will now install Java. Copy and paste the following command into the terminal and press enter:
brew install openjdk
- Finally, we can verify that Java is installed. Copy and paste the following command into a NEW terminal window and press enter:
javac --version
If you don’t get an error, you should be good to go.
1.4.2 Git
- We will be using
brew
again to install git. Ensure you’ve gone through the previous steps. Copy and paste the following command into the terminal and press enter:
brew install git
- Verify that git is installed. Copy and paste the following command into a NEW terminal window and press enter:
git --version
If you don’t get an error, you should be good to go.
1.4.3 Autograder
We will need to install a compiler for a different programming language, called
rust
. The compiler will download, compile, and finally install the autograder.Now, let’s install rust. You can do so by running -
curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly
- After that, you need to add
rust
to path, so all future terminals will know where to find it. You can do this by running -
source $HOME/.cargo/env
- Open a NEW terminal window, type
cargo --version
and press enter. You should see something similar to -
cargo 1.77.0-nightly (2ce45605d 2024-01-04)
The version number may be different, but as long as you don’t see an error, you should be good to go.
- Finally, we can install the autograder. Copy and paste the following command into the terminal and press enter:
cargo install --git=https://github.com/DhruvDh/umm.git
- You can now run
umm --help
to check if it was installed correctly. If you don’t see any errors, you should be good to go.