From a33af9ec94c43ba9a0d530a8523bc7d14ffcaaa3 Mon Sep 17 00:00:00 2001 From: Roland Grinis Date: Tue, 13 Jul 2021 12:19:03 +0100 Subject: [PATCH] fixed initial tests --- kmath-noa/build.gradle.kts | 34 ++++--------------- .../java/space/kscience/kmath/noa/JNoa.java | 2 +- 2 files changed, 7 insertions(+), 29 deletions(-) diff --git a/kmath-noa/build.gradle.kts b/kmath-noa/build.gradle.kts index c13592914..7fd8b95c8 100644 --- a/kmath-noa/build.gradle.kts +++ b/kmath-noa/build.gradle.kts @@ -29,16 +29,14 @@ val cudaDefault = file("/usr/local/cuda").exists() val cudaFound = cudaHome?.isNotEmpty() ?: false or cudaDefault val cmakeArchive = "cmake-3.20.5-linux-x86_64" -val clangArchive = "clang+llvm-12.0.0-x86_64-linux-gnu-ubuntu-16.04" val torchArchive = "libtorch" val cmakeCmd = "$thirdPartyDir/cmake/$cmakeArchive/bin/cmake" -val clangRootDir = "$thirdPartyDir/clang/$clangArchive" -val clangCmd = "$clangRootDir/bin/clang" -val clangxxCmd = "$clangRootDir/bin/clang++" val ninjaCmd = "$thirdPartyDir/ninja/ninja" val generateJNIHeader by tasks.registering { + println("Path:") + println(System.getProperty("java.library.path")) doLast { exec { workingDir(projectDir.resolve("src/main/java/space/kscience/kmath/noa")) @@ -57,12 +55,6 @@ val downloadCMake by tasks.registering(Download::class) { overwrite(false) } -val downloadClang by tasks.registering(Download::class) { - val tarFile = "$clangArchive.tar.xz" - src("https://github.com/llvm/llvm-project/releases/download/llvmorg-12.0.0/$tarFile") - dest(File("$thirdPartyDir/clang", tarFile)) - overwrite(false) -} val downloadNinja by tasks.registering(Download::class) { src("https://github.com/ninja-build/ninja/releases/download/v1.10.2/ninja-linux.zip") @@ -97,17 +89,6 @@ val extractCMake by tasks.registering(Copy::class) { into("$thirdPartyDir/cmake") } -val extractClang by tasks.registering { - dependsOn(downloadClang) - onlyIf { !file(clangRootDir).exists() } - doLast { - exec { - workingDir("$thirdPartyDir/clang") - commandLine("tar", "-xf", "$clangArchive.tar.xz") - } - } -} - val extractNinja by tasks.registering(Copy::class) { dependsOn(downloadNinja) from(zipTree(downloadNinja.get().dest)) @@ -128,7 +109,6 @@ val extractJNoa by tasks.registering(Copy::class) { val configureCpp by tasks.registering { dependsOn(extractCMake) - dependsOn(extractClang) dependsOn(extractNinja) dependsOn(extractTorch) dependsOn(extractJNoa) @@ -144,8 +124,6 @@ val configureCpp by tasks.registering { cmakeCmd, jNoaDir, "-GNinja", - "-DCMAKE_C_COMPILER=$clangCmd", - "-DCMAKE_CXX_COMPILER=$clangxxCmd", "-DCMAKE_MAKE_PROGRAM=$ninjaCmd", "-DCMAKE_PREFIX_PATH=$thirdPartyDir/torch/$torchArchive", "-DJAVA_HOME=$javaHome", @@ -180,14 +158,14 @@ val buildCpp by tasks.registering { } } -//tasks["compileJava"].dependsOn(buildCpp) -/* +tasks["compileJava"].dependsOn(buildCpp) + tasks { withType{ systemProperty("java.library.path", "$home/devspace/noa/cmake-build-release/kmath") - // "$cppBuildDir/kmath") + //"$cppBuildDir/kmath") } -}*/ +} readme { maturity = ru.mipt.npm.gradle.Maturity.PROTOTYPE diff --git a/kmath-noa/src/main/java/space/kscience/kmath/noa/JNoa.java b/kmath-noa/src/main/java/space/kscience/kmath/noa/JNoa.java index 957387867..17677c01f 100644 --- a/kmath-noa/src/main/java/space/kscience/kmath/noa/JNoa.java +++ b/kmath-noa/src/main/java/space/kscience/kmath/noa/JNoa.java @@ -15,7 +15,7 @@ class JNoa { "Failed to load the native library NOA:\n" + " - Follow the installation instructions from\n" + " https://github.com/grinisrit/noa \n" + - " - Set JAVA_LIBRARY_PATH to the location of libjnoa.so"); + " - Set java.library.path to the location of libjnoa.so"); System.exit(1); } }