install gcc 5.3

sudo yum install centos-release-scl
sudo yum install devtoolset-4-toolchain
scl enable devtoolset-4 bash
sudo scl enable devtoolset-4 bash
gcc --version
    gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6)
    Copyright (C) 2015 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.  There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

sudo vi /etc/profile
source /opt/rh/devtoolset-4/enable

install cmake 3

wget https://github.com/Kitware/CMake/releases/download/v3.15.5/cmake-3.15.5.tar.gz
tar xzvf cmake-3.15.5.tar.gz
cd cmake-3.15.5/
./configure
gmake
sudo make install
cmake --version
    cmake version 3.15.5
    CMake suite maintained and supported by Kitware (kitware.com/cmake).

install oracle instant client

sudo yum install oracle-instantclient18.5-*.rpm
vi .bash_profile
export LD_LIBRARY_PATH=/usr/lib/oracle/18.5/client64/lib:$LD_LIBRARY_PATH
export PATH=/usr/lib/oracle/18.5/client64/bin:$PATH

verify OCCI function

make a CMakeLists.txt fire

cmake_minimum_required(VERSION 3.15) 
project(occidemo) 

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") 
set(SOURCES occidemo.cpp)

add_executable(occidemo ${SOURCES}) 

include_directories(
    /usr/include/oracle/18.5/client64
) 

set(REQ_LIB 
    /usr/lib/oracle/18.5/client64/lib/libocci.so 
    /usr/lib/oracle/18.5/client64/lib/libclntsh.so
) 
target_link_libraries(occidemo ${REQ_LIB}) 

write a occi cpp program

#include <iostream>
#include <occi.h>
using namespace std;
using namespace oracle::occi;
int main()
{
    Environment *env = Environment::createEnvironment(Environment::DEFAULT);
    string name = "scott";
    string pass = "tiger";
    string srvName = "hostname1/orcl";
    try
    {
        Connection *conn = env->createConnection(name, pass, srvName);
        oracle::occi::Statement *stmt = conn->createStatement("select ename from emp where empno=7369");
        oracle::occi::ResultSet *rs = stmt->executeQuery();
        string ename{};
        rs->next();
        ename = rs->getString(1);
        cout << "ename: " << ename << endl;
        env->terminateConnection(conn);
    }
    catch (SQLException e)
    {
        cout << e.what() << endl;
        return -1;
    }
    Environment::terminateEnvironment(env);
    return 0;
}

compile and run program

$ ll
    drwxrwxr-x. 2 martin martin   6 11月  4 07:13 build
    -rw-rw-r--. 1 martin martin 400 11月  4 06:59 CMakeLists.txt
    -rw-rw-r--. 1 martin martin 856 11月  4 07:09 occidemo.cpp
$ cd build
$ cmake ..
    -- The C compiler identification is GNU 5.3.1
    -- The CXX compiler identification is GNU 5.3.1
    -- Check for working C compiler: /opt/rh/devtoolset-4/root/usr/bin/cc
    -- Check for working C compiler: /opt/rh/devtoolset-4/root/usr/bin/cc -- works
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Detecting C compile features
    -- Detecting C compile features - done
    -- Check for working CXX compiler: /opt/rh/devtoolset-4/root/usr/bin/c++
    -- Check for working CXX compiler: /opt/rh/devtoolset-4/root/usr/bin/c++ -- works
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Detecting CXX compile features
    -- Detecting CXX compile features - done
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /home/martin/occidemo/build
$ make
    Scanning dependencies of target occidemo
    [ 50%] Building CXX object CMakeFiles/occidemo.dir/occidemo.cpp.o
    [100%] Linking CXX executable occidemo
    [100%] Built target occidemo

$ ./occidemo
ename: SMITH