|
72 | 72 | <div class="headertitle"><div class="title">Apache DataSketches Core C++ Library Component </div></div> |
73 | 73 | </div><!--header--> |
74 | 74 | <div class="contents"> |
75 | | -<div class="textblock"><p><a class="anchor" id="md_README"></a>This is the core C++ component of the Apache DataSketches library. It contains all of the key sketching algorithms that are in the Java component and can be accessed directly from user applications.</p> |
76 | | -<p>This component is also a dependency of other components of the library that create adaptors for target systems, such as PostgreSQL.</p> |
77 | | -<p>Note that we have a parallel core component for [Java]((<a href="https://github.com/apache/datasketches-java">https://github.com/apache/datasketches-java</a>) and [Python]((<a href="https://github.com/apache/datasketches-python">https://github.com/apache/datasketches-python</a>) implementations of the same sketch algorithms.</p> |
| 75 | +<div class="textblock"><p><a class="anchor" id="md_README"></a> This is the core C++ component of the Apache DataSketches library. It contains all the key sketching algorithms from the Java implementation and can be accessed directly by user applications.</p> |
| 76 | +<p>This component is also a dependency of other library components that create adaptors for target systems, such as <a href="https://github.com/apache/datasketches-postgresql">PostgreSQL</a>.</p> |
| 77 | +<p>Note that we have parallel core library components for Java, Python, and GO implementations of many of the same sketch algorithms:</p> |
| 78 | +<ul> |
| 79 | +<li><a href="https://github.com/apache/datasketches-java">datasketches-java</a></li> |
| 80 | +<li><a href="https://github.com/apache/datasketches-python">datasketches-python</a></li> |
| 81 | +<li><a href="https://github.com/apache/datasketches-go">datasketches-go</a></li> |
| 82 | +</ul> |
78 | 83 | <p>Please visit the main <a href="https://datasketches.apache.org">Apache DataSketches website</a> for more information.</p> |
79 | | -<p>If you are interested in making contributions to this site please see our <a href="https://datasketches.apache.org/docs/Community/">Community</a> page for how to contact us.</p> |
| 84 | +<p>If you are interested in making contributions to this site, please see our <a href="https://datasketches.apache.org/docs/Community/">Community</a> page for how to contact us.</p> |
80 | 85 | <hr /> |
81 | 86 | <p>This code requires C++11.</p> |
82 | | -<p>This library is header-only. The build process provided is only for building unit tests.</p> |
83 | | -<p>Building the unit tests requires cmake 3.12.0 or higher.</p> |
84 | | -<p>Installing the latest cmake on OSX: brew install cmake</p> |
85 | | -<p>Building and running unit tests using cmake for OSX and Linux:</p> |
86 | | -<div class="fragment"><div class="line">$ cmake -S . -B build/Release -DCMAKE_BUILD_TYPE=Release</div> |
87 | | -<div class="line">$ cmake --build build/Release -t all test</div> |
88 | | -</div><!-- fragment --><p>Building and running unit tests using cmake for Windows from the command line:</p> |
89 | | -<div class="fragment"><div class="line">$ cd build</div> |
90 | | -<div class="line">$ cmake ..</div> |
91 | | -<div class="line">$ cd ..</div> |
92 | | -<div class="line">$ cmake --build build --config Release</div> |
93 | | -<div class="line">$ cmake --build build --config Release --target RUN_TESTS</div> |
94 | | -</div><!-- fragment --><p>To install a local distribution (OSX and Linux), use the following command. The CMAKE_INSTALL_PREFIX variable controls the destination. If not specified, it defaults to installing in /usr (/usr/include, /usr/lib, etc). In the command below, the installation will be in /tmp/install/DataSketches (/tmp/install/DataSketches/include, /tmp/install/DataSketches/lib, etc)</p> |
95 | | -<div class="fragment"><div class="line">$ cmake -S . -B build/Release -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/tmp/install/DataSketches</div> |
96 | | -<div class="line">$ cmake --build build/Release -t install</div> |
97 | | -</div><!-- fragment --><p>To generate an installable package using cmake's built in cpack packaging tool, use the following command. The type of packaging is controlled by the CPACK_GENERATOR variable (semi-colon separated list). Cmake usually supports packaging types such as RPM, DEB, STGZ, TGZ, TZ, ZIP, etc.</p> |
98 | | -<div class="fragment"><div class="line">$ cmake3 -S . -B build/Release -DCMAKE_BUILD_TYPE=Release -DCPACK_GENERATOR="RPM;STGZ;TGZ" </div> |
99 | | -<div class="line">$ cmake3 --build build/Release -t package</div> |
100 | | -</div><!-- fragment --><p>The DataSketches project can be included in other projects' CMakeLists.txt files in one of two ways. If DataSketches has been installed on the host (using an RPM, DEB, "make install" into /usr/local, or some way, then CMake's <code>find_package</code> command can be used like this:</p> |
| 87 | +<p>This library is header-only. The provided build process is only for unit tests.</p> |
| 88 | +<p>Building the unit tests requires CMake 3.12.0 or higher.</p> |
| 89 | +<p>Installing the latest CMake on OSX: <code>brew install cmake</code>.</p> |
| 90 | +<p>Building and running unit tests using CMake for OSX and Linux:</p> |
| 91 | +<div class="fragment"><div class="line">cmake -S . -B build/Release -DCMAKE_BUILD_TYPE=Release</div> |
| 92 | +<div class="line">cmake --build build/Release -t all test</div> |
| 93 | +</div><!-- fragment --><p>Building and running unit tests using CMake for Windows from the command line:</p> |
| 94 | +<div class="fragment"><div class="line">cd build</div> |
| 95 | +<div class="line">cmake ..</div> |
| 96 | +<div class="line">cd ..</div> |
| 97 | +<div class="line">cmake --build build --config Release</div> |
| 98 | +<div class="line">cmake --build build --config Release --target RUN_TESTS</div> |
| 99 | +</div><!-- fragment --><p>To install a local distribution (OSX and Linux), use the following command. The <code>CMAKE_INSTALL_PREFIX</code> variable controls the destination. If not specified, it defaults to installing in /usr (/usr/include, /usr/lib, etc). In the command below, the installation will be in /tmp/install/DataSketches (/tmp/install/DataSketches/include, /tmp/install/DataSketches/lib, etc).</p> |
| 100 | +<div class="fragment"><div class="line">cmake -S . -B build/Release -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/tmp/install/DataSketches</div> |
| 101 | +<div class="line">cmake --build build/Release -t install</div> |
| 102 | +</div><!-- fragment --><p>To generate an installable package using CMake's built-in cpack packaging tool, use the following command. The type of packaging is controlled by the <code>CPACK_GENERATOR</code> variable (semi-colon separated list). CMake usually supports packaging formats such as RPM, DEB, STGZ, TGZ, TZ, and ZIP.</p> |
| 103 | +<div class="fragment"><div class="line">cmake -S . -B build/Release -DCMAKE_BUILD_TYPE=Release -DCPACK_GENERATOR="RPM;STGZ;TGZ" </div> |
| 104 | +<div class="line">cmake --build build/Release -t package</div> |
| 105 | +</div><!-- fragment --><p>The DataSketches project can be included in other projects' CMakeLists.txt files in one of two ways.</p> |
| 106 | +<p>If DataSketches has been installed on the host (using an RPM, DEB, "make install" into /usr/local, or some way, then CMake's <code>find_package</code> command can be used like this:</p> |
101 | 107 | <div class="fragment"><div class="line">find_package(DataSketches 3.2 REQUIRED)</div> |
102 | 108 | <div class="line">target_link_library(my_dependent_target PUBLIC ${DATASKETCHES_LIB})</div> |
103 | 109 | </div><!-- fragment --><p>When used with find_package, DataSketches exports several variables, including</p> |
104 | 110 | <ul> |
105 | 111 | <li><code>DATASKETCHES_VERSION</code>: The version number of the datasketches package that was imported.</li> |
106 | | -<li><code>DATASKETCHES_INCLUDE_DIR</code>: The directory that should be added to access DataSketches include files. Because cmake automatically includes the interface directories for included target libraries when using <code>target_link_library</code>, under normal circumstances there will be no need to include this directly.</li> |
| 112 | +<li><code>DATASKETCHES_INCLUDE_DIR</code>: The directory that should be added to access DataSketches include files. Because CMake automatically includes the interface directories for included target libraries when using <code>target_link_library</code>, under normal circumstances, there will be no need to include this directly</li> |
107 | 113 | <li><code>DATASKETCHES_LIB</code>: The name of the DataSketches target to include as a dependency. Projects pulling in DataSketches should reference this with <code>target_link_library</code> in order to set up all the correct dependencies and include paths.</li> |
108 | 114 | </ul> |
109 | 115 | <p>If you don't have DataSketches installed locally, dependent projects can pull it directly from GitHub using CMake's <code>ExternalProject</code> module. The code would look something like this:</p> |
|
0 commit comments