Skip to content

Commit b49ef14

Browse files
committed
[BUILD] Preparing for the next release.
1 parent bdfc5b0 commit b49ef14

File tree

8 files changed

+49
-65
lines changed

8 files changed

+49
-65
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,13 @@ On Ubuntu 18.04 you may get some linking errors, in which case you should use:
219219
bazel build --config=opt --cxxopt=-D_GLIBCXX_USE_CXX11_ABI=0 --noincompatible_do_not_split_linking_cmdline //tensorflow:libtensorflow.so
220220
```
221221

222+
On Windows you may get some CUDA-related errors, in which case you should use:
223+
224+
```cmd
225+
bazel build --config=opt --cxxopt=-D_GLIBCXX_USE_CXX11_ABI=0 --define=no_tensorflow_py_deps=true --copt=-DTHRUST_IGNORE_CUB_VERSION_CHECK --copt=-nvcc_options=disable-warnings //tensorflow:tensorflow.lib
226+
bazel build --config=opt --cxxopt=-D_GLIBCXX_USE_CXX11_ABI=0 --define=no_tensorflow_py_deps=true --copt=-DTHRUST_IGNORE_CUB_VERSION_CHECK --copt=-nvcc_options=disable-warnings //tensorflow:tensorflow_framework.lib
227+
```
228+
222229
To publish the documentation website we use the following commands:
223230

224231
```bash

RELEASE.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
# 0.5.6
2+
3+
Switched to using TensorFlow 2.3.1 that fixes multiple
4+
security vulnerabilities of TensorFlow 2.3.0. Also:
5+
6+
- Fixed a minor bug related to optimizers.
7+
- Switched to supporting three native platforms:
8+
`linux`, `windows`, and `darwin`, where the last one
9+
does not include GPU support.
10+
111
# 0.5.5
212

313
Fix for 0.5.4 that includes pre-compiled binaries for

build.sbt

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ fork in ThisBuild := true
2626
autoCompilerPlugins in ThisBuild := true
2727
nativeCrossCompilationEnabled in ThisBuild := false
2828

29-
val tensorFlowVersion = "2.3.0"
29+
val tensorFlowVersion = "2.3.1"
3030
val circeVersion = "0.12.3" // Used for working with JSON.
3131

3232
scalacOptions in ThisBuild ++= Seq(
@@ -168,13 +168,7 @@ lazy val jni = (project in file("./modules/jni"))
168168
sourceDirectory in nativeCompile := sourceDirectory.value / "main" / "native",
169169
target in nativeCompile := target.value / "native" / nativePlatform.value,
170170
target in JniCross := target.value / "native",
171-
nativePlatforms in JniCross := Set(
172-
LINUX_x86_64,
173-
LINUX_GPU_x86_64,
174-
WINDOWS_x86_64,
175-
WINDOWS_GPU_x86_64,
176-
DARWIN_x86_64,
177-
),
171+
nativePlatforms in JniCross := Set(LINUX, WINDOWS, DARWIN),
178172
tfBinaryVersion in JniCross := tensorFlowVersion,
179173
// Specify the order in which the different compilation tasks are executed.
180174
nativeCompile := nativeCompile.dependsOn(generateTensorOps).value)

docs/src/main/paradox/installation.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ for Scala, you should add the following dependency:
1717
@@ dependency[sbt,Maven,Gradle] {
1818
group="org.platanios"
1919
artifact="tensorflow_2.13"
20-
version="0.4.1"
20+
version="0.5.6"
2121
}
2222

2323
@@@ note
@@ -52,16 +52,15 @@ Add the following dependency, instead of the previous one:
5252
@@ dependency[sbt,Maven,Gradle] {
5353
group="org.platanios"
5454
artifact="tensorflow_2.13"
55-
version="0.4.1"
56-
classifier="linux-cpu-x86_64"
55+
version="0.5.6"
56+
classifier="linux"
5757
}
5858

5959
@@@ warning { title='Operating System' }
6060

61-
Make sure to replace `linux-cpu-x86_64` with the string
62-
that corresponds to your platform.* Currently supported
63-
platforms are: `linux-cpu-x86_64`, `linux-gpu-x86_64`, and
64-
`darwin-cpu-x86_64`.
61+
Make sure to replace `linux` with the string that corresponds
62+
to your platform.* Currently supported platforms are: `linux`,
63+
`windows`, and `darwin`.
6564

6665
@@@
6766

modules/jni/src/main/native/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED on)
77
project(tensorflow)
88
set(PROJECT_VERSION_MAJOR 0)
99
set(PROJECT_VERSION_MINOR 5)
10-
set(PROJECT_VERSION_PATCH 1)
10+
set(PROJECT_VERSION_PATCH 6)
1111

1212
add_definitions(-DNOMINMAX)
1313

@@ -29,7 +29,7 @@ include_directories(./ops)
2929
include_directories(${JNI_INCLUDE_DIRS})
3030

3131
# Find Native TensorFlow Library to link
32-
list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES .so.2.3.0 .so.2 .so .2.3.0.dylib .2.dylib .dylib .lib)
32+
list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES .so.2.3.1 .so.2 .so .2.3.1.dylib .2.dylib .dylib .lib)
3333
find_library(LIB_TENSORFLOW tensorflow HINTS ENV LD_LIBRARY_PATH)
3434
if(NOT LIB_TENSORFLOW)
3535
message(FATAL_ERROR "Library `tensorflow` not found.")

project/JniCrossPackage.scala

Lines changed: 11 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ object JniCrossPackage extends AutoPlugin {
5959
import JniNative.autoImport._
6060

6161
lazy val settings: Seq[Setting[_]] = Seq(
62-
nativePlatforms := Set(LINUX_x86_64, LINUX_GPU_x86_64, WINDOWS_x86_64, DARWIN_x86_64),
62+
nativePlatforms := Set(LINUX, WINDOWS, DARWIN),
6363
target := (target in Compile).value / "native",
6464
nativeLibPath := {
6565
val targetDir = (target in nativeCrossCompile).value
@@ -97,16 +97,16 @@ object JniCrossPackage extends AutoPlugin {
9797
log.info(s"Using '$baseDir' as the base directory.")
9898
val platformTargetDir = targetDir / platform.name
9999

100-
// TODO: Uncomment this once we properly sort out cross-compilation.
101100
// IO.createDirectory(platformTargetDir)
102101
// IO.createDirectory(platformTargetDir / "code")
103102
// IO.createDirectory(platformTargetDir / "docker")
104103
// IO.createDirectory(platformTargetDir / "lib")
105104
//
106105
// platform match {
106+
// // TODO: Figure out the right cross-compilation story.
107107
// // For Windows, we expect the binaries to have already been built and placed in the `bin` and the `lib`
108108
// // subdirectories, because we currently have no way to cross-compile.
109-
// case WINDOWS_x86_64 | WINDOWS_GPU_x86_64 =>
109+
// case WINDOWS =>
110110
// if (!(platformTargetDir / "bin").exists()) {
111111
// throw new IllegalStateException("The Windows binaries must have already been prebuilt.")
112112
// }
@@ -119,7 +119,8 @@ object JniCrossPackage extends AutoPlugin {
119119
// dockerContainer = dockerContainer,
120120
// srcDir = (baseDirectory.value / "src" / "main" / "native").getPath,
121121
// tgtDir = platformTargetDir.getPath,
122-
// libPath = nativeLibPath.value(platform).getPath).map(_ ! log)
122+
// libPath = nativeLibPath.value(platform).getPath,
123+
// ).map(_ ! log)
123124
//
124125
// // Clean up.
125126
// log.info("Cleaning up after build.")
@@ -206,7 +207,6 @@ object JniCrossPackage extends AutoPlugin {
206207

207208
sealed trait Platform {
208209
val name : String
209-
val tag : String
210210
val dockerImage : String = ""
211211
val cMakePath : String = "/usr/bin"
212212
val cMakeLibPath: String = "/usr/lib"
@@ -253,31 +253,17 @@ object JniCrossPackage extends AutoPlugin {
253253
override def toString: String = name
254254
}
255255

256-
object LINUX_x86_64 extends Platform {
257-
override val name : String = "linux-x86_64"
258-
override val tag : String = "linux-cpu-x86_64"
256+
object LINUX extends Platform {
257+
override val name : String = "linux"
259258
override val dockerImage: String = "eaplatanios/tensorflow_scala:linux-cpu-x86_64-0.5.3"
260259
}
261260

262-
object LINUX_GPU_x86_64 extends Platform {
263-
override val name : String = "linux-gpu-x86_64"
264-
override val tag : String = "linux-gpu-x86_64"
265-
override val dockerImage: String = "eaplatanios/tensorflow_scala:linux-gpu-x86_64-0.5.3"
261+
object WINDOWS extends Platform {
262+
override val name: String = "windows"
266263
}
267264

268-
object WINDOWS_x86_64 extends Platform {
269-
override val name: String = "windows-x86_64"
270-
override val tag : String = "windows-cpu-x86_64"
271-
}
272-
273-
object WINDOWS_GPU_x86_64 extends Platform {
274-
override val name: String = "windows-gpu-x86_64"
275-
override val tag : String = "windows-gpu-x86_64"
276-
}
277-
278-
object DARWIN_x86_64 extends Platform {
279-
override val name: String = "darwin-x86_64"
280-
override val tag : String = "darwin-cpu-x86_64"
265+
object DARWIN extends Platform {
266+
override val name: String = "darwin"
281267

282268
override def build(
283269
dockerImage: String,

project/JniNative.scala

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,14 @@ import sbt.Keys._
2727
object JniNative extends AutoPlugin {
2828
override def requires: Plugins = plugins.JvmPlugin
2929

30-
private[this] val os = {
30+
private[this] val currentNativePlatform: String = {
3131
val name = System.getProperty("os.name").toLowerCase
3232
if (name.contains("linux")) "linux"
3333
else if (name.contains("os x") || name.contains("darwin")) "darwin"
3434
else if (name.contains("windows")) "windows"
3535
else name.replaceAll("\\s", "")
3636
}
3737

38-
private[this] val architecture = {
39-
val arch = System.getProperty("os.arch").toLowerCase
40-
if (arch == "amd64") "x86_64"
41-
else arch
42-
}
43-
44-
private[this] val currentNativePlatform: String = s"$os-$architecture"
45-
4638
object autoImport {
4739
val nativeCompile: TaskKey[Seq[File]] =
4840
taskKey[Seq[File]]("Builds a native library by calling the native build tool.")

project/TensorFlowNativePackage.scala

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ object TensorFlowNativePackage extends AutoPlugin {
3636
import JniCrossPackage.autoImport._
3737

3838
lazy val settings: Seq[Setting[_]] = Seq(
39-
tfBinaryVersion := "2.3.0",
39+
tfBinaryVersion := "2.3.1",
4040
nativeArtifactName := "tensorflow",
4141
nativeLibPath := {
4242
val log = streams.value.log
@@ -66,32 +66,28 @@ object TensorFlowNativePackage extends AutoPlugin {
6666
val tfLibUrlPrefix: String = "https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow"
6767

6868
def tfLibFilename(platform: Platform): String = platform match {
69-
case LINUX_x86_64 | LINUX_GPU_x86_64 | DARWIN_x86_64 => "libtensorflow.tar.gz"
70-
case WINDOWS_x86_64 | WINDOWS_GPU_x86_64 => "libtensorflow.zip"
69+
case LINUX | DARWIN => "libtensorflow.tar.gz"
70+
case WINDOWS => "libtensorflow.zip"
7171
}
7272

7373
def tfLibExtractCommand(platform: Platform): String = platform match {
74-
case LINUX_x86_64 => s"tar xf /root/${tfLibFilename(platform)} -C /usr"
75-
case LINUX_GPU_x86_64 => s"tar xf /root/${tfLibFilename(platform)} -C /usr"
76-
case WINDOWS_x86_64 => ???
77-
case WINDOWS_GPU_x86_64 => ???
78-
case DARWIN_x86_64 => s"tar xf /root/${tfLibFilename(platform)} -C /usr"
74+
case LINUX => s"tar xf /root/${tfLibFilename(platform)} -C /usr"
75+
case WINDOWS => ???
76+
case DARWIN => s"tar xf /root/${tfLibFilename(platform)} -C /usr"
7977
}
8078

8179
def tfLibUrl(platform: Platform, version: String): String = (platform, version) match {
82-
case (LINUX_x86_64, v) => s"$tfLibUrlPrefix-cpu-linux-x86_64-$v.tar.gz"
83-
case (LINUX_GPU_x86_64, v) => s"$tfLibUrlPrefix-gpu-linux-x86_64-$v.tar.gz"
84-
case (WINDOWS_x86_64, v) => s"$tfLibUrlPrefix-cpu-windows-x86_64-$v.zip"
85-
case (WINDOWS_GPU_x86_64, v) => s"$tfLibUrlPrefix-gpu-windows-x86_64-$v.zip"
86-
case (DARWIN_x86_64, v) => s"$tfLibUrlPrefix-cpu-darwin-x86_64-$v.tar.gz"
80+
case (LINUX, v) => s"$tfLibUrlPrefix-cpu-linux-x86_64-$v.tar.gz"
81+
case (WINDOWS, v) => s"$tfLibUrlPrefix-cpu-windows-x86_64-$v.zip"
82+
case (DARWIN, v) => s"$tfLibUrlPrefix-cpu-darwin-x86_64-$v.tar.gz"
8783
}
8884

8985
def downloadAndExtractLibrary(platform: Platform, targetDir: String, tfVersion: String): Option[ProcessBuilder] = {
9086
// TODO: Setup cross-compilation environments (maybe using CircleCI).
9187
None
9288
// val path = s"$targetDir/downloads/${tfLibFilename(platform)}"
9389
// platform match {
94-
// case WINDOWS_x86_64 | WINDOWS_GPU_x86_64 =>
90+
// case WINDOWS =>
9591
// if (Files.notExists(Paths.get(targetDir).resolve("lib"))) {
9692
// throw new IllegalStateException("The Windows TensorFlow library must have already been downloaded manually.")
9793
// }

0 commit comments

Comments
 (0)