Skip to content

Latest commit

 

History

History
 
 

c_glib

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Arrow GLib

Arrow GLib is a wrapper library for Arrow C++. Arrow GLib provides C API.

Arrow GLib supports GObject Introspection. It means that you can create language bindings at runtime or compile time.

For example, you can use Apache Arrow from Ruby by Arrow GLib and gobject-introspection gem with the following code:

# Generate bindings at runtime
require "gi"
Arrow = GI.load("Arrow")

# Now, you can access arrow::BooleanArray in Arrow C++ by
# Arrow::BooleanArray
p Arrow::BooleanArray

In Ruby case, you should use red-arrow gem. It's based on gobject-introspection gem. It adds many convenient features to raw gobject-introspection gem based bindings.

Install

You can use packages or build by yourself to install Arrow GLib. It's recommended that you use packages.

Note that the packages are "unofficial". "Official" packages will be released in the future.

Package

There are supported platforms:

  • Debian GNU/Linux Jessie
  • Ubuntu 16.04 LTS
  • Ubuntu 16.10
  • CentOS 7

You can feedback to https://github.com/kou/arrow-packages about packages things.

Debian GNU/Linux jessie

You need to add the following apt-lines to /etc/apt/sources.list.d/groonga.list:

deb https://packages.groonga.org/debian/ jessie main
deb-src https://packages.groonga.org/debian/ jessie main

Then you need to run the following command lines:

% sudo apt update
% sudo apt install -y --allow-unauthenticated groonga-keyring
% sudo apt update

Now you can install Arrow GLib packages:

% sudo apt install -y libarrow-glib-dev

Ubuntu 16.04 LTS and Ubuntu 16.10

You need to add an APT repository:

% sudo apt install -y software-properties-common
% sudo add-apt-repository -y ppa:groonga/ppa
% sudo apt update

Now you can install Arrow GLib packages:

% sudo apt install -y libarrow-glib-dev

CentOS 7

You need to add a Yum repository:

% sudo yum install -y https://packages.groonga.org/centos/groonga-release-1.3.0-1.noarch.rpm

Now you can install Arrow GLib packages:

% sudo yum install -y --enablerepo=epel arrow-glib-devel

How to build by users

Arrow GLib users should use released source archive to build Arrow GLib:

% wget https://dist.apache.org/repos/dist/release/arrow/arrow-0.3.0/apache-arrow-0.3.0.tar.gz
% tar xf apache-arrow-0.3.0.tar.gz
% cd apache-arrow-0.3.0

You need to build and install Arrow C++ before you build and install Arrow GLib. See Arrow C++ document about how to install Arrow C++.

You can build and install Arrow GLib after you install Arrow C++:

% cd c_glib
% ./configure
% make
% sudo make install

How to build by developers

You need to install Arrow C++ before you install Arrow GLib. See Arrow C++ document about how to install Arrow C++.

You need GTK-Doc and GObject Introspection to build Arrow GLib. You can install them by the followings:

On Debian GNU/Linux or Ubuntu:

% sudo apt install -y -V gtk-doc-tools autoconf-archive libgirepository1.0-dev

On CentOS 7 or later:

% sudo yum install -y gtk-doc gobject-introspection-devel

On macOS with Homebrew:

% brew install -y gtk-doc gobject-introspection

Now, you can build Arrow GLib:

% cd c_glib
% ./autogen.sh
% ./configure --enable-gtk-doc
% make
% sudo make install

Usage

You can use Arrow GLib with C or other languages. If you use Arrow GLib with C, you use C API. If you use Arrow GLib with other languages, you use GObject Introspection based bindings.

C

You can find API reference in the /usr/local/share/gtk-doc/html/arrow-glib/ directory. If you specify --prefix to configure, the directory will be different.

You can find example codes in the example/ directory.

Language bindings

You can use Arrow GLib with non C languages with GObject Introspection based bindings. Here are languages that support GObject Introspection:

See also Projects/GObjectIntrospection/Users - GNOME Wiki! for other languages.