forked from kscience/kmath
fixed initial tests
This commit is contained in:
parent
93768ed2a7
commit
a33af9ec94
@ -29,16 +29,14 @@ val cudaDefault = file("/usr/local/cuda").exists()
|
|||||||
val cudaFound = cudaHome?.isNotEmpty() ?: false or cudaDefault
|
val cudaFound = cudaHome?.isNotEmpty() ?: false or cudaDefault
|
||||||
|
|
||||||
val cmakeArchive = "cmake-3.20.5-linux-x86_64"
|
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 torchArchive = "libtorch"
|
||||||
|
|
||||||
val cmakeCmd = "$thirdPartyDir/cmake/$cmakeArchive/bin/cmake"
|
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 ninjaCmd = "$thirdPartyDir/ninja/ninja"
|
||||||
|
|
||||||
val generateJNIHeader by tasks.registering {
|
val generateJNIHeader by tasks.registering {
|
||||||
|
println("Path:")
|
||||||
|
println(System.getProperty("java.library.path"))
|
||||||
doLast {
|
doLast {
|
||||||
exec {
|
exec {
|
||||||
workingDir(projectDir.resolve("src/main/java/space/kscience/kmath/noa"))
|
workingDir(projectDir.resolve("src/main/java/space/kscience/kmath/noa"))
|
||||||
@ -57,12 +55,6 @@ val downloadCMake by tasks.registering(Download::class) {
|
|||||||
overwrite(false)
|
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) {
|
val downloadNinja by tasks.registering(Download::class) {
|
||||||
src("https://github.com/ninja-build/ninja/releases/download/v1.10.2/ninja-linux.zip")
|
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")
|
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) {
|
val extractNinja by tasks.registering(Copy::class) {
|
||||||
dependsOn(downloadNinja)
|
dependsOn(downloadNinja)
|
||||||
from(zipTree(downloadNinja.get().dest))
|
from(zipTree(downloadNinja.get().dest))
|
||||||
@ -128,7 +109,6 @@ val extractJNoa by tasks.registering(Copy::class) {
|
|||||||
|
|
||||||
val configureCpp by tasks.registering {
|
val configureCpp by tasks.registering {
|
||||||
dependsOn(extractCMake)
|
dependsOn(extractCMake)
|
||||||
dependsOn(extractClang)
|
|
||||||
dependsOn(extractNinja)
|
dependsOn(extractNinja)
|
||||||
dependsOn(extractTorch)
|
dependsOn(extractTorch)
|
||||||
dependsOn(extractJNoa)
|
dependsOn(extractJNoa)
|
||||||
@ -144,8 +124,6 @@ val configureCpp by tasks.registering {
|
|||||||
cmakeCmd,
|
cmakeCmd,
|
||||||
jNoaDir,
|
jNoaDir,
|
||||||
"-GNinja",
|
"-GNinja",
|
||||||
"-DCMAKE_C_COMPILER=$clangCmd",
|
|
||||||
"-DCMAKE_CXX_COMPILER=$clangxxCmd",
|
|
||||||
"-DCMAKE_MAKE_PROGRAM=$ninjaCmd",
|
"-DCMAKE_MAKE_PROGRAM=$ninjaCmd",
|
||||||
"-DCMAKE_PREFIX_PATH=$thirdPartyDir/torch/$torchArchive",
|
"-DCMAKE_PREFIX_PATH=$thirdPartyDir/torch/$torchArchive",
|
||||||
"-DJAVA_HOME=$javaHome",
|
"-DJAVA_HOME=$javaHome",
|
||||||
@ -180,14 +158,14 @@ val buildCpp by tasks.registering {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//tasks["compileJava"].dependsOn(buildCpp)
|
tasks["compileJava"].dependsOn(buildCpp)
|
||||||
/*
|
|
||||||
tasks {
|
tasks {
|
||||||
withType<Test>{
|
withType<Test>{
|
||||||
systemProperty("java.library.path", "$home/devspace/noa/cmake-build-release/kmath")
|
systemProperty("java.library.path", "$home/devspace/noa/cmake-build-release/kmath")
|
||||||
// "$cppBuildDir/kmath")
|
//"$cppBuildDir/kmath")
|
||||||
}
|
}
|
||||||
}*/
|
}
|
||||||
|
|
||||||
readme {
|
readme {
|
||||||
maturity = ru.mipt.npm.gradle.Maturity.PROTOTYPE
|
maturity = ru.mipt.npm.gradle.Maturity.PROTOTYPE
|
||||||
|
@ -15,7 +15,7 @@ class JNoa {
|
|||||||
"Failed to load the native library NOA:\n" +
|
"Failed to load the native library NOA:\n" +
|
||||||
" - Follow the installation instructions from\n" +
|
" - Follow the installation instructions from\n" +
|
||||||
" https://github.com/grinisrit/noa \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);
|
System.exit(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user