GithubHelp home page GithubHelp logo

cpp-template's Introduction

CPP template

This is a minimal implementation of a modern C++ project.

The repository gives examples for the following:

  1. CMake
  2. Using submodules (Catch2, args, json)
  3. Finding library (HDF5 but not required to compile)
  4. Enabling OpenMP (but not required)
  5. Git versioning (i.e. automatic versioning by git hash)
  6. Creating a library
  7. Creating an executable
  8. C++ templates, concepts (C++-20 feature)
  9. Creating unit tests
  10. Error handling

with my taste on software engineering (e.g. naming convention and file structure).

This can be used as a template for your next C++ project, so that you don't need to copy the same snippets again. Make sure to change the name to your own project - you will be replacing TEMPLATE / Template / template names except the actual template keyword for C++ in src/util/vectorization.h.

You can also checkout to other branches to see C++ template with modules. For example, you can checkout to mpi to have an MPI-C++ template.

To compile, you will be doing:

  1. clone the repository with all the submodules
git clone --recursive https://github.com:Walter-Feng/cpp-template.git
  1. make a build directory
cd cpp-template
mkdir build
cd build
  1. run cmake
cmake ..
  1. make
make -j
  1. run the executable
./template
  1. run the unit test
test/test_template

cpp-template's People

Contributors

walter-feng avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.