Tuesday, September 29, 2020

Compile Trading System with C++17

 Library versions

 

gcc version 8.3.1 20191121 (Red Hat 8.3.1-5) (GCC) 

boost_1_74_0

glog-0.4.0

libprotoc 3.13.0  (proto buffer)

NO ZeroMQ


Compile errors fixes

getopt_pp.h -> comment all throw(GetOptEx)

SyncCircularBuffer.h -> boost::interprocess::scoped_lock

boost bind errors -> boost::placeholders::_1 , boost::placeholders::_2

 

hash_map errors -> Just replace with std_map and do NOT use unordered_map. string search does not work with unordered_map

 

Exception errors -> Replace catch(Exception e) with catch catch(IoException &e) [& important]

floor function error -> Add #include <cmath>


Add  LIB += -lrt -lpthread to the Makefile for bellow error

undefined reference to symbol 'shm_unlink@@GLIBC_2.2.5'

undefined reference to symbol 'pthread_mutexattr_settype@@GLIBC_2.2.5'

2 comments:

  1. Install GCC from source (9.3.0 )
    (copied from https://linuxhostsupport.com/blog/how-to-install-gcc-on-centos-7/)

    If you need a newer version of GCC than the one distributed by the official CentOS 7 repositories you can install it from source.

    It is highly recommended to start a screen session before starting the installation. Run the following command

    screen -U -S gcc
    Download the tarball of the GCC version you want to install. In our example we will use GCC version 9.3.0

    wget http://ftp.mirrorservice.org/sites/sourceware.org/pub/gcc/releases/gcc-9.3.0/gcc-9.3.0.tar.gz
    Unpack the tar archive and change the current working directory

    tar zxf gcc-9.3.0.tar.gz
    cd gcc-9.3.0
    Install bzip2 and run the ‘download_prerequisites’ script to download some prerequisites needed by GCC. You have to run this from the top level of the GCC source tree.

    yum -y install bzip2
    ./contrib/download_prerequisites
    Once the prerequisites are downloaded execute the following command to start configuring the GCC build environment

    ./configure --disable-multilib --enable-languages=c,c++
    Once it is completed, run the following command to compile the source code. It may take a few hours for the compilation to complete, so sit back and relax.

    make -j 4
    make install
    4. Verify GCC installation on CentOS 7
    After the compilation process is completed. You can check if GCC is properly installed.

    gcc --version



    ReplyDelete
  2. IF glog get gflag error while compiling THEN remove gflags (yum remove gflags)

    ReplyDelete