Git Product home page Git Product logo

cpp_boilerplate's Introduction

C++ Tutorial

Setting up VSCode

Unix

  1. Install GCC, gdb, and cmake
sudo apt-get update
sudo apt-get install build-essential gdb cmake
  1. Check gcc and cmake versions.
jpt@100834-pc:~/git/cpp_trial$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:hsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
...
gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.1)

jpt@100834-pc:~/git/cpp_trial/build$ cmake --version
cmake version 3.16.3

OSX

  1. Install homebrew
  2. brew install cmake gdb

Usage

This uses cmake to create a make file. See the CMakeLists.txt for instructions on how the make file is generated.

  1. git clone XXXX
  2. cd cpp_boilerplate
  3. Download Eigen 3.4.0
  4. Untar and get only the Eigen folder inside eigen-3.4.0 and that put in external_include folder.
  5. cd .. && mkdir build
  6. cd build
  7. cmake ..
  8. make
  9. run ./my_program ../data/load.csv

Debugging

I have included a launch.json and tasks.json in the .vscode folder. Launch sets up the program to run and tasks include the pre launch tasks it must execute. This includes running cmake with the debug flag.

References

  1. Setup C/C++ for Visual Studio Code
  2. Eigen C++ Template Library
  3. Setting up gdb with make file in VS Code

cpp_boilerplate's People

Contributors

jptalusan 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.