Skip to content
This repository was archived by the owner on Jul 1, 2023. It is now read-only.

Commit 1a7f355

Browse files
authored
build: build CTensorFlow with SPM (#1150)
* 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.
1 parent a0a6706 commit 1a7f355

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ RUN git clone https://github.com/deepmind/open_spiel.git
7777
WORKDIR /swift-models
7878

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

8283
WORKDIR /fastai_dev/swift/FastaiNotebook_11_imagenette
8384

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

101102
# Run SwiftPM tests
102-
RUN /swift-tensorflow-toolchain/usr/bin/swift test
103+
RUN rm -f /swift-tensorflow-toolchain/usr/lib/swift/tensorflow/module.modulemap
104+
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

Package.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,15 @@ let package = Package(
4040
.target(
4141
name: "Tensor",
4242
dependencies: []),
43+
.target(
44+
name: "CTensorFlow",
45+
dependencies: []),
4346
.target(
4447
name: "TensorFlow",
4548
dependencies: [
4649
"Tensor",
4750
"PythonKit",
51+
"CTensorFlow",
4852
.product(name: "Numerics", package: "swift-numerics"),
4953
]),
5054
.target(

0 commit comments

Comments
 (0)