8000 GitHub - jamielapointe/cpp_practice: Practice C++ 20
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

jamielapointe/cpp_practice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cpp_practice

CI Actions Status CodeQL Actions Status Code Coverage Codacy Badge

Table of Contents

About cpp_practice

Practice C++ 20

Technologies Used

  • List all
  • the major technologies
  • you used in your project
  • here

Current list:

Dependencies

Note about install commands:

  • In case of an error in cmake, make sure that the dependencies are on the PATH.
  • Currently the instructions are only for Debian/Ubuntu Linux; We hope to add additional operating systems in the future.

Docker

We have a Docker image that's already set up for you. See the

Docker instructions.

Necessary Dependencies

  1. A C++ compiler that supports nearly all of C++17 and most of C++20.

    • See C++ Reference to see which features are supported by each compiler. The following compilers should work:

    • gcc 12+ Install command

      • Debian/Ubuntu:

        sudo apt-get install build-essential gcovr gcc-12 g++-12 gcc-12-doc
    • clang 16+ Install command

      • Debian/Ubuntu:

        wget https://apt.llvm.org/llvm.sh
        chmod +x llvm.sh
        sudo ./llvm.sh 16 all
  2. CMake 3.25+ Install Command

    • Debian/Ubuntu:

      sudo apt-get install cmake

Optional Dependencies

C++ Tools
  • ninja Install Command

    • A small build system with a focus on speed
    sudo apt-get install ninja-build
  • Doxygen 1.9.7

    • Generate API documentation from source code

    • Debian/Ubuntu:

      sudo apt-get install graphviz texlive-latex-extra ghostscript
      wget https://www.doxygen.nl/files/doxygen-1.9.7.linux.bin.tar.gz \
        mkdir -p "${HOME}/.local" \
        tar -xC "${HOME}/.local" -f doxygen-1.9.7.linux.bin.tar.gz \
        rm doxygen-1.9.7.linux.bin.tar.gz \
        echo "export PATH=\"${HOME}/.local/doxygen-1.9.7/bin:${PATH}\"" >> "${HOME}/.bashrc" \
        export PATH="${HOME}/.local/doxygen-1.9.7/bin:${PATH}" \
  • ccache

    • Compiler cache

    • Debian/Ubuntu:

      sudo apt-get install ccache
  • cppcheck

    • C/C++ static analysis tool

    • Debian/Ubuntu:

      sudo apt-get install cppcheck
    • Windows: Download latest version and install: cppcheck

  • libpfm-4

    • a helper library to program the performance monitoring event
    sudo apt-get install libpfm4
  • include-what-you-use

Setup/Installation Requirements

  • This is a great place

  • to list setup instructions

  • in a simple

  • easy-to-understand

  • format

  • This is a great place

  • to list setup instructions

  • in a simple

  • easy-to-understand

  • format

Specify the compiler using environment variables

By default (if you don't set environment variables CC and CXX), the system default compiler will be used. For Debian/Ubuntu this is usually the default version of GCC.

CMake uses the environment variables CC and CXX to decide which compiler to use. So to avoid the conflict issues only specify the compilers using these variables.

Commands for setting the compilers

  • Debian/Ubuntu Set your desired compiler (clang, gcc, etc):

    • Temporarily (only for the current shell)

    • Run one of the following in the terminal:

      • clang
      CC=clang CXX=clang++
      • gcc (usually the default; however, if not, then...)
      CC=gcc CXX=g++
    • Permanent:

    • Open ~/.bashrc using your text editor:

      gedit ~/.bashrc
    • Add CC and CXX to point to the compilers:

      export CC=clang
      export CXX=clang++
    • Save and close the file

Configure your build

To configure the project, you could use cmake, or ccmake or cmake-gui. It is assumed the user knows how to build software.

Running the tests

You can use the ctest command run the tests.

cd ./build
ctest -C Debug
cd ../
  • Provide any additional details
  • concerning testing your project
  • or other special build options
  • such as building documentation,
  • etc.

Docker Instructions

If you have Docker installed, you can run this in your terminal, when the Dockerfile is inside the .devcontainer directory:

docker build -f ./.devcontainer/Dockerfile --tag=my_project:latest .
docker run -it my_project:latest
  • Provide additional instructions
  • for building the docker project
  • and definitely modify the dockerfile
  • for your specific project

Known Bugs

  • Any known issues
  • should go here

Contribute

  • If your project allows third
  • party contributors, then list
  • the rules and instructions here
  • with a links to
    • CONTRIBUTING.md which contains rules & instructors for contributors
    • CONTRIBUTORS.md which is an autogenerated list of contributors from a tool like all-contributor

License

  • List which license you are utilizing
  • for your project
  • provide a link to the LICENSE.md
  • file for your project

About

Practice C++ 20

Resources

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  
0