Compare commits
No commits in common. "cf2907d1d9a0e22b58fca58aabf64e6b85023103" and "73e16bd7973fb360c4bc176b82211f75f8ef070e" have entirely different histories.
cf2907d1d9
...
73e16bd797
|
@ -12,10 +12,7 @@
|
|||
"matepek.vscode-catch2-test-adapter",
|
||||
"twxs.cmake",
|
||||
"vadimcn.vscode-lldb",
|
||||
"xaver.clang-format",
|
||||
"yzhang.markdown-all-in-one",
|
||||
"shd101wyy.markdown-preview-enhanced",
|
||||
"streetsidesoftware.code-spell-checker"
|
||||
"xaver.clang-format"
|
||||
],
|
||||
|
||||
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
||||
|
|
|
@ -4,6 +4,21 @@
|
|||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
// {
|
||||
// "type": "lldb",
|
||||
// "request": "launch",
|
||||
// "name": "LLDB Unrolling",
|
||||
// "program": "/usr/bin/opt",
|
||||
// "args": [
|
||||
// "-load-pass-plugin",
|
||||
// "${workspaceFolder}/build/libCacheAnalysisPass.so",
|
||||
// "-passes=lru-misses",
|
||||
// "${workspaceFolder}/test/cnt.ll",
|
||||
// "-o",
|
||||
// "/dev/null"
|
||||
// ],
|
||||
// "cwd": "${workspaceFolder}"
|
||||
// },
|
||||
{
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
|
@ -19,36 +34,36 @@
|
|||
],
|
||||
"cwd": "${workspaceFolder}"
|
||||
},
|
||||
// {
|
||||
// "name": "gdb fft1",
|
||||
// "type": "cppdbg",//Only Usable with C/C++ extension installed from Microsoft.
|
||||
// "request": "launch",
|
||||
// "program": "/usr/bin/opt",
|
||||
// "args": [
|
||||
// "-load-pass-plugin",
|
||||
// "${fileDirname}/../build/lib/libCacheAnalysisPass.so",
|
||||
// "-passes='lru-misses'",
|
||||
// "${fileDirname}/../test/fft1.ll",
|
||||
// "-o",
|
||||
// "/dev/null"
|
||||
// ],
|
||||
// "stopAtEntry": false,
|
||||
// "cwd": "${fileDirname}",
|
||||
// "environment": [],
|
||||
// "externalConsole": false,
|
||||
// "MIMode": "gdb",
|
||||
// "setupCommands": [
|
||||
// {
|
||||
// "description": "Enable pretty-printing for gdb",
|
||||
// "text": "-enable-pretty-printing",
|
||||
// "ignoreFailures": true
|
||||
// },
|
||||
// {
|
||||
// "description": "Set Disassembly Flavor to Intel",
|
||||
// "text": "-gdb-set disassembly-flavor intel",
|
||||
// "ignoreFailures": true
|
||||
// }
|
||||
// ]
|
||||
// }
|
||||
{
|
||||
"name": "gdb fft1",
|
||||
"type": "cppdbg",//Only Usable with C/C++ extension installed from Microsoft.
|
||||
"request": "launch",
|
||||
"program": "/usr/bin/opt",
|
||||
"args": [
|
||||
"-load-pass-plugin",
|
||||
"${fileDirname}/../build/lib/libCacheAnalysisPass.so",
|
||||
"-passes='lru-misses'",
|
||||
"${fileDirname}/../test/fft1.ll",
|
||||
"-o",
|
||||
"/dev/null"
|
||||
],
|
||||
"stopAtEntry": false,
|
||||
"cwd": "${fileDirname}",
|
||||
"environment": [],
|
||||
"externalConsole": false,
|
||||
"MIMode": "gdb",
|
||||
"setupCommands": [
|
||||
{
|
||||
"description": "Enable pretty-printing for gdb",
|
||||
"text": "-enable-pretty-printing",
|
||||
"ignoreFailures": true
|
||||
},
|
||||
{
|
||||
"description": "Set Disassembly Flavor to Intel",
|
||||
"text": "-gdb-set disassembly-flavor intel",
|
||||
"ignoreFailures": true
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
|
@ -3,16 +3,10 @@
|
|||
// for the documentation about the tasks.json format
|
||||
"version": "2.0.0",
|
||||
"tasks": [
|
||||
{
|
||||
"label": "config",
|
||||
"type": "shell",
|
||||
"command": "rm -r build ; rm complile_commands.json ; mkdir build ; cd build ; cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DLT_LLVM_INSTALL_DIR=$LLVM_DIR ..",
|
||||
"group": "build"
|
||||
},
|
||||
{
|
||||
"label": "build",
|
||||
"type": "shell",
|
||||
"command": " cd build ; ninja ",
|
||||
"command": "./helper.sh all",
|
||||
"group": "build"
|
||||
},
|
||||
]
|
||||
|
|
141
README.md
141
README.md
|
@ -26,74 +26,17 @@ I am more than happy helping you install Linux on your machine.
|
|||
|
||||
## Setups
|
||||
|
||||
### VS Code Docker dev container (recommended setup)
|
||||
The easiest Way is to use the VM Image (pw:rtsa) provided here:
|
||||
|
||||
1.) install docker and VS Code on your Distribution. Please keep in mind Dev containers are only supported by the native version of VS Code from Microsoft!
|
||||
<https://tu-dortmund.sciebo.de/s/JbvtbtEADx92eEG/authenticate>
|
||||
|
||||
<https://docs.docker.com/get-docker/>
|
||||
On this VM you can simply open VS Code from the desktop and start coding.
|
||||
|
||||
<https://code.visualstudio.com/>
|
||||
Following are native setups and some other unrecommended Setups are at the end of this Readme.
|
||||
|
||||
For this setup you cannot use the OSS version of VS code or the version from Snap, as the remote development extensions will not work.
|
||||
Also read the VS Code setup, which might be interesting independent from your chosen Setup.
|
||||
|
||||
2.) I recommend you install the following extensions in vs code
|
||||
|
||||
clangd,
|
||||
Clang-Format,
|
||||
CodeLLDB,
|
||||
Docker and
|
||||
Remote Development (Microsoft VS Code only!)
|
||||
|
||||
For a general C/C++ setup of VS Code (I consider good) see:
|
||||
<https://ahemery.dev/2020/08/24/c-cpp-vscode/>
|
||||
|
||||
3.) The project comes with a pre configured dev container and should prompt you to use it after opening the project. With this you have a running setup. If not please continue reading the manual points.
|
||||
|
||||
3.manual.) Use the helper script to build and run a Container.
|
||||
|
||||
```bash
|
||||
./helper.sh docker
|
||||
```
|
||||
|
||||
This will build a docker image and run a Docker container with the current directory mounted.
|
||||
|
||||
The Docker container can later be started from the Docker VS Code extension.
|
||||
|
||||
4.manual) Attach VS Code to the container, in the Docker Tab, and start developing
|
||||
|
||||
### VS Code native setup
|
||||
|
||||
This is my personally preferred IDE setup for C/C++ and by no means needed to accomplish this exercise.
|
||||
|
||||
1.) Install VS Code on your Distribution or get it from Microsoft.
|
||||
|
||||
<https://code.visualstudio.com/>
|
||||
|
||||
2.) I recommend you install the following extensions in vs code
|
||||
|
||||
clangd,
|
||||
Clang-Format,
|
||||
CodeLLDB,
|
||||
C++ TestMate,
|
||||
Docker and
|
||||
Remote Development (Microsoft VS Code only!)
|
||||
|
||||
For a general C/C++ setup of VS Code (I consider good) see:
|
||||
<https://ahemery.dev/2020/08/24/c-cpp-vscode/>
|
||||
|
||||
Most parts can be skipped, as they are already integrated in this Repo.
|
||||
|
||||
3.a.) Set the LLVM_DIR variable to your LLVM(14) installation.
|
||||
|
||||
```bash
|
||||
export LLVM_DIR=<path/to/your/llvm/installation>
|
||||
```
|
||||
|
||||
3.b.) You can auto config and build by hitting Ctr+Shift+B from the IDE or use the helper script.
|
||||
|
||||
4.) Pressing F5 will start a debug session, make sure to set halting points.
|
||||
|
||||
### Mac setup
|
||||
### Mac Setup
|
||||
|
||||
I recommend using docker and VS Code for setup.
|
||||
Also check out the recommended extensions in the Docker section.
|
||||
|
@ -106,7 +49,7 @@ For Mac (tested on M1 Mac mini) you can also use:
|
|||
|
||||
But you will need brew installed and also have to use the poolhelper script instead of the normal helper script.
|
||||
|
||||
### Setup on a pool PC
|
||||
### Setup on a Pool PC
|
||||
|
||||
At first get an IRB account from the following link and log in:
|
||||
|
||||
|
@ -134,7 +77,66 @@ Now you have a llvm13 source build.
|
|||
|
||||
Remember to use the poolhelper.sh instead of the helper.sh.
|
||||
|
||||
### VS Code Setup
|
||||
|
||||
This is my personally preferred IDE setup for C/C++ and by no means needed to accomplish this exercise.
|
||||
|
||||
1.) Install VS Code on your Distribution or get it from Microsoft.
|
||||
|
||||
<https://code.visualstudio.com/>
|
||||
|
||||
2.) I recommend you install the following extensions in vs code
|
||||
|
||||
clangd,
|
||||
Clang-Format,
|
||||
CodeLLDB,
|
||||
C++ TestMate,
|
||||
Docker and
|
||||
Remote Development
|
||||
|
||||
For a general C/C++ setup of VS Code (I consider good) see:
|
||||
<https://ahemery.dev/2020/08/24/c-cpp-vscode/>
|
||||
|
||||
Most parts can be skipped, as they are already integrated in this Repo.
|
||||
|
||||
3.) You can auto build by hitting Strg+Shift+B from the IDE.
|
||||
|
||||
4.) Pressing F5 will start a debug session, make sure to set halting points.
|
||||
|
||||
### Setting up Docker
|
||||
|
||||
1.) install docker and VS Code on your Distribution.
|
||||
|
||||
<https://docs.docker.com/get-docker/>
|
||||
|
||||
<https://code.visualstudio.com/>
|
||||
|
||||
For this setup you cannot use the OSS version of VS code or the version from Snap, as the remote development extensions will not work.
|
||||
|
||||
2.) I recommend you install the following extensions in vs code
|
||||
|
||||
clangd,
|
||||
Clang-Format,
|
||||
CodeLLDB,
|
||||
Docker and
|
||||
Remote Development
|
||||
|
||||
For a general C/C++ setup of VS Code (I consider good) see:
|
||||
<https://ahemery.dev/2020/08/24/c-cpp-vscode/>
|
||||
|
||||
Most of the setup can be skipped
|
||||
|
||||
3.) Use the helper script to build and run a Container
|
||||
|
||||
```bash
|
||||
./helper.sh docker
|
||||
```
|
||||
|
||||
This will build a docker image and run a Docker container with the current directory mounted.
|
||||
|
||||
The Docker container can later be started from the Docker VS Code extension.
|
||||
|
||||
4.) Attach VS Code to the container, in the Docker Tab, and start developing
|
||||
|
||||
## Debugging
|
||||
|
||||
|
@ -158,18 +160,11 @@ The best way to see what your function does is to use the [UnitTest.cpp](https:/
|
|||
With "C++ TestMate" install you can simply run or debug the test from the side panel in VS Code (Flask Icon).
|
||||
The "C++ TestMate" is not installed in the VM as I just added this feature now.
|
||||
Please feel free to add more test cases to your liking in [UnitTest.cpp](https://git.cs.tu-dortmund.de/nils.hoelscher/RTSA-lab01-CacheAnalysis/src/branch/master/UnitTest/UnitTest.cpp).
|
||||
|
||||
|
||||
## Configuring and building
|
||||
|
||||
The easiest way is to use the VS Code tasks in this project.
|
||||
By using CTR+Shift+B you can config and then build the project.
|
||||
|
||||
### Use the helper script
|
||||
## Use the Helper script
|
||||
|
||||
Again if you work on a Pool PC use poolhelper.sh insted of the helper.sh script.
|
||||
|
||||
### Initial setup
|
||||
### Initial Setup
|
||||
|
||||
```bash
|
||||
./helper.sh all
|
||||
|
|
|
@ -11,7 +11,7 @@ config () {
|
|||
mkdir build
|
||||
cd build
|
||||
echo "==== Configuring cmake ===="
|
||||
cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DLT_LLVM_INSTALL_DIR=$LLVM_DIR ..
|
||||
cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DLT_LLVM_INSTALL_DIR=/usr ..
|
||||
cd ..
|
||||
cp build/compile_commands.json compile_commands.json
|
||||
echo "==== Done! ===="
|
||||
|
|
Loading…
Reference in New Issue