This is an automated email from the ASF dual-hosted git repository. dmagda pushed a commit to branch IGNITE-7595 in repository https://gitbox.apache.org/repos/asf/ignite.git
The following commit(s) were added to refs/heads/IGNITE-7595 by this push: new 67db5ef IGNITE-13459 Document new building process of Ignite C++ (CMake) (#8269) 67db5ef is described below commit 67db5ef43f9600b8ffdaf64c9a5389f619ee0439 Author: Ivan Daschinskiy <ivanda...@gmail.com> AuthorDate: Thu Sep 24 22:06:41 2020 +0300 IGNITE-13459 Document new building process of Ignite C++ (CMake) (#8269) * IGNITE-13459 Document new build process on linux (CMake) --- docs/_docs/SQL/ODBC/odbc-driver.adoc | 45 ++++++++---- .../includes/cpp-linux-build-prerequisites.adoc | 31 ++++++++ docs/_docs/includes/cpp-prerequisites.adoc | 13 ++++ docs/_docs/quick-start/cpp.adoc | 83 ++++++++++++++-------- docs/_docs/thin-clients/cpp-thin-client.adoc | 44 ++++-------- 5 files changed, 143 insertions(+), 73 deletions(-) diff --git a/docs/_docs/SQL/ODBC/odbc-driver.adoc b/docs/_docs/SQL/ODBC/odbc-driver.adoc index 4833c27..21149ff 100644 --- a/docs/_docs/SQL/ODBC/odbc-driver.adoc +++ b/docs/_docs/SQL/ODBC/odbc-driver.adoc @@ -136,7 +136,7 @@ Apache Ignite ODBC Driver was officially tested on: |OS |- Windows (XP and up, both 32-bit and 64-bit versions) - Windows Server (2008 and up, both 32-bit and 64-bit versions) -- Ubuntu (14.x and 15.x 64-bit) +- Ubuntu (18.04 64-bit) |C++ compiler @@ -201,21 +201,38 @@ As a result, `ignite-odbc-amd64.msi` and `ignite-odbc-x86.msi` files should appe On a Linux-based operating system, you will need to install an ODBC Driver Manager of your choice to be able to build and use the Ignite ODBC Driver. The ODBC Driver has been tested with link:http://www.unixodbc.org[UnixODBC]. -Additionally, you will need `GCC`, `G++`, and `make` to build the driver and its dependencies. +==== Prerequisites +include::includes/cpp-linux-build-prerequisites.adoc[] -Once all the above mentioned are installed, you can build the Ignite ODBC driver: +NOTE: The JDK is used only during the build process and not by the ODBC driver itself. -[source,shell] +==== Building ODBC driver +- Create a build directory for cmake. We'll refer to it as `${CPP_BUILD_DIR}` +- (Optional) Choose installation directory prefix (by default `/usr/local`). We'll refer to it as `${CPP_INSTALL_DIR}` +- Build and install the driver by executing the following commands: + +[tabs] +-- +tab:Ubuntu[] +[source,bash,subs="attributes,specialchars"] ---- -cd $IGNITE_HOME/platforms/cpp -libtoolize && aclocal && autoheader && automake --add-missing && autoreconf -./configure --enable-odbc --disable-node --disable-core +cd ${CPP_BUILD_DIR} +cmake -DCMAKE_BUILD_TYPE=Release -DWITH_ODBC=ON ${IGNITE_HOME}/platforms/cpp -DCMAKE_INSTALL_PREFIX=${CPP_INSTALL_DIR} make +sudo make install +---- -#The following step will most probably require root privileges: -make install +tab:CentOS/RHEL[] +[source,shell,subs="attributes,specialchars"] +---- +cd ${CPP_BUILD_DIR} +cmake3 -DCMAKE_BUILD_TYPE=Release -DWITH_ODBC=ON ${IGNITE_HOME}/platforms/cpp -DCMAKE_INSTALL_PREFIX=${CPP_INSTALL_DIR} +make +sudo make install ---- +-- + After the build process is over, you can find out where your ODBC driver has been placed by running the following command: [source,shell] @@ -284,12 +301,14 @@ Once you have built the driver and performed the `make install` command, the ODB + If there are unresolved links to other libraries, you may want to add directories with these libraries to the `LD_LIBRARY_PATH`. -- Edit file `$IGNITE_HOME/platforms/cpp/odbc/install/ignite-odbc-install.ini` and ensure that Driver parameter of the Apache Ignite section points to where `libignite-odbc.so` is located. +- Edit file `${IGNITE_HOME}/platforms/cpp/odbc/install/ignite-odbc-install.ini` and ensure that Driver parameter of the Apache Ignite section points to where `libignite-odbc.so` is located. - To install the ODBC driver, use the following command: -+ -`odbcinst -i -d -f $IGNITE_HOME/platforms/cpp/odbc/install/ignite-odbc-install.ini` -+ + +[source,shell] +---- +odbcinst -i -d -f ${IGNITE_HOME}/platforms/cpp/odbc/install/ignite-odbc-install.ini +---- To perform this command, you may need root privileges. Now the Apache Ignite ODBC driver is installed and ready for use. You can connect to it and use it just like any other ODBC driver. diff --git a/docs/_docs/includes/cpp-linux-build-prerequisites.adoc b/docs/_docs/includes/cpp-linux-build-prerequisites.adoc new file mode 100644 index 0000000..28c8f98 --- /dev/null +++ b/docs/_docs/includes/cpp-linux-build-prerequisites.adoc @@ -0,0 +1,31 @@ +The following packages need to be installed: + +- C++ compiler +- cmake 3.6+ +- jdk +- openssl, including header files +- unixODBC + +Installation instructions for several popular distributions are listed below: +[tabs] +-- +tab:Ubuntu 18.04/20.04[] +[source,bash,subs="attributes,specialchars"] +---- +sudo apt-get install -y build-essential cmake openjdk-11-jdk unixodbc-dev libssl-dev +---- + +tab:CentOS/RHEL 7[] +[source,shell,subs="attributes,specialchars"] +---- +sudo yum install -y epel-release +sudo yum install -y java-11-openjdk-devel cmake3 unixODBC-devel openssl-devel make gcc-c++ +---- + +tab:CentOS/RHEL 8[] +[source,shell,subs="attributes,specialchars"] +---- +sudo yum install -y java-11-openjdk-devel cmake3 unixODBC-devel openssl-devel make gcc-c++ +---- + +-- \ No newline at end of file diff --git a/docs/_docs/includes/cpp-prerequisites.adoc b/docs/_docs/includes/cpp-prerequisites.adoc new file mode 100644 index 0000000..de5bf5b --- /dev/null +++ b/docs/_docs/includes/cpp-prerequisites.adoc @@ -0,0 +1,13 @@ +[width="100%",cols="1,3"] +|=== +.3+|JDK|Oracle JDK 8 and later +|Open JDK 8 and later +|IBM JDK 8 and later +.3+|OS|Windows (Vista and up), +|Windows Server (2008 and up) +|Ubuntu (18.04 64 bit) +|Network|No restrictions (10G recommended) +|Hardware|No restrictions +|C++ compiler|MS Visual C++ (10.0 and up), g++ (4.4.0 and up) +|Visual Studio| 2010 and above +|=== diff --git a/docs/_docs/quick-start/cpp.adoc b/docs/_docs/quick-start/cpp.adoc index 9c45ff2..67d692d 100644 --- a/docs/_docs/quick-start/cpp.adoc +++ b/docs/_docs/quick-start/cpp.adoc @@ -6,14 +6,7 @@ This chapter explains system requirements for running Ignite and how to install Ignite C++ was officially tested on: -include::includes/prereqs.adoc[] - -and: - -[cols="1,3"] -|======================================================================= -|Visual Studio |2010 and above -|======================================================================= +include::includes/cpp-prerequisites.adoc[] == Installing Ignite @@ -51,30 +44,62 @@ For information about the {cpp} thin client, see link:thin-clients/cpp-thin-clie On unix systems, you can use the command line to build and run the examples included in the Ignite distribution. === Prerequisites -The following packages should be installed: -- C++ compiler -- libssl -- autotools -- automake -- libtool +include::includes/cpp-linux-build-prerequisites.adoc[] === Building C++ Ignite -. Download and unzip the Ignite binary release into a directory. We'll refer to this as `{IGNITE_HOME}`. -. `cd {IGNITE_HOME}/platforms/cpp` -. `libtoolize && aclocal && autoheader && automake --add-missing && autoreconf` -. `./configure` -. `make` - -=== Running the Thick Client Example - -. `cd {IGNITE_HOME}/platforms/cpp/examples` -. `libtoolize && aclocal && autoheader && automake --add-missing && autoreconf` -. `./configure` -. `cd put-get-example` -. `make` -. `./ignite-put-get-example` - +- Download and unzip the Ignite binary release. We'll refer to a resulting directory as to `${IGNITE_HOME}`. +- Create build directory for CMake. We'll refer to this as `${CPP_BUILD_DIR}` +- Build and install Ignite.C++ by executing the following commands: + +[tabs] +-- +tab:Ubuntu[] +[source,bash,subs="attributes,specialchars"] +---- +cd ${CPP_BUILD_DIR} +cmake -DCMAKE_BUILD_TYPE=Release -DWITH_ODBC=ON -DWITH_THIN_CLIENT=ON ${IGNITE_HOME}/platforms/cpp +make +sudo make install +---- + +tab:CentOS/RHEL[] +[source,shell,subs="attributes,specialchars"] +---- +cd ${CPP_BUILD_DIR} +cmake3 -DCMAKE_BUILD_TYPE=Release -DWITH_ODBC=ON -DWITH_THIN_CLIENT=ON ${IGNITE_HOME}/platforms/cpp +make +sudo make install +---- + +-- + + +=== Building and running the Thick Client Example +- Create a build directory for cmake. We'll refer to it as `${CPP_EXAMPLES_BUILD_DIR}` +- Build the examples by executing the following commands: + +[tabs] +-- +tab:Ubuntu[] +[source,bash,subs="attributes,specialchars"] +---- +cd ${CPP_EXAMPLES_BUILD_DIR} +cmake -DCMAKE_BUILD_TYPE=Release ${IGNITE_HOME}/platforms/cpp/examples && make +cd ./put-get-example +./ignite-put-get-example +---- + +tab:CentOS/RHEL[] +[source,shell,subs="attributes,specialchars"] +---- +cd ${CPP_EXAMPLES_BUILD_DIR} +cmake3 -DCMAKE_BUILD_TYPE=Release ${IGNITE_HOME}/platforms/cpp/examples && make +cd ./put-get-example +./ignite-put-get-example +---- + +-- == Next Steps diff --git a/docs/_docs/thin-clients/cpp-thin-client.adoc b/docs/_docs/thin-clients/cpp-thin-client.adoc index 1792602..5958cd3 100644 --- a/docs/_docs/thin-clients/cpp-thin-client.adoc +++ b/docs/_docs/thin-clients/cpp-thin-client.adoc @@ -7,7 +7,7 @@ == Installation -The source code of the C++ thin client comes with the Ignite distribution package under the `{IGNITE_HOME}/platforms/cpp` directory. +The source code of the C++ thin client comes with the Ignite distribution package under the `${IGNITE_HOME}/platforms/cpp` directory. [tabs] @@ -15,47 +15,29 @@ The source code of the C++ thin client comes with the Ignite distribution packag tab:Windows[] [source,bat] ---- -cd {IGNITE_HOME}\platforms\cpp\project\vs +cd %IGNITE_HOME%\platforms\cpp\project\vs msbuild ignite.sln /p:Configuration=Release /p:Platform=x64 ---- -tab:Linux (system wide)[] -[source,shell] +tab:Ubuntu[] +[source,bash,subs="attributes,specialchars"] ---- -cd {IGNITE_HOME}/platforms/cpp -libtoolize && aclocal && autoheader && automake --add-missing && autoreconf - -# You can call the following command to see all the available -# configuration options: -# ./configure --help -# To use default configuration just type: -./configure +cd ${CPP_BUILD_DIR} +cmake -DCMAKE_BUILD_TYPE=Release -DWITH_THIN_CLIENT=ON ${IGNITE_HOME}/platforms/cpp make - -#The following step is optional if you want to install Ignite -#for your system. It would probably require root: sudo make install ---- -tab:Linux (local directory)[] -[source,shell] +tab:CentOS/RHEL[] +[source,shell,subs="attributes,specialchars"] ---- -cd platforms/cpp -libtoolize && aclocal && autoheader && automake --add-missing && autoreconf - -# You can call the following command to see all the available -# configuration options: -# ./configure --help -# -# Specify a target subdirectory in your user's home dir: -./configure --prefix=/home/user/odbc -make - -#The following step is needed if you want to install Ignite -#under specified prefix directory. -make install +cd ${CPP_BUILD_DIR} +cmake3 -DCMAKE_BUILD_TYPE=Release -DWITH_THIN_CLIENT=ON ${IGNITE_HOME}/platforms/cpp +make +sudo make install ---- + --