Skip to content

Commit

Permalink
ARROW-17418: [Doc][Java] Dataset library able to compile with mvn com…
Browse files Browse the repository at this point in the history
…mand (#13889)

Dataset/ORC/Gandiva library (.so / .dylib) able to compile with mvn command

$ mvn clean generate-resources -Pgenerate-jnicpp-dylib_so -DARROW_DATASET=ON -DARROW_ORC=ON -DARROW_GANDIVA=ON -N

Authored-by: david dali susanibar arce <davi.sarces@gmail.com>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
  • Loading branch information
davisusanibar committed Sep 14, 2022
1 parent f57e1ba commit f4e79b1
Show file tree
Hide file tree
Showing 2 changed files with 214 additions and 4 deletions.
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>

0 comments on commit f4e79b1

Please sign in to comment.