Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 23 additions & 4 deletions docs/source/developers/java/building.rst
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ for that architecture. See, for example, the `Azul JDK <https://www.azul.com/dow
Maven
~~~~~

- To build only the C Data Interface library:
- To build only the JNI C Data Interface library:

.. code-block::

Expand All @@ -111,9 +111,28 @@ Maven
$ ls -latr ../java-dist/lib
|__ libarrow_cdata_jni.dylib

- To build other JNI libraries:
- To build JNI ORC & JNI Gandiva libraries:

.. code-block::

$ cd arrow/java
$ export JAVA_HOME=<absolute path to your java home>
$ java --version
$ mvn clean generate-resources -Pgenerate-jnicpp-dylib_so -N
$ ls -latr java-dist/lib
|__ libarrow_orc_jni.dylib
|__ libgandiva_jni.dylib

- To build only the JNI Dataset library:

Not options available on Maven.
.. code-block::

$ cd arrow/java
$ export JAVA_HOME=<absolute path to your java home>
$ java --version
$ mvn clean generate-resources -Pgenerate-dataset-dylib_so -N
$ ls -latr java-dist/lib
|__ libarrow_dataset_jni.dylib

CMake
~~~~~
Expand Down Expand Up @@ -175,7 +194,7 @@ CMake
|__ libarrow_orc_jni.dylib
|__ libgandiva_jni.dylib

- To build only the Dataset library:
- To build only the JNI Dataset library:

.. code-block::

Expand Down
191 changes: 191 additions & 0 deletions java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -969,6 +969,197 @@
</build>
</profile>

<profile>
<id>generate-dataset-dylib_so</id>
<properties>
<arrow.dataset.jni.dist.dir>java-dist/lib</arrow.dataset.jni.dist.dir>
<cpp.dependencies.builded>false</cpp.dependencies.builded>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<id>datasetdir</id>
<phase>generate-resources</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>mkdir</executable>
<commandlineArgs>-p cpp-jni java-dist java-jni</commandlineArgs>
<workingDirectory>../</workingDirectory>
</configuration>
</execution>
<execution>
<id>datasetarrowdependency</id>
<phase>generate-resources</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>cmake</executable>
<commandlineArgs>
-S cpp
-B cpp-jni
-DARROW_CSV=ON
-DARROW_DATASET=ON
-DARROW_DEPENDENCY_SOURCE=BUNDLED
-DARROW_DEPENDENCY_USE_SHARED=OFF
-DARROW_FILESYSTEM=ON
-DARROW_GANDIVA=ON
-DARROW_GANDIVA_JAVA=ON
-DARROW_GANDIVA_STATIC_LIBSTDCPP=ON
-DARROW_JNI=ON
-DARROW_ORC=ON
-DARROW_PARQUET=ON
-DARROW_PLASMA=ON
-DARROW_PLASMA_JAVA_CLIENT=ON
-DARROW_S3=ON
-DARROW_USE_CCACHE=ON
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_INSTALL_LIBDIR=lib
-DCMAKE_INSTALL_PREFIX=java-dist
-DCMAKE_UNITY_BUILD=ON
</commandlineArgs>
<workingDirectory>../</workingDirectory>
<skip>${cpp.dependencies.builded}</skip>
</configuration>
</execution>
<execution>
<id>datasetarrowdependencybuild</id>
<phase>generate-resources</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>cmake</executable>
<commandlineArgs>
--build cpp-jni --target install --config Release
</commandlineArgs>
<workingDirectory>../</workingDirectory>
<skip>${cpp.dependencies.builded}</skip>
</configuration>
</execution>
<execution>
<id>datasetdefine</id>
<phase>generate-resources</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>cmake</executable>
<commandlineArgs>
-S java
-B java-jni
-DARROW_JAVA_JNI_ENABLE_DATASET=ON
-DARROW_JAVA_JNI_ENABLE_DEFAULT=OFF
-DBUILD_TESTING=OFF
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_INSTALL_PREFIX=${arrow.c.jni.dist.dir}
-DCMAKE_PREFIX_PATH=${project.basedir}/../java-dist
</commandlineArgs>
<workingDirectory>../</workingDirectory>
</configuration>
</execution>
<execution>
<id>datasetbuild</id>
<phase>generate-resources</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>cmake</executable>
<commandlineArgs>
--build java-jni --target install --config Release
</commandlineArgs>
<workingDirectory>../</workingDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>

<profile>
<id>generate-jnicpp-dylib_so</id>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<id>jnidir</id>
<phase>generate-resources</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>mkdir</executable>
<commandlineArgs>-p java-dist cpp-jni</commandlineArgs>
<workingDirectory>../</workingDirectory>
</configuration>
</execution>
<execution>
<id>jnidefine</id>
<phase>generate-resources</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>cmake</executable>
<commandlineArgs>
-S cpp
-B cpp-jni
-DARROW_CSV=ON
-DARROW_DATASET=ON
-DARROW_DEPENDENCY_SOURCE=BUNDLED
-DARROW_DEPENDENCY_USE_SHARED=OFF
-DARROW_FILESYSTEM=ON
-DARROW_GANDIVA=ON
-DARROW_GANDIVA_JAVA=ON
-DARROW_GANDIVA_STATIC_LIBSTDCPP=ON
-DARROW_JNI=ON
-DARROW_ORC=ON
-DARROW_PARQUET=ON
-DARROW_PLASMA=ON
-DARROW_PLASMA_JAVA_CLIENT=ON
-DARROW_S3=ON
-DARROW_USE_CCACHE=ON
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_INSTALL_LIBDIR=lib
-DCMAKE_INSTALL_PREFIX=java-dist
-DCMAKE_UNITY_BUILD=ON
</commandlineArgs>
<workingDirectory>../</workingDirectory>
</configuration>
</execution>
<execution>
<id>jnidefinebuild</id>
<phase>generate-resources</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>cmake</executable>
<commandlineArgs>
--build cpp-jni --target install --config Release
</commandlineArgs>
<workingDirectory>../</workingDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>

</profiles>

</project>