Giter Site home page Giter Site logo

fernandofernandesantos / libloghelper Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ufrgs-carol/libloghelper

0.0 0.0 0.0 389 KB

Library necessary to radiation experiments

License: GNU General Public License v3.0

Shell 4.90% C++ 62.02% C 8.31% CMake 24.23% SWIG 0.54%

libloghelper's Introduction

libLogHelper

This lib is necessary for radiation experiments to log benchmark data. This library is meant to be used within the benchmark source code.

Dependencies

  • CMake >=3.16
  • GCC with std=C11
  • SWIG for Python applications
  • Python >=3.8
  • Python libraries: python3.8-dev python3.8-distutils python3.8-venv

Getting started

To use with C or C++, you have to build the library and then link with your code. The library functions are not thread safe.

Building libLogHelper

You can set some library functionalities on CMake:

  • -DLOGGING_TYPE= To set the logging approach, that can be LOCAL, UDP, LOCAL_AND_UPD (default is LOCAL).
  • -DWITH_PYTHON_SUPPORT=OFF to disable Python 3.8 wrapper building
  • -DWITH_DEBUG=OFF to disable debug printing information
  • -DRAD_BENCHS_INSTALL_DIR=<path to rad benchmarks> (default /home/carol/radiation-benchmarks)
  • -DWATCHDOG_COMMANDS=<signal command to be sent to the SW watchdog (default killall -q -USR1 killtestSignal-2.0.py; test_killtest_commands_json-2.0.py;; killall -q -USR1 killall -q -USR1 python3;)>
  • -DTMP_DIR=<System tmp dir (default /tmp)>
  • -DECC_INFO_FILE_DIR=<Path to file that will contain 1/0 that refers to ECC enabled or disabled respectively (default /tmp/ecc-info-file.txt)>
  • -DSERVER_IP=<Server that will receive the messages IP (default 192.168.1.5)>
  • -DSERVER_PORT=<server port that will receive the messages (default 1024)>
  • -DLOG_DIR=<path to where the logs will be saved (default is /var)>
cd libLogHelper
mkdir build && cd build
# To build the whole lib
cmake ..
# To set a specific configuration
# In this case we set the server ip to 192.168.1.4
# cmake -DSERVER_IP=192.168.1.4 ..
make

If you wish to install in the whole system

sudo make install
sudo ldconfig

To uninstall the library (LOG_DIR/radiation-benchmarks/ path is not deleted)

sudo make uninstall

Then to use you just have to build the benchmark with this library use -lLogHelper with -I<install_path>/include -L< install_path>/lib (if not installed in the system)

// include the header in your C code
#include "log_helper.h"
...
// include the header in your C++ code
#include "log_helper.hpp"

Python Wrapper

It is possible to use the Python 3.8 wrapper to use the library on Python apps. You have to set the path to the build folder, then just call the same name as:

import log_helper as lh

lh.start_log_file("MyBenchmark", "Myheader")
...

libloghelper's People

Contributors

fernandofernandesantos avatar dagoliveira avatar cblunardi avatar viniciusfratin avatar gpdavila avatar lfweigel avatar lowellausen 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.