Skip to content

Commit

Permalink
build: build CTensorFlow with SPM (tensorflow#1150)
Browse files Browse the repository at this point in the history
* build: build `CTensorFlow` with SPM

The `CTensorFlow` module provides the C bindings for X10 and is required
for building with X10 and SPM.

* Update Dockerfile

Disable swift-models release mode build pending a fix for building Swift Numerics in release mode.

* Update Dockerfile

Remove the TensorFlow modulemap.
  • Loading branch information
compnerd authored Dec 18, 2020
1 parent a0a6706 commit 1a7f355
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ RUN git clone https://github.com/deepmind/open_spiel.git
WORKDIR /swift-models

RUN /swift-tensorflow-toolchain/usr/bin/swift build
RUN /swift-tensorflow-toolchain/usr/bin/swift build -c release
# Swift Numerics in release mode does not currently build, which prevents the use of swift-models
# RUN /swift-tensorflow-toolchain/usr/bin/swift build -c release

WORKDIR /fastai_dev/swift/FastaiNotebook_11_imagenette

Expand All @@ -99,4 +100,5 @@ RUN rm -f /swift-tensorflow-toolchain/usr/lib/swift/linux/libswiftTensorFlow.so
RUN python3 Utilities/benchmark_compile.py /swift-tensorflow-toolchain/usr/bin/swift benchmark_results.xml

# Run SwiftPM tests
RUN /swift-tensorflow-toolchain/usr/bin/swift test
RUN rm -f /swift-tensorflow-toolchain/usr/lib/swift/tensorflow/module.modulemap
RUN /swift-tensorflow-toolchain/usr/bin/swift test -Xcc -I/swift-tensorflow-toolchain/usr/lib/swift -Xlinker -L/swift-tensorflow-toolchain/usr/lib/swift/linux
4 changes: 4 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,15 @@ let package = Package(
.target(
name: "Tensor",
dependencies: []),
.target(
name: "CTensorFlow",
dependencies: []),
.target(
name: "TensorFlow",
dependencies: [
"Tensor",
"PythonKit",
"CTensorFlow",
.product(name: "Numerics", package: "swift-numerics"),
]),
.target(
Expand Down

0 comments on commit 1a7f355

Please sign in to comment.