Code Monkey home page Code Monkey logo

vector_quantization's Introduction

Quantization - team project

Maintenance GitHub contributors Build status Coverage Status Lines of Code

Structure

.
├── CMakeLists.txt
├── app
│   └── main.cpp
├── include
│   ├── example.h
│   └── exampleConfig.h.in
├── src
│   └── example.cpp
└── tests
    ├── dummy.cpp
    └── main.cpp

Sources go in src/, header files in include/, main programs in app/, and tests go in tests/ (compiled to unit_tests by default).

If you add a new executable, say app/hello.cpp, you only need to add the following two lines to CMakeLists.txt:

add_executable(main app/main.cpp)   # Name of exec. and location of file.
target_link_libraries(main PRIVATE ${LIBRARY_NAME})  # Link the executable to lib built from src/*.cpp (if it uses it).

You can find the example source code that builds the main executable in app/main.cpp under the Build section in CMakeLists.txt. If the executable you made does not use the library in src/, then only the first line is needed.

Development

Clone this repo with:

> git clone --recurse-submodules https://github.com/karlosos/vector_quantization

or fetch submodules manually.

Building on Linux

Build by making a build directory (i.e. build/), run cmake in that dir, and then use make to build the desired target.

Example:

> mkdir build && cd build
> cmake .. -DCMAKE_BUILD_TYPE=[Debug | Coverage | Release]
> make
> ./main
> make test      # Makes and runs the tests.
> make coverage  # Generate a coverage report.
> make doc       # Generate html documentation.

Building on Windows

WSL solution with VSCode

I suggest using WSL https://docs.microsoft.com/en-us/windows/wsl/install-win10.

  1. Open project folder in cmd.exe or terminal of your choice.
  2. Launch wsl with bash.
  3. Update repositories sudo apt-get update.
  4. Install CMake with sudo apt-get install cmake.
  5. Install development tools with sudo apt-get install build-essential

Then within the same terminal (on wsl) build project:

> mkdir build && cd build
> cmake ..
> make
> ./main

It's working. Great success! You can now work with code however you want. Below its described way of configuring VSCode.

Now open VSCode and install following extensions:

Close VSCode and launch it from wsl terminal in root folder of our project

cd .. # you should be in vector_quantization folder
code .

You will be asked by CMake Tools extension to configure project. Select compiler and you're good to go.

Debug application with F5 or run without debugging with CTRL+F5.

If you have error could not find a.out then go to Run->Open Configuration and check executable path to "program": "${workspaceFolder}/build/main".

Building on real Windows

Install CMAKE and then:

  1. In root folder run cmake -S . -Bbuild -DCMAKE_BUILD_TYPE=Debug
  2. Then build with: cmake -build build.
  3. Go to build dir with dir build.
  4. Run program with .\Debug\main.exe.
  5. Run tests with ctest -C Debug.

Building on MacOS

  1. Install CMake
  2. Build project
> mkdir build && cd build
> cmake ..
> make
> ./main
  1. Install C++ and CMake Tools extension in VSCode and close it.
  2. Open VSCode from root folder vector_quantization. CMake Tools should ask you to chose compiler.
  3. Debug application with F5 or run with CTRL+F5.

Naming and other style guidelines

Refer to google cppguide.

Pair programming

Install Live Share extension for VSCode..

References:

vector_quantization's People

Contributors

karlosos avatar

Stargazers

Paweł Kalicki avatar

Watchers

James Cloos avatar  avatar Paweł Kalicki avatar  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.