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

Commit 234bc52

Browse files
compnerdtexasmichelle
andauthoredMay 27, 2020
docs: update CMake documentation to give more guidance (#859)
Update the documentation and indicate how to configure when developing X10 and when not developing X10. Co-authored-by: Michelle Casbon <michellecasbon@google.com> Co-authored-by: Michelle Casbon <texasmichelle@users.noreply.github.com>
1 parent 0f09ac9 commit 234bc52

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed
 

‎README.md

+15-2
Original file line numberDiff line numberDiff line change
@@ -118,16 +118,29 @@ will not allow the use of the `-B` option to specific the build tree and
118118
require that you are in the location of the build tree (and the `-B` option
119119
and its argument are elided).
120120

121+
To enable CUDA support, run `export TF_NEED_CUDA=1` before the steps below.
122+
121123
If `swiftc` is not in your `PATH`, you must specify the path to it using
122124
`-D CMAKE_Swift_COMPILER=`.
123125

124-
To enable CUDA support, run `export TF_NEED_CUDA=1` before the steps below.
126+
This will build X10 as part of the build. Ensure that you do not have the
127+
x10 modules in the toolchain that you are using to develop here.
125128

129+
```shell
130+
cmake -B out -D BUILD_X10=YES -G Ninja -S swift-apis
131+
cmake --build out
126132
```
127-
cmake -G Ninja -B out -S swift-apis
133+
134+
If you are not intending to develop X10, you can reduce the build times by
135+
using the bundled X10 in the toolchain using
136+
`-D USE_BUNDLED_X10=YES -D USE_BUNDLED_CTENSORFLOW=YES`:
137+
138+
```shell
139+
cmake -B out -D BUILD_X10=YES -D USE_BUNDLED_CTENSORFLOW=YES -D USE_BUNDLED_X10=YES -G Ninja -S swift-apis
128140
cmake --build out
129141
```
130142

143+
131144
## Bugs
132145

133146
Please report bugs and feature requests using GitHub issues in this repository.

‎cmake/modules/FindX10.cmake

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
if(DEFINED CMAKE_Swift_COMPILER)
33
get_filename_component(_Swift_TOOLCHAIN ${CMAKE_Swift_COMPILER} DIRECTORY)
44
get_filename_component(_Swift_TOOLCHAIN ${_Swift_TOOLCHAIN} DIRECTORY)
5-
file(TO_CMAKE_PATH ${_Swift_TOOLCHAIN}/usr/lib/swift _Swift_LIBDIR)
5+
get_filename_component(_Swift_TOOLCHAIN ${_Swift_TOOLCHAIN} DIRECTORY)
6+
string(TOLOWER ${CMAKE_SYSTEM_NAME} system_lc)
7+
file(TO_CMAKE_PATH ${_Swift_TOOLCHAIN}/usr/lib/swift/${system_lc} _Swift_LIBDIR)
68
endif()
79

810
find_library(X10_LIBRARY

0 commit comments

Comments
 (0)