35 lines
932 B
Groovy
35 lines
932 B
Groovy
apply plugin: 'konan'
|
|
|
|
konan.targets = ['macbook', 'linux']
|
|
|
|
def konanUserDir = System.getenv("KONAN_DATA_DIR") ?: "${System.getProperty("user.home")}/.konan"
|
|
def tensorflowHome = "$konanUserDir/third-party/tensorflow"
|
|
|
|
task downloadTensorflow(type: Exec) {
|
|
workingDir getProjectDir()
|
|
commandLine './downloadTensorflow.sh'
|
|
}
|
|
|
|
konanArtifacts {
|
|
interop('TensorflowInterop') {
|
|
defFile "src/main/c_interop/tensorflow.def"
|
|
includeDirs "${tensorflowHome}/include"
|
|
dependsOn 'downloadTensorflow'
|
|
}
|
|
|
|
program('Tensorflow') {
|
|
libraries {
|
|
artifact 'TensorflowInterop'
|
|
}
|
|
linkerOpts "-L${tensorflowHome}/lib -ltensorflow"
|
|
}
|
|
}
|
|
|
|
run.dependsOn 'warning'
|
|
|
|
task warning {
|
|
doLast {
|
|
println "Note: You may need to specify LD_LIBRARY_PATH or DYLD_LIBRARY_PATH env variables to $tensorflowHome/lib if the TensorFlow dynamic library cannot be found."
|
|
|
|
}
|
|
} |