-
Notifications
You must be signed in to change notification settings - Fork 14
Home
Note 1: If you plan to use Windows(not the best idea) you should first follow these instructions, and then come back to this wiki.
Note 2: This guide assumes that you have installed an Ubuntu 20.04 distribution on your machine.
After you have a working Ubuntu you can start reading this guide.
ssh-keys
Your life will be much easier if you spend 2 minutes setting up your ssh-keys to easily access your git repositories. The detailed guide can be found in How to install shh-keys on Gitlab
To create a new SSH key pair:
-
Open a terminal on Linux
-
Generate a new ED25519 SSH key pair:
ssh-keygen -t ed25519 -C "[email protected]"
Or, if you want to use RSA:
ssh-keygen -o -t rsa -b 4096 -C "[email protected]"
The
-C
flag adds a comment in the key in case you have multiple of them and want to tell which is which. It is optional. -
Next, you will be prompted to input a file path to save your SSH key pair to. If you don't already have an SSH key pair and aren't generating a deploy key, use the suggested path by pressing Enter. Using the suggested path will normally allow your SSH client to automatically use the SSH key pair with no additional configuration.
If you already have an SSH key pair with the suggested file path, you will need to input a new file path and declare what host this SSH key pair will be used for in your
~/.ssh/config
file. -
Once the path is decided, you will be prompted to input a password to secure your new SSH key pair. It's a best practice to use a password, but it's not required and you can skip creating it by pressing Enter twice.
If, in any case, you want to add or change the password of your SSH key pair, you can use the
-p
flag:ssh-keygen -p -o -f <keyname>
Now, it's time to add the newly created public key to your GitLab account.
- Copy your public SSH key to the clipboard by using one of the commands below depending on your Operating System:
WSL / GNU/Linux (requires the xclip package):
xclip -sel clip < ~/.ssh/id_ed25519.pub
You can also open the key in a graphical editor and copy it from there, but be careful not to accidentally change anything.
The right toolset
While we can spend years discussing which are the "best" tools for working, here is the bare minimum set of tools you will need to work in our lab. The choice of these tools is backed up by my personal and professional experience, both, in academia and in industry.
My hope is that you also spend quite a lot of time searching around which is the best toolset that fits you. Most people usually underestimate this fact, and by the time they enter the job market or Academia, it's probably too late to spend time to improve your tools. It's actually quite straightforward if your tools suck, you suck, go ahead and invest the right amount of time now that you probably have it.
-
git
sudo apt install git
-
build tools
sudo apt install build-essential
-
cmake
sudo apt install cmake
-
cppcheck
sudo apt install cppcheck
-
clang-tools
sudo apt install clang-format clang-tidy clangd
In short, you could install all the necessary packages with the following command:
sudo apt update
sudo apt install git build-essential cmake cppcheck clang-format clang-tidy clangd
Modern text editors
- Visual Studio Code This is the one we use internally
- Sublime Text
How to install on Linux? Couldn't be easier:
NOTE If you are running Windows using WSL
you can skip this step
sudo snap install code --classic
Visual studio is an open-source and great tool, that will allow you to do anything you need, from editing C++ or python code to write your LaTeX documents, all using the same editor and with the same settings. This is the de-factor in both industry and research. IDEs were popular some years ago, but not anymore.
Even when vscode is a powerful tool, you will need to install some extensions to make it more user-friendly. I would recommend to you to briefly take a look at the extensions web page before installing it, you can simply find this by googling the name + vscode
Too lazy to install all manually? Just run this script: install_vs_code_extensions
Visual Studio Code Extension Summary
Name | How to install: Ctrl + p and type |
---|---|
C/C++ | ext install ms-vscode.cpptools |
clangd | ext install llvm-vs-code-extensions.vscode-clangd |
Name | How to install: Ctrl + p and type |
---|---|
CMake | ext install twxs.cmake |
CMake Tools Helper | ext install ms-vscode.cmake-tools |
CMake format | ext install cheshirekow.cmake-format |
Name | How to install: Ctrl + p and type |
---|---|
Markdown all in one | ext install yzhang.markdown-all-in-one |
Markdown lint | ext install DavidAnson.vscode-markdownlint |
You should spend some time on your own settings, but with respect to the C++ part, I'd recommend that you use the following settings(also available here):
{
/*-------------------- GLOBAL EDITOR CONFIGURATIONS -------------------------*/
"editor.formatOnType": true,
"editor.formatOnPaste": true,
"editor.formatOnSave": true,
/*----------------------------- C++ STUFF ----------------------------------*/
"C_Cpp.autocomplete": "Disabled",
"C_Cpp.formatting": "Disabled",
"C_Cpp.errorSquiggles": "Disabled",
"C_Cpp.intelliSenseEngine": "Disabled",
//clangd
"clangd.arguments": [
"--background-index",
"--clang-tidy",
"--header-insertion=never",
"--suggest-missing-includes",
"--compile-commands-dir=build/"
],
}
clang-tools config files
If you want to use the same configuration files that we use and the hw_bot
use you can copy-paste these files into your repository: