Skip to content

Latest commit

 

History

History
110 lines (76 loc) · 2.43 KB

README.md

File metadata and controls

110 lines (76 loc) · 2.43 KB

Apache OpenDAL™ CPP Binding (WIP)

Documents: Documents

Example

#include "opendal.hpp"
#include <vector>

int main() {
    auto op = opendal::Operator("memory");
    std::vector<uint8_t> data = {1, 2, 3, 4, 5};
    op.write("test", data);
    auto result = op.read("test");  // result == data
}

More examples can be found here.

Using

CMake

You can use FetchContent to add OpenDAL to your project.

FetchContent_Declare(
  opendal-cpp
  GIT_REPOSITORY https://github.com/apache/opendal.git
  GIT_TAG        v0.40.0
  SOURCE_SUBDIR  bindings/cpp
)
FetchContent_MakeAvailable(opendal-cpp)

Or you can download the source code and add it to your project.

mkdir third_party
cd third_party
git clone https://github.com/apache/opendal.git
git checkout v0.40.0
add_subdirectory(third_party/opendal/bindings/cpp)

Now you can use OpenDAL in your project.

target_link_libraries(your_target opendal_cpp)

Others

Support for more package managers is coming soon!

Compiling

Prerequisites

  • CMake >= 3.10
  • C++ compiler with C++17 support
  • The boost library

Build

mkdir build
cd build
# Add -DOPENDAL_DEV=ON to make development environment for OpenDAL
cmake ..
make

Test

You should build the project with OPENDAL_ENABLE_TESTING option. Then run:

make test

Docs

You should build the project with OPENDAL_ENABLE_DOCUMENTATION option. Then run:

make docs

CMake Options

  • OPENDAL_DEV: Enable development environment for OpenDAL. It will enable most development options. With this option, you don't need to set other options. Default: OFF
  • OPENDAL_ENABLE_ADDRESS_SANITIZER: Enable address sanitizer. Default: OFF
  • OPENDAL_ENABLE_DOCUMENTATION: Enable documentation. Default: OFF
  • OPENDAL_DOCS_ONLY: Only build documentation. Default: OFF
  • OPENDAL_ENABLE_TESTING: Enable testing. Default: OFF

License and Trademarks

Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0

Apache OpenDAL, OpenDAL, and Apache are either registered trademarks or trademarks of the Apache Software Foundation.