blog/assets/js/b9f7f5c4.cd2080fd.js

1 line
11 KiB
JavaScript
Raw Normal View History

"use strict";(self.webpackChunkfi=self.webpackChunkfi||[]).push([[9179],{6699:(e,n,i)=>{i.r(n),i.d(n,{assets:()=>a,contentTitle:()=>r,default:()=>h,frontMatter:()=>s,metadata:()=>l,toc:()=>c});var o=i(5893),t=i(1151);const s={title:"Environment",description:"Suggestions for setting up a local environment for C++ course.\n",last_update:{date:new Date("2023-02-18T00:00:00.000Z")}},r=void 0,l={id:"environment",title:"Environment",description:"Suggestions for setting up a local environment for C++ course.\n",source:"@site/cpp/environment.md",sourceDirName:".",slug:"/environment",permalink:"/cpp/environment",draft:!1,unlisted:!1,editUrl:"https://github.com/mfocko/blog/tree/main/cpp/environment.md",tags:[],version:"current",lastUpdatedAt:1676678400,formattedLastUpdatedAt:"Feb 18, 2023",frontMatter:{title:"Environment",description:"Suggestions for setting up a local environment for C++ course.\n",last_update:{date:"2023-02-18T00:00:00.000Z"}},sidebar:"autogeneratedBar",previous:{title:"Introduction",permalink:"/cpp/"}},a={},c=[{value:"Required tools per OS",id:"required-tools-per-os",level:2},{value:"Windows",id:"windows",level:3},{value:"Linux",id:"linux",level:3},{value:"macOS",id:"macos",level:3},{value:"nix(OS)",id:"nixos",level:3},{value:"IDEs",id:"ides",level:2},{value:"git",id:"git",level:2},{value:"pre-commit (link)",id:"pre-commit-link",level:3},{value:"Testing",id:"testing",level:2},{value:"catch2",id:"catch2",level:3},{value:"Google Test",id:"google-test",level:3}];function d(e){const n={a:"a",admonition:"admonition",code:"code",em:"em",h2:"h2",h3:"h3",li:"li",ol:"ol",p:"p",pre:"pre",ul:"ul",...(0,t.a)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.h2,{id:"required-tools-per-os",children:"Required tools per OS"}),"\n",(0,o.jsx)(n.h3,{id:"windows",children:"Windows"}),"\n",(0,o.jsxs)(n.p,{children:["Most likely WSL, VM or VPS. If you consider setting up either of those PITA, then\nVSCode + SSH to ",(0,o.jsx)(n.em,{children:"aisa"})," might be the best option for you."]}),"\n",(0,o.jsxs)(n.admonition,{title:"VSCode @ aisa",type:"caution",children:[(0,o.jsx)(n.p,{children:"Be careful when using VSCode on aisa, most notably:"}),(0,o.jsxs)(n.ol,{children:["\n",(0,o.jsx)(n.li,{children:"VSCode can leave lingering processes running in the background that can \u201eeat\nup\u201c your quota for running processes.\nAFAIK UNIX team has implemented some periodic clean up of those."}),"\n",(0,o.jsx)(n.li,{children:"Disk quota can be also affected, because of the C/C++ extension toolkit that\nhas a cache for IntelliSense."}),"\n"]})]}),"\n",(0,o.jsxs)(n.p,{children:["Either of those will be linux distros, so jump to ",(0,o.jsx)(n.a,{href:"#linux",children:"next section"}),"."]}),"\n",(0,o.jsx)(n.h3,{id:"linux",children:"Linux"}),"\n",(0,o.jsx)(n.p,{children:"Majority (if not all) of the provided materials include makefile (contains absolute\npath, so in case of linting and compiling, you need to adjust to your needs). You\nbasically need following list of tools:"}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsxs)(n.li,{children:[(0,o.jsx)(n.code,{children:"gcc"})," - for compiling"]}),"\n",(0,o.jsxs)(n.li,{children:[(0,o.jsx)(n.code,{children:"clang-tidy"})," - for linting (depends on distribution, might be provided with\nclang itself or in separate package, e.g. ",(0,o.jsx)(n.code,{children:"clang-tools-extra"}),")"]}),"\n",(0,o.jsxs)(n.li,{children:[(0,o.jsx)(n.code,{children:"clang-format"})," - for your own sanity of keeping consistent formatting"]}),"\n",(0,o.jsxs)(n.li,{children:[(0,o.jsx)(n.code,{children:"make"})," - since you are provided makefiles and it might be quickest to set up"]}),"\n",(0,o.jsxs)(n.li,{children:[(0,o.jsx)(n.code,{children:"valgrind"})," - in case you manage to create memory errors in your code"]}),"\n"]}),"\n",(0,o.jsx)(n.p,{children:"In case of Fedora it is following set of packages:"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-sh",children:"sudo dnf install -y clang clang-tools-extra valgrind gcc make\n# If you decide to use google test: add `gtest