This directory contains the code and build system for the GraphAr Java library which powered by Alibaba-FastFFI.
- JDK 8 or higher
- Maven3+
- CMake 3.5 or higher
- LLVM 11
Only support installing from source currently, but we will support installing from Maven in the future.
Firstly, install llvm-11. LLVM11_HOME
should point to the home of LLVM 11. In Ubuntu, it is at /usr/lib/llvm-11
. Basically, the build procedure the following binary:
$LLVM11_HOME/bin/clang++
$LLVM11_HOME/bin/ld.lld
$LLVM11_HOME/lib/cmake/llvm
Tips:
-
Use Ubuntu as example:
$ sudo apt-get install llvm-11 clang-11 lld-11 libclang-11-dev libz-dev -y $ export LLVM11_HOME=/usr/lib/llvm-11
-
Or compile from source with this script:
$ export LLVM11_HOME=/usr/lib/llvm-11 $ export LLVM_VAR=11.0.0 $ sudo ./install-llvm11.sh
Make the graphar-java-library directory as the current working directory:
$ git clone https://github.com/apache/incubator-graphar.git
$ cd incubator-graphar
$ git submodule update --init
$ cd maven-projects/java
Compile package:
$ mvn clean install -DskipTests
This will build GraphAr C++ library internally for Java. If you already installed GraphAr C++ library in your system,
you can append this option to skip: -DbuildGarCPP=OFF
Then set GraphAr as a dependency in maven project:
<dependencies>
<dependency>
<groupId>org.apache.graphar</groupId>
<artifactId>java</artifactId>
<version>0.1.0</version>
</dependency>
</dependencies>
Building the API document with maven:
mvn javadoc:javadoc
The API document will be generated in the target/site/apidocs
directory.
Please refer to GraphAr Java Library Documentation.