3.Installing Quasar dependencies - ahmedqamesh/quasar-mops-server GitHub Wiki

Quasar framework requires some dependencies which are described in details at Quasar dependencies.
In this twiki we shows how can you install all the Quasar dependancies for both:

  1. The Linux system CentOS7 Kernel available on armv7hl-32.
  2. The Linux system CentOS7 Kernel available on x86_64 or _32.

all what you need to do is to follow the following steps:

  1. Install side packages
  2. Build Quasar dependencies based on your kernel architecture.

Install side packages:

  1. Installing yum Libraries
    yum is the primary tool for getting, installing, deleting, querying, and managing Red Hat Enterprise Linux RPM software packages from official Red Hat software repositories, as well as other third-party repositories.
  • Update the environment:
    In order to make sure that we are working with the most up to date environment possible in terms of our packages, we can run the following command
    yum update -y
  1. Installing Pip Package Once you’ve confirmed that Python is correctly installed, you can proceed with installing Pip.
  • Download get-pip.py to a folder on your computer [Alternatively, you can use curl "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py" ].
  • Open a command prompt and navigate to the folder containing get-pip.py.
  • Run the following command:
    python get-pip.py
    Pip is now installed! To install a new package
    pip install [package name]
  • Installing Python Packages
    pip install lxml http-parser tqdm kafe seaborn aenum verboselogs qtawesome coloredlogs termcolor progressbar-latest pyvisa pyvisa-py pyqtgraph

Building Quasar dependencies

Before building the libraries, one needs to check the exact kernel architecture of the device using uname -mor to find the processor model in vi /proc/cpuinfo
Note that: The processor part of the used ZedBoard with Linux system CentOS7 Kernel 4.14.0-xilinx on an armv7hl-32:

For CentOS7 Kernel available on x86_64 or _32:

  1. Get Eclipse, preferably the C/C++ Developers version (e.g. https://www.eclipse.org/downloads/) Once installed, install Eclipse add-ons for XML editors.

  2. Issue this to install software from the official CC7 RPM repos:

    sudo yum install gcc-c++ gdb  python-devel  python3-devel boost-devel boost-regex boost-program-options boost-signals jre cmake graphviz valgrind doxygen rpm-build subversion xsd openssl-devel libxml2-devel xerces-c-devel python2-pip libgit2 libgit2-devel bzip2 libxslt-devel libevent-devel kdiff3 python-cffi libffi-devel 
  3. Installing CMake:
    . There are pre-compiled binaries available on the Download page for some UNIX platforms. One may alternatively download and build CMake from source. The Download page provides source releases.

     wget https://github.com/Kitware/CMake/releases/download/v3.18.0-rc2/cmake-3.18.0-rc2.tar.gz
    tar xvfz cmake-3.18.0-rc2.tar.gz
    ./bootstrap --prefix=/path/to/build/directory
    sudo gmake
    make install
    (Note: the make install step is optional, cmake will run from the build directory.)
  4. Recommended Python libraries

  • While pip alone is sufficient to install from pre-built binary archives, up to date copies of the setuptools and wheel projects are useful to ensure you can also install from source archives:
    python -m pip install --upgrade pip setuptools wheel
  • Other requirements for quasar:
    sudo pip install enum34 pygit2==0.26.4 colorama Jinja2 lxml
    WARNING: the version of pygit2 should match the version of libgit2-devel! At the time of writing it was 0.26.4.
  1. Install Artistic Style Libraries:
  • Download astyle program
  • Unzip the downloaded file:tar xvfz astyle_3.1_linux.tar.gz
  • To build the console release version:mkdir as-gcc-exe cd as-gcc-exe cmake ../ make
  • To build the shared debug version:mkdir --parents as-gcc-so cd as-gcc-so cmake -DBUILD_SHARED_LIBS=1 -DCMAKE_BUILD_TYPE=Debug ../ make
  • To build the Java release version using the Clang compiler:mkdir as-clang-java cd as-clang-java CXX=clang++ CC=clang cmake -DBUILD_JAVA_LIBS=1 ../ make
  1. Download UaExpert for an universal test&dev tool for OPC-UA.

For CentOS7 Kernel available on armv7hl-32:

  1. repeat the first 5 steps used in the first section (For CentOS Users (x86_64 or _32)). Some libraries will be missing during installation and we need to install in differently [All the needed libraries for armv7hl-32 are available on armhfp/epel].

  2. Issue this to install software from the official CC7 RPM repos:

sudo yum install -y  libxml2 libxml2-devel libxml2-python libxslt libxslt-devel
  1. Install KDiff3 program:
  • Download KDiff3 program
  • Unzip the downloaded file:tar xvfz kdiff3-0.9.98.tar.gz
  • from the KDiff3 source directory run: ./configure kde4 or ./configure qt4.
  1. Install XSD Libraries:
    Simply run the attached file /packages/xsd-4.0.0-25.el7.armv7hl.sh

  2. Install libssh Libraries:
    libssh is a C library that is needed to write a program that uses the SSH protocol.

wget https://www.libssh2.org/download/libssh2-1.9.0.tar.gz
tar xzf  libssh2-1.9.0.tar.gz
cd libssh2-1.9.0
mkdir bin
cd bin
cmake ..
cmake --build . 

Or

./configure
make 
make install
  1. Install libgit2 Libraries:
    libgit2 is a portable, pure C implementation of the Git core methods provided as a re-entrant linkable library with a solid API, allowing you to write native speed custom Git applications in any language which supports C bindings.
  • Download

  • Build the libraries

    cd libgit2-0.26.0
    mkdir libgit_build
    cd libgit_build
    cmake ..
    cmake --build .
  • Install:

    mkdir libgit_install
    export LIBGIT2=/root/Installation/libgit2-0.26.0/libgit_install
    cmake .. -DCMAKE_INSTALL_PREFIX=$LIBGIT2
    cmake --build . --target install
  • check the installation:

    whereis libgit2
    libgit2: /usr/lib/libgit2.so  /usr/local/lib/libgit2.so
  • set the enviroment:
    env LIBGIT_BUILD=/root/Installation/libgit2-0.26.0/libgit_build
    This should give

XDG_SESSION_ID=1
HOSTNAME=localhost
TERM=vt220
SHELL=/bin/bash
HISTSIZE=1000
QT_GRAPHICSSYSTEM_CHECKED=1
USER=root
LS_COLORS=
MAIL=/var/spool/mail/root
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/root/bin
PWD=/root/Installation/libgit2
LANG=en_US.UTF-8
HISTCONTROL=ignoredups
SHLVL=1
HOME=/root
LOGNAME=root
LESSOPEN=||/usr/bin/lesspipe.sh %s
XDG_RUNTIME_DIR=/run/user/0
_=/bin/env
OLDPWD=/root/Installation/libgit2/libgit_build

  1. Install pygit2:
    Pygit2 is a set of Python bindings to the libgit2 shared library, libgit2 implements the core of Git. The version number of pygit2 is composed of three numbers separated by dots « major.minor.micro », where the first two numbers « major.minor » match the first two numbers of the libgit2 version. [Here we will use libgit2-0.26.0 with pygit2-0.26.0]
export LDFLAGS="-Wl,-rpath='$LIBGIT2/lib',--enable-new-dtags $LDFLAGS"
pip install pygit2==0.26.0
⚠️ **GitHub.com Fallback** ⚠️