Coder Social home page Coder Social logo

cosec-examples's Introduction

Examples for COSEC students

It is assumed you have made yourself familiar with ntc-cmake, what it automates and how, please start there (see dependencies below for the link).

  • Serialization:
    • schema-serial: usage of Flatbuffers as a serialization library with external schema specification and code generator.
    • interprocess-copy: benchmark of various interprocess data copy implementations.
  • Asynchrony:
    • thread-pool: simple thread pool and executor usage.
    • asio-basic: basic asynchronous tcp server with logging and error handling.
    • asio-advanced: multi-threaded tcp server with continuations that has operation limits.
    • asio-stackfull-coro: tcp server that uses stackfull coroutines based on Boost.Context.
    • asio-shared: server with shared state which uses strands for synchronization.
    • atomic: a small example on atomic usage.
    • select: server that implements basic asynchronous primitives using select reactor.
    • generator: synchronous generator based on C++20 coroutines.
  • Assembler:
    • asm-basic: basic usage of inline assembly and assembler modules.
    • anf: usage of SSE intrinsic functions.
  • Qt:
    • layouts-painting: basic use signals/slots, Qt Designer, layouts and mouse/paint events for custom-looking widgets.
    • item-models: usage of Qt Item Models and Views/Widgets.
    • block-scene: usage of QGraphicsScene, items and views.
    • gui-progress: offloading lengthy tasks to a non-gui QThread and communicating with it using queued signals/slots.
    • locale-resources: usage of resources and translations in Qt.
    • geohash: qtpositioning + simple use of QNetworkAccessManager from qtnetwork.
    • delegates-sql: use of queries and item models with qtsql and custom item delegates.
    • treeview: tree view item model example.
  • Miscellaneous:
    • et: use of expression templates to optimize evaluation of expressions.

Dependencies:

  • C++ compiler and standard library with sufficient support for C++20.
  • >=ntc-cmake-1.1.0 - see https://github.com/palebedev/ntc-cmake
  • >=Boost-1.74.0
  • >=Qt-5.15 (LinguistTools,Network,Positioning,Sql,Svg,WebEngineWidgets modules and their dependencies)
  • >=google-benchmark-1.5.0
  • >=FlatBuffers-1.12.0

cosec-examples's People

Contributors

palebedev avatar

Stargazers

 avatar  avatar

Watchers

 avatar

cosec-examples's Issues

Build broken in schema-serial

Auto-generated flatbuffers headers cannot be found from main.cpp. Tried the following ways to fix (and no result):

  • Specify PRE_BUILD option in add_custom_command (this should not have any impact but why not)
  • Call ninja command with -j1 option (thought that parallel build might be the reason)
  • Use add_custom_target instead of add_custom_command and then call add_dependencies (I know that add_custom_command is preferable because it is called only when needed, just tried to investigate)
  • Include this header with "" instead of <>
  • Move ntc_target(schema-serial) before flat_buffers_autogen(schema-serial) (thought that ntc_target call might overwrite some needed options)

The most interesting thing is that this header IS actually generated and placed inside include subdirectory in the build directory.

One more thing: I managed to build the project successfully several times, but I can't describe how to reproduce it. It was just like "changed something in the corresponding CMakeLists.txt, and it built successfully". However, after deleting the build directory the "clear" build fails.

Can it be a bug in CMake? Can't find a way to make the code work correctly (and it actually should work correctly, but does not). I use: CMake 3.19.2, ninja 1.10.2, gcc 10.2.0.

[33/89] Building CXX object schema-serial/CMakeFiles/schema-serial.dir/src/main.cpp.o
FAILED: schema-serial/CMakeFiles/schema-serial.dir/src/main.cpp.o
/usr/sbin/c++ -DBOOST_ALL_DYN_LINK -DBOOST_ALL_NO_LIB -DBOOST_ASIO_NO_DEPRECATED -DBOOST_ASIO_NO_TS_EXECUTORS -DBOOST_ATOMIC_DYN_LINK -DBOOST_CHRONO_DYN_LINK -DBOOST_FILESYSTEM_DYN_LINK -DBOOST_LOG_DYN_LINK -DBOOST_REGEX_DYN_LINK -DBOOST_SYSTEM_DYN_LINK -DBOOST_THREAD_DYN_LINK -I../utils/include -isystem utils/include -g -pedantic-errors -fno-math-errno -fno-signed-zeros -fno-trapping-math -Wall -Wextra -Wcast-align -Wconversion -Wctor-dtor-privacy -Wdeprecated -Wdouble-promotion -Wduplicated-branches -Wduplicated-cond -Wextra-semi -Wimplicit-fallthrough -Wlogical-op -Wmissing-declarations -Wno-assume -Wno-missing-field-initializers -Wnull-dereference -Wold-style-cast -Wpragmas -Wredundant-decls -Wundef -Wzero-as-null-pointer-constant -ftemplate-backtrace-limit=0 -fdiagnostics-show-template-tree -gsplit-dwarf -std=c++2a -MD -MT schema-serial/CMakeFiles/schema-serial.dir/src/main.cpp.o -MF schema-serial/CMakeFiles/schema-serial.dir/src/main.cpp.o.d -o schema-serial/CMakeFiles/schema-serial.dir/src/main.cpp.o -c ../schema-serial/src/main.cpp
../schema-serial/src/main.cpp:1:10: fatal error: widget_generated.h: No such file or directory
    1 | #include <widget_generated.h>
      |          ^~~~~~~~~~~~~~~~~~~~
compilation terminated.

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.