Giter Site home page Giter Site logo

libmuonpi's People

Contributors

dtreffenstaedt avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

muonpi-kr

libmuonpi's Issues

Create examples

Provide a number of examples to show the usage of the libraries.

Linker error when using the libmuonpi library

Functions muonpi::http::content_type::json()and muonpi::http::content_type::html() are defined in the same header file as they are declared. This seems to lead to problems when using the library.

/usr/include/muonpi/http_response.h:72: multiple definition of `muonpi::http::content_type::html()'; CMakeFiles/rest_server.dir/rest_server/src/main.cpp.o:/usr/include/muonpi/http_response.h:72: first defined here
/usr/bin/ld: CMakeFiles/rest_server.dir/common_files/src/api.cpp.o: in function `muonpi::http::content_type::json()':

Logging level is getting ignored

Steps to reproduce:

  • call muonpi::log::setup(muonpi::log::Level::Error)
  • use muonp::log::debug() function

Expected behaviour:
Debug logs are not printed.

Observed behaviour:
Debug logs are printed.
Image Pasted at 2022-2-1 19-26

Files missing from getting exported in packages

Build packages with cpack (removed shlibs due to other bug during packaging).
Installed all generated packages on system using apt.
At least 'global.h', 'http_tools.h', 'log.h', 'threadrunner.h' are not in /usr/include/muonpi/

Problem building packages

Something is wrong with shlibs. Maybe some path not specified?

CMake Error at /home/marvin/cmake-3.22.1/Modules/Internal/CPack/CPackDeb.cmake:340 (message):
  CPackDeb: dpkg-shlibdeps: 'dpkg-shlibdeps: error: cannot find library
  libmuonpi-core.so.  needed by ./usr/lib/libmuonpi-detector.so.  (ELF
  format: 'elf64-x86-64' abi: '0201003e00000000'; RPATH: '')

  dpkg-shlibdeps: warning: package could avoid a useless dependency if
  ./usr/lib/libmuonpi-detector.so.  was not linked against libgpiod.so.2 (it
  uses none of the library's symbols)

  dpkg-shlibdeps: warning: package could avoid a useless dependency if
  ./usr/lib/libmuonpi-detector.so.  was not linked against
  libboost_system.so.1.71.0 (it uses none of the library's symbols)

  dpkg-shlibdeps: warning: package could avoid a useless dependency if
  ./usr/lib/libmuonpi-detector.so.  was not linked against
  libboost_program_options.so.1.71.0 (it uses none of the library's symbols)

  dpkg-shlibdeps: error: cannot continue due to the error above

  Note: libraries are not searched in other binary packages that do not have
  any shlibs or symbols file.

  To help dpkg-shlibdeps find private libraries, you might need to use -l.

  ';

  executed command: '/usr/bin/dpkg-shlibdeps --ignore-missing-info -O
  ./usr/lib/libmuonpi-detector.so.';

  found files: './usr/lib/libmuonpi-detector.so.1: symbolic link to
  libmuonpi-detector.so.

  ';

  files info: './usr/-detector/changelog.gz: gzip compressed data, max
  compression, from Unix, original size modulo 2^32 132

  ;./usr/-detector/copyright: ASCII text

  ;./usr/lib/libmuonpi-detector.so.: ELF 64-bit LSB shared object, x86-64,
  version 1 (SYSV), dynamically linked,
  BuildID[sha1]=b026d41977a49199f06998dc201a1e2d2d59fbd1, not stripped

  ;./usr/lib/libmuonpi-detector.so.1: symbolic link to libmuonpi-detector.so.

  ';

  binary files: './usr/lib/libmuonpi-detector.so.'
Call Stack (most recent call first):
  /home/marvin/cmake-3.22.1/Modules/Internal/CPack/CPackDeb.cmake:793 (cpack_deb_prepare_package_vars)


CPack Error: Error while execution CPackDeb.cmake
CPack Error: Error while execution CPackDeb.cmake
CPack Error: Error while execution CPackDeb.cmake
CPack Error: Error while execution CPackDeb.cmake
CPack Error: Error while execution CPackDeb.cmake
CPack Error: Error while execution CPackDeb.cmake
CPack Error: Problem compressing the directory
CPack Error: Error when generating package: libmuonpi```

Trying to instantiate a serial::i2c_device object via serial::i2c_bus::open(uint8_t) function fails from unclear reason

In the newly generated i2c example the instatiation of i2c_device objects via the i2c_bus::open function fails to compile with:

In file included from /home/pi/work/libmuonpi/examples/i2c/src/main.cpp:2: /home/pi/work/libmuonpi/include/muonpi/serial/i2cbus.h: In instantiation of ‘T& muonpi::serial::i2c_bus::open(uint8_t) [with T = muonpi::serial::i2c_device; typename std::enable_if<std::is_base_of<muonpi::serial::i2c_device, T>::value, bool>::type <anonymous> = 1; uint8_t = unsigned char]’: /home/pi/work/libmuonpi/examples/i2c/src/main.cpp:21:63: required from here /home/pi/work/libmuonpi/include/muonpi/serial/i2cbus.h:38:16: error: cannot dynamic_cast ‘((muonpi::serial::i2c_bus*)this)->muonpi::serial::i2c_bus::m_devices.std::map<unsigned char, std::reference_wrapper<muonpi::serial::i2c_device> >::operator[](address)’ (of type ‘std::map<unsigned char, std::reference_wrapper<muonpi::serial::i2c_device> >::mapped_type’ {aka ‘class std::reference_wrapper<muonpi::serial::i2c_device>’}) to type ‘class muonpi::serial::i2c_device&’ (source type is not polymorphic) return dynamic_cast<T&>(m_devices[address]);

The responsible source line is this:

return dynamic_cast<T&>(m_devices[address]);

This is very strange, since the dynamic_cast in the i2c_bus::open function fails to convert from an element of m_devices member map (which is of type std::reference_wrapper<i2c_device>) to i2c_device&. The class i2c_device is clearly polymorphic to itself (and has also a virtual destructor).

dpkg-shlibdeps cannot find library libmuonpi-core.so. after calling 'make package'

CMake Error at /home/marvin/cmake-3.22.1/Modules/Internal/CPack/CPackDeb.cmake:340 (message):
  CPackDeb: dpkg-shlibdeps: 'dpkg-shlibdeps: error: cannot find library
  libmuonpi-core.so.  needed by ./usr/lib/libmuonpi-detector.so.  (ELF
  format: 'elf64-x86-64' abi: '0201003e00000000'; RPATH: '/usr/local/lib')

The file exists here:
./output/lib/libmuonpi-core.so.

Warning about unused dependencies

Is this an issue or something that cannot be avoided? Or maybe the dependencies are for further use.

  dpkg-shlibdeps: warning: package could avoid a useless dependency if
  ./usr/lib/libmuonpi-detector.so.  was not linked against
  libboost_program_options.so.1.78.0 (it uses none of the library's symbols)

  dpkg-shlibdeps: warning: package could avoid a useless dependency if
  ./usr/lib/libmuonpi-detector.so.  was not linked against libatomic.so.1 (it
  uses none of the library's symbols)

  dpkg-shlibdeps: warning: package could avoid a useless dependency if
  ./usr/lib/libmuonpi-detector.so.  was not linked against
  libboost_system.so.1.78.0 (it uses none of the library's symbols)

  dpkg-shlibdeps: warning: package could avoid a useless dependency if
  ./usr/lib/libmuonpi-detector.so.  was not linked against libdl.so.2 (it
  uses none of the library's symbols)

Ensure compatability with boost 1.67

Currently all implementations for the boost related things only work with boost 1.7x and older versions available on raspberrypi os do not work. This needs to be fixed before release 1.0.0

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.