Skip to content

Commit

Permalink
add a task for running the service while cooking the java.library.pat…
Browse files Browse the repository at this point in the history
…h, remove useless stuff for macOs, remove the jep library in grobid-home
  • Loading branch information
lfoppiano committed Jun 2, 2022
1 parent 4757b0b commit 47cf1a1
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
18 changes: 18 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -389,8 +389,26 @@ project(":grobid-service") {
}
}
}

task("run-server", dependsOn: 'classes', type: JavaExec, group: 'application') {
main = 'org.grobid.service.main.GrobidServiceApplication'
classpath = sourceSets.main.runtimeClasspath
workingDir = ".."
args 'server', 'grobid-home/config/grobid.yaml'
jvmArgs '-Xmx3072m'
// conda_env_path = "$System.env.CONDA_PREFIX"
systemProperty "java.library.path","${System.getProperty('java.library.path')}:" +
"${file("../grobid-home/lib/lin-64/jep").absolutePath}:" +
"${file("../grobid-home/lib/lin-64").absolutePath}:" +
"${file("../grobid-home/lib/mac-64").absolutePath}:" +
"${System.env.CONDA_PREFIX}/lib:" +
"${System.env.CONDA_PREFIX}/lib/python3.8/site-packages/jep"
}
}

// /Users/lfoppiano/opt/anaconda3/envs/jep/lib/python3.8/site-packages/jep
// /Users/lfoppiano/opt/anaconda3/envs/jep/lib

project(":grobid-trainer") {
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'jacoco'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ public boolean accept(File dir, String name) {
// loading here will not help)
try {
//addLibraryPath(libraryFolder.getAbsolutePath() + File.separator + DELFT_NATIVE_LIB_NAME);
// System.out.println(System.getProperty("java.library.path"));

PythonEnvironmentConfig pythonEnvironmentConfig = PythonEnvironmentConfig.getInstance();
if (pythonEnvironmentConfig.isEmpty()) {
Expand All @@ -166,7 +167,7 @@ public boolean accept(File dir, String name) {

if (SystemUtils.IS_OS_MAC) {
// System.setProperty("java.library.path", System.getProperty("java.library.path") + ":" + libraryFolder.getAbsolutePath());
System.loadLibrary("python" + pythonEnvironmentConfig.getPythonVersion() + "m");
System.loadLibrary("python" + pythonEnvironmentConfig.getPythonVersion());
System.loadLibrary(DELFT_NATIVE_LIB_NAME);
} else if (SystemUtils.IS_OS_LINUX) {
System.loadLibrary(DELFT_NATIVE_LIB_NAME);
Expand Down
Binary file removed grobid-home/lib/mac-64/libjep.dylib
Binary file not shown.

0 comments on commit 47cf1a1

Please sign in to comment.