Google Cloud Client Library for C++
Clone or download
coryan Move GcsObjectVersion class to a separate file. (#1302)
This is part of the work to break the testbench script into smaller
pieces.
Latest commit 63fb288 Oct 17, 2018
Permalink
Failed to load latest commit information.
.github Include Google Cloud Storage as a component [skip ci]. (#634) Jun 3, 2018
bazel Use external project for googletest. (#1234) Oct 11, 2018
ci Speedup code coverage builds. (#1292) Oct 15, 2018
cmake Make dependency versions configurable. (#1296) Oct 16, 2018
doc Use a single option to control dependency sources. (#1281) Oct 15, 2018
google/cloud Move GcsObjectVersion class to a separate file. (#1302) Oct 17, 2018
third_party Use external project for googletest. (#1234) Oct 11, 2018
.appveyor.yml More splitting of testbench.py (#1222) Oct 13, 2018
.clang-format Initial classes to make http requests. (#507) May 15, 2018
.clang-tidy Turn clang-tidy warnings into errors. (#591) May 28, 2018
.cmake-format.py Simplified external project. (#1231) Oct 9, 2018
.codecov.yml Improve coverage of all examples. (#1045) Aug 31, 2018
.dockerignore Create initial build matrix. (#8) Nov 26, 2017
.editorconfig Added EditorConfig support. [skip ci] (#78) Dec 7, 2017
.gitignore Move ErrorResponse to its own file. (#1205) Oct 4, 2018
.gitmodules Use external project for googletest. (#1234) Oct 11, 2018
.travis.yml Speedup code coverage builds. (#1292) Oct 15, 2018
BUILD Support Bazel-based builds. (#452) Apr 26, 2018
CMakeLists.txt Use a single option to control dependency sources. (#1281) Oct 15, 2018
CODE_OF_CONDUCT.md Adopt the Contributor Covenant 1.2.0 code of conduct. (#2) Nov 24, 2017
CONTRIBUTING.md Update recommended Ubuntu version. (#1092) Sep 7, 2018
LICENSE Initial commit. Nov 24, 2017
README.md Link Google Cloud Storage from top-level README. (#1170) Oct 8, 2018
WORKSPACE Support Bazel-based builds. (#452) Apr 26, 2018

README.md

Google Cloud Platform C++ Client Libraries

C++ Idiomatic Clients for Google Cloud Platform services.

Travis CI status AppVeyor CI status Codecov Coverage status

This library supports the following Google Cloud Platform services with clients at the Beta quality level:

This library supports the following Google Cloud Platform services with clients at the Alpha quality level:

The libraries in this code base likely do not (yet) cover all the available APIs.

Table of Contents

Requirements

Compiler

The Google Cloud C++ libraries are tested with the following compilers:

Compiler Minimum Version
GCC 4.9
Clang 3.8
MSVC++ 14.1
Apple Clang 8.1

Build Tools

The Google Cloud C++ Client Libraries can be built with CMake or Bazel. The minimal versions of these tools we test with are:

Tool Minimum Version
CMake 3.5
Bazel 0.12.0

Libraries

The libraries also depends on gRPC, libcurl, and the dependencies of those libraries. The Google Cloud C++ Client libraries are tested with the following versions of these dependencies:

Library Minimum version
gRPC v1.10.x
libcurl 7.47.0

Tests

Integration tests at times use the Google Cloud SDK. The integration tests run against the latest version of the SDK on each commit and PR.

Install Dependencies

CentOS

The default compiler on CentOS doesn't fully support C++11. We need to upgrade the compiler and other development tools. In these instructions, we use g++-7 via Software Collections.

# Extra Packages for Enterprise Linux used to install cmake3
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

yum install centos-release-scl
yum-config-manager --enable rhel-server-rhscl-7-rpms

yum makecache
yum install -y devtoolset-7 cmake3 curl-devel git openssl-devel

# Install cmake3 & ctest3 as cmake & ctest respectively.
ln -sf /usr/bin/cmake3 /usr/bin/cmake && ln -sf /usr/bin/ctest3 /usr/bin/ctest

Debian (Stretch)

sudo apt update
sudo apt install -y build-essential cmake git gcc g++ cmake libcurl4-openssl-dev libssl-dev make zlib1g-dev

Fedora

sudo dnf makecache
sudo dnf install -y clang cmake gcc-c++ git libcurl-devel make openssl-devel

OpenSuSE (Tumbleweed)

sudo zypper refresh
sudo zypper install -y cmake gcc gcc-c++ git libcurl-devel make

OpenSuSE (Leap)

The stock compiler on OpenSuSE (Leap) has poor support for C++11, we recommend updating to g++-5 using:

sudo zypper refresh
sudo zypper install -y cmake gcc gcc-c++ git libcurl-devel make
sudo zypper install gcc5 gcc5-c++
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 100
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-5 100

Ubuntu (Bionic Beaver)

sudo apt update
sudo apt install -y build-essential cmake git gcc g++ cmake libcurl4-openssl-dev libssl-dev make zlib1g-dev

Ubuntu (Xenial Xerus)

sudo apt update
sudo apt install -y build-essential cmake git gcc g++ cmake libcurl4-openssl-dev libssl-dev make zlib1g-dev

Ubuntu (Trusty Tahr)

The default compiler on Ubuntu-14.04 (Trusty Tahr) doesn't fully support C++11. In addition, gRPC requires a newer version of OpenSSL than the one included in the system.

It is possible to work around these limitations on a new installation of Ubuntu-14.04, but there are known issues working on a system where these libraries are already installed.

Nevertheless, the following steps are known to work:

sudo apt update
sudo apt install -y software-properties-common
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
sudo apt update
sudo apt install -y cmake3 git gcc-4.9 g++-4.9 make wget zlib1g-dev
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.9 100
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 100
cd /var/tmp/
sudo wget -q https://www.openssl.org/source/openssl-1.0.2n.tar.gz
sudo tar xf openssl-1.0.2n.tar.gz
cd /var/tmp/openssl-1.0.2n
sudo ./Configure --prefix=/usr/local --openssldir=/usr/local linux-x86_64 shared
sudo make -j $(nproc)
sudo make install

cd /var/tmp/
sudo wget -q https://curl.haxx.se/download/curl-7.61.0.tar.gz
sudo tar xf curl-7.61.0.tar.gz
cd /var/tmp/curl-7.61.0
sudo ./configure
sudo make -j $(nproc)
sudo make install

macOS (using brew)

brew install curl cmake libressl c-ares

Windows (using vcpkg)

set PROVIDER=vcpkg
set GENERATOR="Visual Studio 15 2017 Win64"
powershell -exec bypass .\ci\install-windows.ps1

Build

To build all available libraries and run the tests, run the following commands after cloning this repo:

Linux

git submodule update --init
cmake -H. -Bbuild-output

# Adjust the number of threads used by modifying parameter for `-j 4`
cmake --build build-output -- -j 4

# Verify build by running tests
(cd build-output && ctest --output-on-failure)

You will find compiled binaries in build-output/ respective to their source paths.

macOS

git submodule update --init
export OPENSSL_ROOT_DIR=/usr/local/opt/libressl
cmake -H. -Bbuild-output

# Adjust the number of threads used by modifying parameter for `-j 4`
cmake --build build-output -- -j 4

# Verify build by running tests
(cd build-output && ctest --output-on-failure)

You will find compiled binaries in build-output/ respective to their source paths.

Windows

On Windows with MSVC use:

cmake --build build-output -- /m

# Verify build by running tests
cd build-output
ctest --output-on-failure

You will find compiled binaries in build-output\ respective to their source directories.

Versioning

This library follows Semantic Versioning. Please note it is currently under active development. Any release versioned 0.x.y is subject to backwards incompatible changes at any time.

GA: Libraries defined at a GA quality level are expected to be stable and all updates in the libraries are guaranteed to be backwards-compatible. Any backwards-incompatible changes will lead to the major version increment (1.x.y -> 2.0.0).

Beta: Libraries defined at a Beta quality level are expected to be mostly stable and we're working towards their release candidate. We will address issues and requests with a higher priority.

Alpha: Libraries defined at an Alpha quality level are still a work-in-progress and are more likely to get backwards-incompatible updates. Additionally, it's possible for Alpha libraries to get deprecated and deleted before ever being promoted to Beta or GA.

Contributing changes

See CONTRIBUTING.md for details on how to contribute to this project, including how to build and test your changes as well as how to properly format your code.

Licensing

Apache 2.0; see LICENSE for details.