Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copy Java native dependencies directly into classpath #9787

Merged
merged 1 commit into from
Nov 30, 2021
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
7 changes: 2 additions & 5 deletions java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -297,9 +297,6 @@
<include>LICENSE</include>
</includes>
</resource>
<resource>
<directory>${project.build.directory}/native-deps/</directory>
</resource>
</resources>
<pluginManagement>
<plugins>
Expand Down Expand Up @@ -499,14 +496,14 @@
<executions>
<execution>
<id>copy-native-libs</id>
<phase>validate</phase>
<phase>generate-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<overwrite>true</overwrite>
<skip>${skipNativeCopy}</skip>
<outputDirectory>${project.build.directory}/native-deps/${os.arch}/${os.name}</outputDirectory>
<outputDirectory>${project.build.outputDirectory}/${os.arch}/${os.name}</outputDirectory>
<resources>
<resource>
<directory>${native.build.path}</directory>
Expand Down
11 changes: 2 additions & 9 deletions java/src/main/java/ai/rapids/cudf/NativeDepsLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,7 @@ public static synchronized void loadNativeDeps() {

/**
* Allows other libraries to reuse the same native deps loading logic. Libraries will be searched
* for under ${os.arch}/${os.name}/ in the class path using the class loader for this class. It
* will also look for the libraries under ./target/native-deps/${os.arch}/${os.name} to help
* facilitate testing while building.
* for under ${os.arch}/${os.name}/ in the class path using the class loader for this class.
* <br/>
* Because this just loads the libraries and loading the libraries themselves needs to be a
* singleton operation it is recommended that any library using this provide their own wrapper
Expand Down Expand Up @@ -203,12 +201,7 @@ private static File createFile(String os, String arch, String baseName) throws I
File loc;
URL resource = loader.getResource(path);
if (resource == null) {
// It looks like we are not running from the jar, or there are issues with the jar
File f = new File("./target/native-deps/" + path);
if (!f.exists()) {
throw new FileNotFoundException("Could not locate native dependency " + path);
}
resource = f.toURI().toURL();
throw new FileNotFoundException("Could not locate native dependency " + path);
}
try (InputStream in = resource.openStream()) {
loc = File.createTempFile(baseName, ".so");
Expand Down