VSCode + SSH to <em>aisa</em> might be the best option for you.</p><divclass="theme-admonition theme-admonition-caution alert alert--warning admonition_LlT9"><divclass="admonitionHeading_tbUL"><spanclass="admonitionIcon_kALy"><svgviewBox="0 0 16 16"><pathfill-rule="evenodd"d="M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"></path></svg></span>VSCode @ aisa</div><divclass="admonitionContent_S0QG"><p>Be careful when using VSCode on aisa, most notably:</p><ol><li>VSCode can leave lingering processes running in the background that can „eat
up“ your quota for running processes.
AFAIK UNIX team has implemented some periodic clean up of those.</li><li>Disk quota can be also affected, because of the C/C++ extension toolkit that
has a cache for IntelliSense.</li></ol></div></div><p>Either of those will be linux distros, so jump to <ahref="#linux">next section</a>.</p><h3class="anchor anchorWithStickyNavbar_LWe7"id="linux">Linux<ahref="#linux"class="hash-link"aria-label="Direct link to Linux"title="Direct link to Linux"></a></h3><p>Majority (if not all) of the provided materials include makefile (contains absolute
path, so in case of linting and compiling, you need to adjust to your needs). You
basically need following list of tools:</p><ul><li><code>gcc</code> - for compiling</li><li><code>clang-tidy</code> - for linting (depends on distribution, might be provided with
clang itself or in separate package, e.g. <code>clang-tools-extra</code>)</li><li><code>clang-format</code> - for your own sanity of keeping consistent formatting</li><li><code>make</code> - since you are provided makefiles and it might be quickest to set up</li><li><code>valgrind</code> - in case you manage to create memory errors in your code</li></ul><p>In case of Fedora it is following set of packages:</p><divclass="language-sh codeBlockContainer_Ckt0 theme-code-block"style="--prism-color:#000000;--prism-background-color:#ffffff"><divclass="codeBlockContent_biex"><pretabindex="0"class="prism-code language-sh codeBlock_bY9V thin-scrollbar"><codeclass="codeBlockLines_e6Vv"><spanclass="token-line"style="color:#000000"><spanclass="token function"style="color:rgb(0, 0, 255)">sudo</span><spanclass="token plain"> dnf </span><spanclass="token function"style="color:rgb(0, 0, 255)">install</span><spanclass="token plain"></span><spanclass="token parameter variable"style="color:rgb(9, 134, 88)">-y</span><spanclass="token plain"> clang clang-tools-extra valgrind gcc </span><spanclass="token function"style="color:rgb(0, 0, 255)">make</span><spanclass="token plain"></span><br></span><spanclass="token-line"style="color:#000000"><spanclass="token plain"></span><spanclass="token comment"style="color:rgb(0, 128, 0)"># If you decide to use google test: add `gtest` or `llvm-googletest` for clang</span><br></span></code></pre><divclass="buttonGroup__atx"><buttontype="button"aria-label="Copy code to clipboard"title="Copy"class="clean-btn"><spanclass="copyButtonIcons_eSgA"aria-hidden="true"><svgviewBox="0 0 24 24"class="copyButtonIcon_y97N"><pathfill="currentColor"d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svgviewBox="0 0 24 24"class="copyButtonSuccessIcon_LjdS"><pathfill="currentColor"d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><h3class="anchor anchorWithStickyNavbar_LWe7"id="macos">macOS<ahref="#macos"class="hash-link"aria-label="Direct link to macOS"title="Direct link to macOS"></a></h3><p>In case of macOS you should be able to find all of the packages in brew.sh, except
<code>valgrind</code>, not sure if you can solve with podman/docker.</p><p>There is also an alterantive to homebrew, that is nixpkgs.</p><h3class="anchor anchorWithStickyNavbar_LWe7"id="nixos">nix(OS)<ahref="#nixos"class="hash-link"aria-label="Direct link to nix(OS)"title="Direct link to nix(OS)"></a></h3><p>In case you run nixOS or linux distribution with nixpkgs or you use nixpkgs as a
replacement for homebrew on macOS. You should be fine with the following config:</p><divclass="language-nix codeBlockContainer_Ckt0 theme-code-block"style="--prism-color:#000000;--prism-background-color:#ffffff"><divclass="codeBlockContent_biex"><pretabindex="0"class="prism-code language-nix codeBlock_bY9V thin-scrollbar"><codeclass="codeBlockLines_e6Vv"><spanclass="token-line"style="color:#000000"><spanclass="token keyword"style="color:rgb(0, 0, 255)">with</span><spanclass="token plain"></span><spanclass="token function"style="color:rgb(0, 0, 255)">import</span><spanclass="token plain"></span><spanclass="token operator"style="color:rgb(0, 0, 0)"><</span><spanclass="token plain">nixpkgs</span><spanclass="token operator"style="color:rgb(0, 0, 0)">></span><spanclass="token plain"></span><spanclass="token punctuation"style="color:rgb(4, 81, 165)">{</span><spanclass="token punctuation"style="color:rgb(4, 81, 165)">}</span><spanclass="token punctuation"style="color:rgb(4, 81, 165)">;</span><spanclass="token plain"></span><br></span><spanclass="token-line"style="color:#000000"><spanclass="token plain">stdenv</span><spanclass="token punctuation"style="color:rgb(4, 81, 165)">.</span><spanclass="token plain">mkDerivation </span><spanclass="token punctuation"style="color:rgb(4, 81, 165)">{</span><spanclass="token plain"></span><br></span><spanclass="token-line"style="color:#000000"><spanclass="token plain"> name </span><spanclass="token operator"style="color:rgb(0, 0, 0)">=</span><spanclass="token plain"></span><spanclass="token string"style="color:rgb(163, 21, 21)">"cppenv"</span><spanclass="token punctuation"style="color:rgb(4, 81, 165)">;</span><spanclass="token plain"></span><br></span><spanclass="token-line"style="color:#000000"><spanclass="token plain"> buildInputs </span><spanclass="token operator"style="color:rgb(0, 0, 0)">=</span><spanclass="token plain"></span><spanclass="token punctuation"style="color:rgb(4, 81, 165)">[</span><spanclass="token plain"></span><br></span><spanclass="token-line"style="color:#000000"><spanclass="token plain"> clang</span><spanclass="token operator"style="color:rgb(0, 0, 0)">-</span><spanclass="token plain">tools</span><br></span><spanclass="token-line"style="color:#000000"><spanclass="token plain"style="display:inline-block"></span><br></span><spanclass="token-line"style="color:#000000"><spanclass="token plain"> gnumake</span><br></span><spanclass="token-line"style="color:#000000"><spanclass="token plain"style="display:inline-block"></span><br></span><spanclass="token-line"style="color:#000000"><spanclass="token plain"> gmock </span><spanclass="token comment"style="color:rgb(0, 128, 0)"># used for google test</span><spanclass="token plain"></span><br></span><spanclass="token-line"style="color:#000000"><spanclass="token plain"> valgrind </span><spanclass="token comment"style="color:rgb(0, 128, 0)"># not sure about macOS though</span><spanclass="token plain"></span><br></span><spanclass="token-line"style="color:#000000"><spanclass="token plain"></span><spanclass="token punctuation"style="color:rgb(4, 81, 165)">]</span><spanclass="token punctuation"style="color:rgb(4, 81, 165)">;</span><spanclass="token plain"></span><br></span><spanclass="token-line"style="color:#000000"><spanclass="token plain"></span><spanclass="token punctuation"style="color:rgb(4, 81, 165)">}</span><br></span></code></pre><divclass="buttonGroup__atx"><buttontype="button"aria-label="Copy code to clipboard"title="Copy"class="clean-btn"><spanclass="copyButtonIcons_eSgA"aria-hidden="true"><svgviewBox="0 0 24 24"class="copyButtonIcon_y97N"><pathfill="currentColor"d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svgviewBox="0 0 24 24"class="copyButtonSuccessIcon_LjdS"><pathfill="currentColor"d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div
to the JetBrains IDEs.</p><h2class="anchor anchorWithStickyNavbar_LWe7"id="git">git<ahref="#git"class="hash-link"aria-label="Direct link to git"title="Direct link to git"></a></h2><p>I recommend you using some basic versioning for your code, even though you submit
only the sources on <em>aisa</em>. There are specific reasons why I suggest it:</p><ul><li>if you build a <em>commit, tag and submit</em> habit, you might be able to address
some of the smaller problems in your sources even before submission; more info
in the <ahref="#pre-commit">pre-commit section</a></li></ul><p>In case you are planning to use git branches for separating different
assignments and/or merge requests I suggest you to keep specifications and
skeletons on your default branch, since <em>frag</em> on <em>aisa</em> automatically downloads
everything that is not present and by that can create conflicts when switching
correctness of your implementation and also identify bugs, since they are better
contained.</p></div></div><p>Since frag creates a lot of support files (majority of them are dotfiles, i.e.
hidden files), I recommend you to use following
<ahref="/files/pb161/environment/gitignore"target="_blank"rel="noopener noreferrer">gitignore</a> configuration that
should cover most of the scenarios.</p><h3class="anchor anchorWithStickyNavbar_LWe7"id="pre-commit-link">pre-commit (<ahref="https://pre-commit.com/"target="_blank"rel="noopener noreferrer">link</a>)<ahref="#pre-commit-link"class="hash-link"aria-label="Direct link to pre-commit-link"title="Direct link to pre-commit-link"></a></h3><p>Pre-commit basically allows you to "check" your code before committing. It functions
as a git hook, i.e. you want to make a commit, pre-commit checks it before-hand.</p><p>In case of C++ there are few use-cases:</p><ul><li><p>formatting</p></li><li><p>linting</p></li><li><p>building and/or running tests, in case you feel like masochist</p><p>However this might be a challenging task to implement, since most of the tasks
are published from the beginning.</p></li></ul><p>In case of formatting and linting, there are already existing hooks (there is a
list of supported ones on the page), but there is also an option for you setting
it up yourself (it is just a matter of specifying command and files it should run
on).</p><divclass="theme-admonition theme-admonition-tip alert alert--success admonition_LlT9"><divclass="admonitionHeading_tbUL"><spanclass="admonitionIcon_kALy"><svgviewBox="0 0 12 16"><pathfill-rule="evenodd"d="M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"></path></svg></span>Formatting</div><divclass="admonitionContent_S0QG"><p>For formatting you can the following <ahref="https://github.com/pre-commit/mirrors-clang-format#using-clang-format-with-pre-commit"target="_blank"rel="noopener noreferrer">git hook</a>.</p><p>This hook follows the formatting conventions defined by the <code>.clang-format</code> file
that is looked up recursively all the way to the root of the filesystem, therefore
it is ideal to keep it in the root of the git repository.</p><p>You can look up the different codestyles <ahref="https://gitlab.fi.muni.cz/pb071/codestyles"target="_blank"rel="noopener noreferrer">here</a>.</p></div></div><h2class="anchor anchorWithStickyNavbar_LWe7"id="testing">Testing<ahref="#testing"class="hash-link"aria-label="Direct link to Testing"title="Direct link to Testing"></a></h2><p>I have tried 2 frameworks for testing, one of them will be probably showcased in
lectures. If you have not picked one yet, you can take an inspiration from the
following.</p><h3class="anchor anchorWithStickyNavbar_LWe7"id="catch2">catch2<ahref="#catch2"class="hash-link"aria-label="Direct link to catch2"title="Direct link to catch2"></a></h3><p>It is quite popular, only one header-file, also might be easier to set up.</p><p>Might feel slow to compile, this can be addressed by having one object file with
precompiled <code>main</code> for tests, e.g.</p><divclass="language-cpp codeBlockContainer_Ckt0 theme-code-block"style="--prism-color:#000000;--prism-background-color:#ffffff"><divclass="codeBlockContent_biex"><pretabindex="0"class="prism-code language-cpp codeBlock_bY9V thin-scrollbar"><codeclass="codeBlockLines_e6Vv"><spanclass="token-line"style="color:#000000"><spanclass="token comment"style="color:rgb(0, 128, 0)">/* File: catch_main.cpp</span><br></span><spanclass="token-line"style="color:#000000"><spanclass="token comment"style="color:rgb(0, 128, 0)"> * Compile it with: g++ $(CXXFLAGS) -c catch_main.cpp</span><br></span><spanclass="token-line"style="color:#000000"><spanclass="token comment"style="color:rgb(0, 128, 0)"> *</span><br></span><spanclass="token-line"style="color:#000000"><spanclass="token comment"style="color:rgb(0, 128, 0)"> * Once you have source file with tests, e.g. test_something.cpp, compile it in</span><br></span><spanclass="token-line"style="color:#000000"><spanclass="token comment"style="color:rgb(0, 128, 0)"> * a similar fashion: g++ $(CXXFLAGS) -c test_something.cpp $(LDLIBS)</span><br></span><spanclass="token-line"style="color:#000000"><spanclass="token comment"style="color:rgb(0, 128, 0)"> *</span><br></span><spanclass="token-line"style="color:#000000"><spanclass="token comment"style="color:rgb(0, 128, 0)"> * And link them together:</span><br></span><spanclass="token-line"style="color:#000000"><spanclass="token comment"style="color:rgb(0, 128, 0)"> * g++ catch_main.o test_something.o -o test_something</span><br></span><spanclass="token-line"style="color:#000000"><spanclass="token comment"style="color:rgb(0, 128, 0)"> *</span><br></span><spanclass="token-line"style="color:#000000"><spanclass="token comment"style="color:rgb(0, 128, 0)"> * Now you can run ./test_something and if you change it, you do not need to compile</span><br></span><spanclass="token-line"style="color:#000000"><spanclass="token comment"style="color:rgb(0, 128, 0)"> * the main again.</span><br></span><spanclass="token-line"style="color:#000000"><spanclass="token comment"style="color:rgb(0, 128, 0)"> */</span><spanclass="token plain"></span><br></span><spanclass="token-line"style="color:#000000"><spanclass="token plain"></span><spanclass="token macro property directive-hash">#</span><spanclass="token macro property directive keyword"style="color:rgb(0, 0, 255)">define</span><spanclass="token macro property"></span><spanclass="token macro property macro-name">CATCH_CONFIG_MAIN</span><spanclass="token plain"></span><br></span><spanclass="token-line"style="color:#000000"><spanclass="token plain"></span><spanclass="token macro property directive-hash">#</span><spanclass="token macro property directive keyword"style="color:rgb(0, 0, 255)">include</span><spanclass="token macro property"></span><spanclass="token macro property string"style="color:rgb(163, 21, 21)">"catch.hpp"</span><br></span></code></pre><divclass="buttonGroup__atx"><buttontype="button"aria-label="Copy code to clipboard"title="Copy"class="clean-btn"><spanclass="copyButtonIcons_eSgA"aria-hidden="true"><svgviewBox="0 0 24 24"class="copyButtonIcon_y97N"><pathfill="currentColor"d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svgviewBox="0 0 24 24"class="copyButtonSuccessIcon_LjdS"><pathfill="currentColor"d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><h3class="anchor anchorWithStickyNavbar_LWe7"id="google-test">Google Test<ahref="#google-test"class="hash-link"aria-label="Direct link to Google Test"title="Direct link to Google Test"></a></h3><p>It is faster compared to catch2, even if you do not precompile the <code>main</code>. Might
be more complicated to set up, since there are multiple files (it is not one header
file). Not very user friendly on <em>aisa</em>. However can be installed through package