tensorflow / swift

Swift for TensorFlow
https://tensorflow.org/swift
Apache License 2.0
6.12k stars 608 forks source link

error: failed to stop process at REPL breakpoint #20

Closed WongChen closed 6 years ago

WongChen commented 6 years ago

Xcode 9.2 and macOS 10.12.6.

$ export PATH=/Library/Developer/Toolchains/swift-latest/usr/bin:"${PATH}"
$ swift
error: failed to stop process at REPL breakpoint

In xcode playground, I got no output.

screen shot 2018-05-06 at 10 35 10
dan-zheng commented 6 years ago

Playgrounds are known to be somewhat unstable, unfortunately. Could you please try restarting Xcode, or creating a new Playground?

dan-zheng commented 6 years ago

Sorry, I didn't address error: failed to stop process at REPL breakpoint. Did you install a pre-built toolchain from this page? If so, which version?

WongChen commented 6 years ago

@dan-zheng Yes, I tried both April 26, 2018 and May 3, 2018, got the same error: failed to stop process at REPL breakpoint error.

dan-zheng commented 6 years ago

I see. Is that the full error log? Do you have any more information?

I just noticed that you're using Xcode 9.2 - it may be the case that Xcode 9.3 is required. I'm not quite sure, but upgrading to 9.3 may fix the issue.

WongChen commented 6 years ago

@dan-zheng thx for your reply. How to see the full error log?

when I add -v using tensorflow-swift and default-swift:

$ swift -v
Swift version 4.2-dev (LLVM 04bdb56f3d, Clang b44dbbdf44)
Target: x86_64-apple-darwin16.7.0
/Library/Developer/Toolchains/swift-tensorflow-DEVELOPMENT-2018-04-26-a.xctoolchain/usr/bin/lldb "--repl=-enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -color-diagnostics"
error: failed to stop process at REPL breakpoint

$ /usr/bin/swift -v
Apple Swift version 4.0.3 (swiftlang-900.0.74.1 clang-900.0.39.2)
Target: x86_64-apple-macosx10.9
/Applications/Xcode.app/Contents/Developer/usr/bin/lldb "--repl=-enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -color-diagnostics"
Welcome to Apple Swift version 4.0.3 (swiftlang-900.0.74.1 clang-900.0.39.2). Type :help for assistance.
  1>  

And Xcode 9.2 requires macOS 10.13, I will consider upgrading my system and Xcode.

WongChen commented 6 years ago

@dan-zheng thx for your reply. Maybe I'll just use the compiler and Xcode project. Later I'll move to Ubuntu.

dan-zheng commented 6 years ago

The REPL is error'ing at this line, I'm not sure why. 😕 I suspect upgrading to Xcode 9.3 will fix the error, since others haven't run into it. Sorry for not being more helpful!

tyoc213 commented 5 years ago

Well Im on ubuntu and I get the same output

$ swift -v
Swift version 5.0-dev (LLVM dcb9eb74a7, Clang 95cdf7c9af, Swift 434442b530)
Target: x86_64-unknown-linux-gnu
/home/tyoc213/binlocal/swift-tensorflow-RELEASE-0.2-cuda10.0-cudnn7-ubuntu18.04/usr/bin/lldb "--repl=-disable-objc-interop -color-diagnostics"
error: failed to stop process at REPL breakpoint

@WongChen @dan-zheng

dan-zheng commented 5 years ago

Hmm, interesting. cc @marcrasi who's more knowledgeable about Ubuntu toolchains

tyoc213 commented 5 years ago

I dont think it helps but just tried to build on ubuntu and got

- Build files have been written to: /home/tyoc213/swift-source/swift-source/build/Ninja-RelWithDebInfoAssert/swift-linux-x86_64
+ popd
~/swift-source/swift-source/swift
+ /usr/bin/cmake --build /home/tyoc213/swift-source/swift-source/build/Ninja-RelWithDebInfoAssert/swift-linux-x86_64 -- -j4 all swift-test-stdlib-linux-x86_64
[115/990] Generating IntegerTypes.swift from IntegerTypes.swift.gyb with ptr size = 8
FAILED: stdlib/public/core/8/IntegerTypes.swift 
cd /home/tyoc213/swift-source/swift-source/swift/stdlib/public/core && /usr/bin/cmake -E make_directory /home/tyoc213/swift-source/swift-source/build/Ninja-RelWithDebInfoAssert/swift-linux-x86_64/stdlib/public/core/8 && /home/tyoc213/anaconda3/bin/python /home/tyoc213/swift-source/swift-source/swift/utils/gyb -DunicodeGraphemeBreakPropertyFile=/home/tyoc213/swift-source/swift-source/swift/utils/UnicodeData/GraphemeBreakProperty.txt -DunicodeGraphemeBreakTestFile=/home/tyoc213/swift-source/swift-source/swift/utils/UnicodeData/GraphemeBreakTest.txt -DCMAKE_SIZEOF_VOID_P=8 -o /home/tyoc213/swift-source/swift-source/build/Ninja-RelWithDebInfoAssert/swift-linux-x86_64/stdlib/public/core/8/IntegerTypes.swift.tmp IntegerTypes.swift.gyb && /usr/bin/cmake -E copy_if_different /home/tyoc213/swift-source/swift-source/build/Ninja-RelWithDebInfoAssert/swift-linux-x86_64/stdlib/public/core/8/IntegerTypes.swift.tmp /home/tyoc213/swift-source/swift-source/build/Ninja-RelWithDebInfoAssert/swift-linux-x86_64/stdlib/public/core/8/IntegerTypes.swift && /usr/bin/cmake -E remove /home/tyoc213/swift-source/swift-source/build/Ninja-RelWithDebInfoAssert/swift-linux-x86_64/stdlib/public/core/8/IntegerTypes.swift.tmp
Traceback (most recent call last):
  File "/home/tyoc213/swift-source/swift-source/swift/utils/gyb", line 3, in <module>
    gyb.main()
  File "/home/tyoc213/swift-source/swift-source/swift/utils/gyb.py", line 1260, in main
    args.target.write(execute_template(ast, args.line_directive, **bindings))
  File "/home/tyoc213/swift-source/swift-source/swift/utils/gyb.py", line 1131, in execute_template
    ast.execute(execution_context)
  File "/home/tyoc213/swift-source/swift-source/swift/utils/gyb.py", line 635, in execute
    x.execute(context)
  File "/home/tyoc213/swift-source/swift-source/swift/utils/gyb.py", line 721, in execute
    result = eval(self.code, context.local_bindings)
  File "/home/tyoc213/swift-source/swift-source/swift/stdlib/public/core/IntegerTypes.swift.gyb", line 20, in <module>
    from string import maketrans, capitalize
ImportError: cannot import name 'maketrans' from 'string' (/home/tyoc213/anaconda3/lib/python3.7/string.py)
[118/990] Building CXX object stdlib/public/runtime/CMakeFiles/swiftRuntime-linux-x86_64.dir/__/__/__/lib/Demangling/Remangler.cpp.o
ninja: build stopped: subcommand failed.
utils/build-script: fatal error: command terminated with a non-zero exit status 1, aborting

On Python 3.7.0 (default, Oct 9 2018, 10:31:47) Needed to install bazel-0.24.1-installer-linux-x86_64 because the latest doesnt work.

marcrasi commented 5 years ago

@tyoc213, here are some things to check for the "failed to stop process at REPL breakpoint" error:

The build error is happening because the swift build requires python 2. You could create a python2 virtualenv or conda environment, and try the build in that.

tyoc213 commented 5 years ago

Yes, indeed and I have tryied to compile with those instructions.

My python installation is with conda the default environment is python 3, but I have setup conda activate old27 in .bashrc but after some time I get this error (which is a python 3 incompatibility as I know?)

$ utils/build-script --release-debuginfo
.
.
.
.
.
tensorflow/core/grappler/utils/functions.cc: In function 'tensorflow::Status tensorflow::grappler::RemoveFunctionOutputs(const absl::flat_hash_set<int>&, tensorflow::grappler::GrapplerFunctionItem*, std::vector<std::pair<int, int> >*)':
tensorflow/core/grappler/utils/functions.cc:745:44: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     if (remove_output < 0 || remove_output >= item->output_size()) {
                              ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
tensorflow/core/grappler/utils/functions.cc:757:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for (int i = 0; i < item->output_size(); ++i) {
                   ~~^~~~~~~~~~~~~~~~~~~~~
INFO: Elapsed time: 4378.084s, Critical Path: 155.04s
INFO: 6052 processes: 6052 local.
INFO: Build completed successfully, 6090 total actions
+ popd
~/swift-source/swift-source/swift
+ mkdir -p /home/tyoc213/swift-source/swift-source/build/Ninja-RelWithDebInfoAssert/swift-linux-x86_64/bin/../lib/swift/linux
+ /usr/bin/cmake --build /home/tyoc213/swift-source/swift-source/build/Ninja-RelWithDebInfoAssert/swift-linux-x86_64 -- -j4 all swift-test-stdlib-linux-x86_64
[1/865] Generating Tuple.swift from Tuple.swift.gyb with ptr size = 8
FAILED: stdlib/public/core/8/Tuple.swift 
cd /home/tyoc213/swift-source/swift-source/swift/stdlib/public/core && /usr/bin/cmake -E make_directory /home/tyoc213/swift-source/swift-source/build/Ninja-RelWithDebInfoAssert/swift-linux-x86_64/stdlib/public/core/8 && /home/tyoc213/anaconda3/bin/python /home/tyoc213/swift-source/swift-source/swift/utils/gyb -DunicodeGraphemeBreakPropertyFile=/home/tyoc213/swift-source/swift-source/swift/utils/UnicodeData/GraphemeBreakProperty.txt -DunicodeGraphemeBreakTestFile=/home/tyoc213/swift-source/swift-source/swift/utils/UnicodeData/GraphemeBreakTest.txt -DCMAKE_SIZEOF_VOID_P=8 -o /home/tyoc213/swift-source/swift-source/build/Ninja-RelWithDebInfoAssert/swift-linux-x86_64/stdlib/public/core/8/Tuple.swift.tmp Tuple.swift.gyb && /usr/bin/cmake -E copy_if_different /home/tyoc213/swift-source/swift-source/build/Ninja-RelWithDebInfoAssert/swift-linux-x86_64/stdlib/public/core/8/Tuple.swift.tmp /home/tyoc213/swift-source/swift-source/build/Ninja-RelWithDebInfoAssert/swift-linux-x86_64/stdlib/public/core/8/Tuple.swift && /usr/bin/cmake -E remove /home/tyoc213/swift-source/swift-source/build/Ninja-RelWithDebInfoAssert/swift-linux-x86_64/stdlib/public/core/8/Tuple.swift.tmp
Traceback (most recent call last):
  File "/home/tyoc213/swift-source/swift-source/swift/utils/gyb", line 3, in <module>
    gyb.main()
  File "/home/tyoc213/swift-source/swift-source/swift/utils/gyb.py", line 1260, in main
    args.target.write(execute_template(ast, args.line_directive, **bindings))
  File "/home/tyoc213/swift-source/swift-source/swift/utils/gyb.py", line 1131, in execute_template
    ast.execute(execution_context)
  File "/home/tyoc213/swift-source/swift-source/swift/utils/gyb.py", line 635, in execute
    x.execute(context)
  File "/home/tyoc213/swift-source/swift-source/swift/utils/gyb.py", line 721, in execute
    result = eval(self.code, context.local_bindings)
  File "/home/tyoc213/swift-source/swift-source/swift/stdlib/public/core/Tuple.swift.gyb", line 109, in <module>
    %   typeParams = [chr(ord("A") + i) for i in range(arity)]
  File "/home/tyoc213/swift-source/swift-source/swift/utils/gyb.py", line 635, in execute
    x.execute(context)
  File "/home/tyoc213/swift-source/swift-source/swift/utils/gyb.py", line 721, in execute
    result = eval(self.code, context.local_bindings)
  File "/home/tyoc213/swift-source/swift-source/swift/stdlib/public/core/Tuple.swift.gyb", line 114, in <module>
    %   greaterTuple = "(\"a\", {})".format(", ".join(map(str, range(1, arity - 1) + [arity])))
TypeError: unsupported operand type(s) for +: 'range' and 'list'
[2/865] Generating SyntaxKind.h from SyntaxKind.h.gyb with ptr size =
FAILED: include/swift/Syntax/SyntaxKind.h 
cd /home/tyoc213/swift-source/swift-source/swift/include/swift/Syntax && /usr/bin/cmake -E make_directory /home/tyoc213/swift-source/swift-source/build/Ninja-RelWithDebInfoAssert/swift-linux-x86_64/include/swift/Syntax && /home/tyoc213/anaconda3/bin/python /home/tyoc213/swift-source/swift-source/swift/utils/gyb --line-directive '#line %(line)d "%(file)s"' -o /home/tyoc213/swift-source/swift-source/build/Ninja-RelWithDebInfoAssert/swift-linux-x86_64/include/swift/Syntax/SyntaxKind.h.tmp SyntaxKind.h.gyb && /usr/bin/cmake -E copy_if_different /home/tyoc213/swift-source/swift-source/build/Ninja-RelWithDebInfoAssert/swift-linux-x86_64/include/swift/Syntax/SyntaxKind.h.tmp /home/tyoc213/swift-source/swift-source/build/Ninja-RelWithDebInfoAssert/swift-linux-x86_64/include/swift/Syntax/SyntaxKind.h && /usr/bin/cmake -E remove /home/tyoc213/swift-source/swift-source/build/Ninja-RelWithDebInfoAssert/swift-linux-x86_64/include/swift/Syntax/SyntaxKind.h.tmp
Traceback (most recent call last):
  File "/home/tyoc213/swift-source/swift-source/swift/utils/gyb", line 3, in <module>
    gyb.main()
  File "/home/tyoc213/swift-source/swift-source/swift/utils/gyb.py", line 1260, in main
    args.target.write(execute_template(ast, args.line_directive, **bindings))
  File "/home/tyoc213/swift-source/swift-source/swift/utils/gyb.py", line 1131, in execute_template
    ast.execute(execution_context)
  File "/home/tyoc213/swift-source/swift-source/swift/utils/gyb.py", line 635, in execute
    x.execute(context)
  File "/home/tyoc213/swift-source/swift-source/swift/utils/gyb.py", line 721, in execute
    result = eval(self.code, context.local_bindings)
  File "/home/tyoc213/swift-source/swift-source/swift/include/swift/Syntax/SyntaxKind.h.gyb", line 2, in <module>
    from gyb_syntax_support import *
  File "/home/tyoc213/swift-source/swift-source/swift/utils/gyb_syntax_support/__init__.py", line 2, in <module>
    from AttributeNodes import ATTRIBUTE_NODES
ModuleNotFoundError: No module named 'AttributeNodes'
[3/865] Generating Trivia.h from Trivia.h.gyb with ptr size =
FAILED: include/swift/Syntax/Trivia.h 
cd /home/tyoc213/swift-source/swift-source/swift/include/swift/Syntax && /usr/bin/cmake -E make_directory /home/tyoc213/swift-source/swift-source/build/Ninja-RelWithDebInfoAssert/swift-linux-x86_64/include/swift/Syntax && /home/tyoc213/anaconda3/bin/python /home/tyoc213/swift-source/swift-source/swift/utils/gyb --line-directive '#line %(line)d "%(file)s"' -o /home/tyoc213/swift-source/swift-source/build/Ninja-RelWithDebInfoAssert/swift-linux-x86_64/include/swift/Syntax/Trivia.h.tmp Trivia.h.gyb && /usr/bin/cmake -E copy_if_different /home/tyoc213/swift-source/swift-source/build/Ninja-RelWithDebInfoAssert/swift-linux-x86_64/include/swift/Syntax/Trivia.h.tmp /home/tyoc213/swift-source/swift-source/build/Ninja-RelWithDebInfoAssert/swift-linux-x86_64/include/swift/Syntax/Trivia.h && /usr/bin/cmake -E remove /home/tyoc213/swift-source/swift-source/build/Ninja-RelWithDebInfoAssert/swift-linux-x86_64/include/swift/Syntax/Trivia.h.tmp
Traceback (most recent call last):
  File "/home/tyoc213/swift-source/swift-source/swift/utils/gyb", line 3, in <module>
    gyb.main()
  File "/home/tyoc213/swift-source/swift-source/swift/utils/gyb.py", line 1260, in main
    args.target.write(execute_template(ast, args.line_directive, **bindings))
  File "/home/tyoc213/swift-source/swift-source/swift/utils/gyb.py", line 1131, in execute_template
    ast.execute(execution_context)
  File "/home/tyoc213/swift-source/swift-source/swift/utils/gyb.py", line 635, in execute
    x.execute(context)
  File "/home/tyoc213/swift-source/swift-source/swift/utils/gyb.py", line 721, in execute
    result = eval(self.code, context.local_bindings)
  File "/home/tyoc213/swift-source/swift-source/swift/include/swift/Syntax/Trivia.h.gyb", line 3, in <module>
    from gyb_syntax_support import *
  File "/home/tyoc213/swift-source/swift-source/swift/utils/gyb_syntax_support/__init__.py", line 2, in <module>
    from AttributeNodes import ATTRIBUTE_NODES
ModuleNotFoundError: No module named 'AttributeNodes'
[4/865] Generating IntegerTypes.swift from IntegerTypes.swift.gyb with ptr size = 8
FAILED: stdlib/public/core/8/IntegerTypes.swift 
cd /home/tyoc213/swift-source/swift-source/swift/stdlib/public/core && /usr/bin/cmake -E make_directory /home/tyoc213/swift-source/swift-source/build/Ninja-RelWithDebInfoAssert/swift-linux-x86_64/stdlib/public/core/8 && /home/tyoc213/anaconda3/bin/python /home/tyoc213/swift-source/swift-source/swift/utils/gyb -DunicodeGraphemeBreakPropertyFile=/home/tyoc213/swift-source/swift-source/swift/utils/UnicodeData/GraphemeBreakProperty.txt -DunicodeGraphemeBreakTestFile=/home/tyoc213/swift-source/swift-source/swift/utils/UnicodeData/GraphemeBreakTest.txt -DCMAKE_SIZEOF_VOID_P=8 -o /home/tyoc213/swift-source/swift-source/build/Ninja-RelWithDebInfoAssert/swift-linux-x86_64/stdlib/public/core/8/IntegerTypes.swift.tmp IntegerTypes.swift.gyb && /usr/bin/cmake -E copy_if_different /home/tyoc213/swift-source/swift-source/build/Ninja-RelWithDebInfoAssert/swift-linux-x86_64/stdlib/public/core/8/IntegerTypes.swift.tmp /home/tyoc213/swift-source/swift-source/build/Ninja-RelWithDebInfoAssert/swift-linux-x86_64/stdlib/public/core/8/IntegerTypes.swift && /usr/bin/cmake -E remove /home/tyoc213/swift-source/swift-source/build/Ninja-RelWithDebInfoAssert/swift-linux-x86_64/stdlib/public/core/8/IntegerTypes.swift.tmp
Traceback (most recent call last):
  File "/home/tyoc213/swift-source/swift-source/swift/utils/gyb", line 3, in <module>
    gyb.main()
  File "/home/tyoc213/swift-source/swift-source/swift/utils/gyb.py", line 1260, in main
    args.target.write(execute_template(ast, args.line_directive, **bindings))
  File "/home/tyoc213/swift-source/swift-source/swift/utils/gyb.py", line 1131, in execute_template
    ast.execute(execution_context)
  File "/home/tyoc213/swift-source/swift-source/swift/utils/gyb.py", line 635, in execute
    x.execute(context)
  File "/home/tyoc213/swift-source/swift-source/swift/utils/gyb.py", line 721, in execute
    result = eval(self.code, context.local_bindings)
  File "/home/tyoc213/swift-source/swift-source/swift/stdlib/public/core/IntegerTypes.swift.gyb", line 20, in <module>
    from string import maketrans, capitalize
ImportError: cannot import name 'maketrans' from 'string' (/home/tyoc213/anaconda3/lib/python3.7/string.py)
ninja: build stopped: subcommand failed.
utils/build-script: fatal error: command terminated with a non-zero exit status 1, aborting

So I apply this little patch (just to make it pass that point... which soldnt rever to python3)

diff --git a/stdlib/public/core/IntegerTypes.swift.gyb b/stdlib/public/core/IntegerTypes.swift.gyb
index 747063e798..6fe6c9071a 100644
--- a/stdlib/public/core/IntegerTypes.swift.gyb
+++ b/stdlib/public/core/IntegerTypes.swift.gyb
@@ -17,7 +17,6 @@
 from SwiftIntTypes import all_integer_types, int_max_bits, should_define_truncating_bit_pattern_init
 from SwiftFloatingPointTypes import getFtoIBounds

-from string import maketrans, capitalize
 from itertools import chain

 # Number of bits in the Builtin.Word type
diff --git a/stdlib/public/core/Tuple.swift.gyb b/stdlib/public/core/Tuple.swift.gyb
index 8fdf2adb33..8a0c39f61f 100644
--- a/stdlib/public/core/Tuple.swift.gyb
+++ b/stdlib/public/core/Tuple.swift.gyb
@@ -111,7 +111,7 @@ public func >=(lhs: (), rhs: ()) -> Bool {
 %   equatableTypeParams = ", ".join(["{} : Equatable".format(c) for c in typeParams])

 %   originalTuple = "(\"a\", {})".format(", ".join(map(str, range(1, arity))))
-%   greaterTuple = "(\"a\", {})".format(", ".join(map(str, range(1, arity - 1) + [arity])))
+%   greaterTuple = "(\"a\", {})".format(", ".join(map(str, list(range(1, arity - 1)) + [arity])))

 /// Returns a Boolean value indicating whether the corresponding components of
 /// two tuples are equal.

And then try to build again... I get this

(old27) tyoc213@fast:~/swift-source/swift-source/swift$ utils/build-script --enable-tensorflow --release-debuginfo
utils/build-script: note: Using toolchain default
+ mkdir -p /home/tyoc213/swift-source/swift-source/build/Ninja-RelWithDebInfoAssert
+ env HOST_VARIABLE_linux_x86_64__SWIFT_BENCHMARK_TARGETS= HOST_VARIABLE_linux_x86_64__SWIFT_RUN_BENCHMARK_TARGETS= HOST_VARIABLE_linux_x86_64__SWIFT_SDKS=LINUX HOST_VARIABLE_linux_x86_64__SWIFT_STDLIB_TARGETS=swift-test-stdlib-linux-x86_64 HOST_VARIABLE_linux_x86_64__SWIFT_TEST_TARGETS= /home/tyoc213/swift-source/swift-source/swift/utils/build-script-impl --workspace /home/tyoc213/swift-source/swift-source --build-dir /home/tyoc213/swift-source/swift-source/build/Ninja-RelWithDebInfoAssert --install-prefix /usr --host-target linux-x86_64 --stdlib-deployment-targets linux-x86_64 --host-cc /usr/bin/clang --host-cxx /usr/bin/clang++ --darwin-xcrun-toolchain default --darwin-deployment-version-osx=10.9 --darwin-deployment-version-ios=7.0 --darwin-deployment-version-tvos=9.0 --darwin-deployment-version-watchos=2.0 --cmake /usr/bin/cmake --cmark-build-type RelWithDebInfo --llvm-build-type RelWithDebInfo --swift-build-type RelWithDebInfo --swift-stdlib-build-type RelWithDebInfo --lldb-build-type RelWithDebInfo --lldb-build-with-xcode 1 --foundation-build-type RelWithDebInfo --libdispatch-build-type RelWithDebInfo --libicu-build-type RelWithDebInfo --xctest-build-type RelWithDebInfo --swiftpm-build-type RelWithDebInfo --swiftsyntax-build-type RelWithDebInfo --skstresstester-build-type RelWithDebInfo --llbuild-build-type RelWithDebInfo --swift-enable-assertions true --swift-stdlib-enable-assertions true --swift-analyze-code-coverage false --llbuild-enable-assertions true --lldb-assertions true --cmake-generator Ninja --build-jobs 4 '--common-cmake-options=-G Ninja -DCMAKE_C_COMPILER:PATH=/usr/bin/clang -DCMAKE_CXX_COMPILER:PATH=/usr/bin/clang++ -DCMAKE_LIBTOOL:PATH= -DLLVM_VERSION_MAJOR:STRING=7 -DLLVM_VERSION_MINOR:STRING=0 -DLLVM_VERSION_PATCH:STRING=0 -DCLANG_VERSION_MAJOR:STRING=7 -DCLANG_VERSION_MINOR:STRING=0 -DCLANG_VERSION_PATCH:STRING=0 -DCMAKE_MAKE_PROGRAM=/usr/bin/ninja' --build-args=-j4 --cmark-cmake-options= '--llvm-cmake-options=-DLLVM_ENABLE_ASSERTIONS=TRUE -DLLVM_TARGETS_TO_BUILD=X86;ARM;AArch64;PowerPC;SystemZ;Mips' '--swift-cmake-options=-DSWIFT_STDLIB_ENABLE_SIL_OWNERSHIP=FALSE -DSWIFT_ENABLE_GUARANTEED_NORMAL_ARGUMENTS=TRUE -DCMAKE_EXPORT_COMPILE_COMMANDS=TRUE -DSWIFT_FORCE_OPTIMIZED_TYPECHECKER=FALSE -DSWIFT_STDLIB_ENABLE_STDLIBCORE_EXCLUSIVITY_CHECKING=FALSE' --build-stdlib-deployment-targets all --ninja-bin=/usr/bin/ninja --skip-build-foundation --skip-build-xctest --skip-build-lldb --skip-build-llbuild --skip-build-libdispatch --skip-build-libicu --skip-build-swiftpm --skip-build-swiftsyntax --skip-build-skstresstester --skip-build-playgroundsupport --build-swift-dynamic-stdlib --build-swift-dynamic-sdk-overlay --skip-build-ios-device --skip-build-ios-simulator --skip-build-tvos-device --skip-build-tvos-simulator --skip-build-watchos-device --skip-build-watchos-simulator --skip-build-android --skip-test-swift --skip-test-cmark --skip-test-lldb --skip-test-llbuild --skip-test-swiftpm --skip-test-swiftsyntax --skip-test-skstresstester --skip-test-xctest --skip-test-foundation --skip-test-libdispatch --skip-test-libicu --skip-test-playgroundsupport --skip-test-linux --skip-test-freebsd --skip-test-cygwin --skip-test-osx --skip-test-ios-host --skip-test-ios-simulator --skip-test-tvos-host --skip-test-tvos-simulator --skip-test-watchos-host --skip-test-watchos-simulator --skip-test-android-host --skip-test-benchmarks --skip-test-optimized --skip-test-optimize-for-size --android-deploy-device-path /data/local/tmp --enable-tensorflow --host-bazel /home/tyoc213/bin/bazel --llvm-lit-args=-sv
Building the standard library for: swift-test-stdlib-linux-x86_64
+ /usr/bin/cmake --build /home/tyoc213/swift-source/swift-source/build/Ninja-RelWithDebInfoAssert/cmark-linux-x86_64 -- -j4 all
ninja: no work to do.
symlinking the system headers (/usr/include/c++) into the local clang build directory (/home/tyoc213/swift-source/swift-source/build/Ninja-RelWithDebInfoAssert/llvm-linux-x86_64/include).
+ ln -s -f /usr/include/c++ /home/tyoc213/swift-source/swift-source/build/Ninja-RelWithDebInfoAssert/llvm-linux-x86_64/include
+ /usr/bin/cmake --build /home/tyoc213/swift-source/swift-source/build/Ninja-RelWithDebInfoAssert/llvm-linux-x86_64 -- -j4 all
ninja: no work to do.
WARNING: --batch mode is deprecated. Please instead explicitly shut down your Bazel server using the command "bazel shutdown".
You have bazel 0.23.2 installed.
Please specify the location of python. [Default is /home/tyoc213/anaconda3/envs/old27/bin/python]: 

Invalid python path: yes  cannot be found.
Please specify the location of python. [Default is /home/tyoc213/anaconda3/envs/old27/bin/python]: 

Found possible Python library paths:
  /home/tyoc213/anaconda3/envs/old27/lib/python2.7/site-packages
Please input the desired Python library path to use.  Default is [/home/tyoc213/anaconda3/envs/old27/lib/python2.7/site-packages]
Do you wish to build TensorFlow with XLA JIT support? [Y/n]: XLA JIT support will be enabled for TensorFlow.

Do you wish to build TensorFlow with OpenCL SYCL support? [y/N]: No OpenCL SYCL support will be enabled for TensorFlow.

Do you wish to build TensorFlow with ROCm support? [y/N]: No ROCm support will be enabled for TensorFlow.

Do you wish to build TensorFlow with CUDA support? [y/N]: No CUDA support will be enabled for TensorFlow.

Do you wish to download a fresh release of clang? (Experimental) [y/N]: Clang will not be downloaded.

Do you wish to build TensorFlow with MPI support? [y/N]: No MPI support will be enabled for TensorFlow.

Please specify optimization flags to use during compilation when bazel option "--config=opt" is specified [Default is -march=native -Wno-sign-compare]: 

Would you like to interactively configure ./WORKSPACE for Android builds? [y/N]: Not configuring the WORKSPACE for Android builds.

Preconfigured Bazel build configs. You can use any of the below by adding "--config=<>" to your build command. See .bazelrc for more details.
    --config=mkl            # Build with MKL support.
    --config=monolithic     # Config for mostly static monolithic build.
    --config=gdr            # Build with GDR support.
    --config=verbs          # Build with libverbs support.
    --config=ngraph         # Build with Intel nGraph support.
    --config=numa           # Build with NUMA support.
    --config=dynamic_kernels    # (Experimental) Build kernels into separate shared objects.
Preconfigured Bazel build configs to DISABLE default on features:
    --config=noaws          # Disable AWS S3 filesystem support.
    --config=nogcp          # Disable GCP support.
    --config=nohdfs         # Disable HDFS support.
    --config=noignite       # Disable Apache Ignite support.
    --config=nokafka        # Disable Apache Kafka support.
    --config=nonccl         # Disable NVIDIA NCCL support.
Configuration finished
+ pushd /home/tyoc213/swift-source/swift-source/tensorflow
~/swift-source/swift-source/tensorflow ~/swift-source/swift-source/swift
+ bazel build -c opt //tensorflow:libtensorflow.so //tensorflow:libtensorflow_framework.so
INFO: Analysed 2 targets (0 packages loaded, 0 targets configured).
INFO: Found 2 targets...
INFO: Elapsed time: 0.265s, Critical Path: 0.01s
INFO: 0 processes.
INFO: Build completed successfully, 1 total action
+ popd
~/swift-source/swift-source/swift
+ mkdir -p /home/tyoc213/swift-source/swift-source/build/Ninja-RelWithDebInfoAssert/swift-linux-x86_64/bin/../lib/swift/linux
+ /usr/bin/cmake --build /home/tyoc213/swift-source/swift-source/build/Ninja-RelWithDebInfoAssert/swift-linux-x86_64 -- -j4 all swift-test-stdlib-linux-x86_64
[1/863] Generating SyntaxKind.h from SyntaxKind.h.gyb with ptr size =
FAILED: include/swift/Syntax/SyntaxKind.h 
cd /home/tyoc213/swift-source/swift-source/swift/include/swift/Syntax && /usr/bin/cmake -E make_directory /home/tyoc213/swift-source/swift-source/build/Ninja-RelWithDebInfoAssert/swift-linux-x86_64/include/swift/Syntax && /home/tyoc213/anaconda3/bin/python /home/tyoc213/swift-source/swift-source/swift/utils/gyb --line-directive '#line %(line)d "%(file)s"' -o /home/tyoc213/swift-source/swift-source/build/Ninja-RelWithDebInfoAssert/swift-linux-x86_64/include/swift/Syntax/SyntaxKind.h.tmp SyntaxKind.h.gyb && /usr/bin/cmake -E copy_if_different /home/tyoc213/swift-source/swift-source/build/Ninja-RelWithDebInfoAssert/swift-linux-x86_64/include/swift/Syntax/SyntaxKind.h.tmp /home/tyoc213/swift-source/swift-source/build/Ninja-RelWithDebInfoAssert/swift-linux-x86_64/include/swift/Syntax/SyntaxKind.h && /usr/bin/cmake -E remove /home/tyoc213/swift-source/swift-source/build/Ninja-RelWithDebInfoAssert/swift-linux-x86_64/include/swift/Syntax/SyntaxKind.h.tmp
Traceback (most recent call last):
  File "/home/tyoc213/swift-source/swift-source/swift/utils/gyb", line 3, in <module>
    gyb.main()
  File "/home/tyoc213/swift-source/swift-source/swift/utils/gyb.py", line 1260, in main
    args.target.write(execute_template(ast, args.line_directive, **bindings))
  File "/home/tyoc213/swift-source/swift-source/swift/utils/gyb.py", line 1131, in execute_template
    ast.execute(execution_context)
  File "/home/tyoc213/swift-source/swift-source/swift/utils/gyb.py", line 635, in execute
    x.execute(context)
  File "/home/tyoc213/swift-source/swift-source/swift/utils/gyb.py", line 721, in execute
    result = eval(self.code, context.local_bindings)
  File "/home/tyoc213/swift-source/swift-source/swift/include/swift/Syntax/SyntaxKind.h.gyb", line 2, in <module>
    from gyb_syntax_support import *
  File "/home/tyoc213/swift-source/swift-source/swift/utils/gyb_syntax_support/__init__.py", line 2, in <module>
    from AttributeNodes import ATTRIBUTE_NODES
ModuleNotFoundError: No module named 'AttributeNodes'
[2/863] Generating SyntaxNodes.h from SyntaxNodes.h.gyb with ptr size =
FAILED: include/swift/Syntax/SyntaxNodes.h 
cd /home/tyoc213/swift-source/swift-source/swift/include/swift/Syntax && /usr/bin/cmake -E make_directory /home/tyoc213/swift-source/swift-source/build/Ninja-RelWithDebInfoAssert/swift-linux-x86_64/include/swift/Syntax && /home/tyoc213/anaconda3/bin/python /home/tyoc213/swift-source/swift-source/swift/utils/gyb --line-directive '#line %(line)d "%(file)s"' -o /home/tyoc213/swift-source/swift-source/build/Ninja-RelWithDebInfoAssert/swift-linux-x86_64/include/swift/Syntax/SyntaxNodes.h.tmp SyntaxNodes.h.gyb && /usr/bin/cmake -E copy_if_different /home/tyoc213/swift-source/swift-source/build/Ninja-RelWithDebInfoAssert/swift-linux-x86_64/include/swift/Syntax/SyntaxNodes.h.tmp /home/tyoc213/swift-source/swift-source/build/Ninja-RelWithDebInfoAssert/swift-linux-x86_64/include/swift/Syntax/SyntaxNodes.h && /usr/bin/cmake -E remove /home/tyoc213/swift-source/swift-source/build/Ninja-RelWithDebInfoAssert/swift-linux-x86_64/include/swift/Syntax/SyntaxNodes.h.tmp
Traceback (most recent call last):
  File "/home/tyoc213/swift-source/swift-source/swift/utils/gyb", line 3, in <module>
    gyb.main()
  File "/home/tyoc213/swift-source/swift-source/swift/utils/gyb.py", line 1260, in main
    args.target.write(execute_template(ast, args.line_directive, **bindings))
  File "/home/tyoc213/swift-source/swift-source/swift/utils/gyb.py", line 1131, in execute_template
    ast.execute(execution_context)
  File "/home/tyoc213/swift-source/swift-source/swift/utils/gyb.py", line 635, in execute
    x.execute(context)
  File "/home/tyoc213/swift-source/swift-source/swift/utils/gyb.py", line 721, in execute
    result = eval(self.code, context.local_bindings)
  File "/home/tyoc213/swift-source/swift-source/swift/include/swift/Syntax/SyntaxNodes.h.gyb", line 3, in <module>
    from gyb_syntax_support import *
  File "/home/tyoc213/swift-source/swift-source/swift/utils/gyb_syntax_support/__init__.py", line 2, in <module>
    from AttributeNodes import ATTRIBUTE_NODES
ModuleNotFoundError: No module named 'AttributeNodes'
[3/863] Generating Trivia.h from Trivia.h.gyb with ptr size =
FAILED: include/swift/Syntax/Trivia.h 
cd /home/tyoc213/swift-source/swift-source/swift/include/swift/Syntax && /usr/bin/cmake -E make_directory /home/tyoc213/swift-source/swift-source/build/Ninja-RelWithDebInfoAssert/swift-linux-x86_64/include/swift/Syntax && /home/tyoc213/anaconda3/bin/python /home/tyoc213/swift-source/swift-source/swift/utils/gyb --line-directive '#line %(line)d "%(file)s"' -o /home/tyoc213/swift-source/swift-source/build/Ninja-RelWithDebInfoAssert/swift-linux-x86_64/include/swift/Syntax/Trivia.h.tmp Trivia.h.gyb && /usr/bin/cmake -E copy_if_different /home/tyoc213/swift-source/swift-source/build/Ninja-RelWithDebInfoAssert/swift-linux-x86_64/include/swift/Syntax/Trivia.h.tmp /home/tyoc213/swift-source/swift-source/build/Ninja-RelWithDebInfoAssert/swift-linux-x86_64/include/swift/Syntax/Trivia.h && /usr/bin/cmake -E remove /home/tyoc213/swift-source/swift-source/build/Ninja-RelWithDebInfoAssert/swift-linux-x86_64/include/swift/Syntax/Trivia.h.tmp
Traceback (most recent call last):
  File "/home/tyoc213/swift-source/swift-source/swift/utils/gyb", line 3, in <module>
    gyb.main()
  File "/home/tyoc213/swift-source/swift-source/swift/utils/gyb.py", line 1260, in main
    args.target.write(execute_template(ast, args.line_directive, **bindings))
  File "/home/tyoc213/swift-source/swift-source/swift/utils/gyb.py", line 1131, in execute_template
    ast.execute(execution_context)
  File "/home/tyoc213/swift-source/swift-source/swift/utils/gyb.py", line 635, in execute
    x.execute(context)
  File "/home/tyoc213/swift-source/swift-source/swift/utils/gyb.py", line 721, in execute
    result = eval(self.code, context.local_bindings)
  File "/home/tyoc213/swift-source/swift-source/swift/include/swift/Syntax/Trivia.h.gyb", line 3, in <module>
    from gyb_syntax_support import *
  File "/home/tyoc213/swift-source/swift-source/swift/utils/gyb_syntax_support/__init__.py", line 2, in <module>
    from AttributeNodes import ATTRIBUTE_NODES
ModuleNotFoundError: No module named 'AttributeNodes'
[4/863] Generating ExistentialCollection.swift from ExistentialCollection.swift.gyb with ptr size = 8
ninja: build stopped: subcommand failed.
utils/build-script: fatal error: command terminated with a non-zero exit status 1, aborting

Dont know if that helps... also should I continue posting here? or...?

And

Do you wish to build TensorFlow with CUDA support? [y/N]: No CUDA support will be enabled for TensorFlow.

How do I enable CUDA support?

It seems that it should locate the correct path of the 27 lib from the logs, but at the end it try to access string from py3...

tyoc213 commented 5 years ago

@marcrasi I just downloaded the CPU version and it seems to work, but for the cuda version always shows that stop process at REPL breakpoint even on nightly build.

marcrasi commented 5 years ago

It sounds a lot like it's not finding cuda or cudnn libraries. Have you tried this:

If you make a simple swift file hello.swift with print("Hello World") and then call swiftc hello.swift and then run the binary ./hello, does that work? If it doesn't work, it might print out an informative error message that will give a hint about what's wrong.

It might print out a more detailed error message describing exactly what library it can't find.

lakshya-sky commented 5 years ago

@marcrasi I just downloaded the CPU version and it seems to work, but for the cuda version always shows that stop process at REPL breakpoint even on nightly build.

@tyoc213 did you solve this issue? because I have same issue in Ubuntu 18.04.

marcrasi commented 5 years ago

Have you tried this?

If you make a simple swift file hello.swift with print("Hello World") and then call swiftc hello.swift and then run the binary ./hello, does that work? If it doesn't work, it might print out an informative error message that will give a hint about what's wrong.

lakshya-sky commented 5 years ago

Have you tried this?

If you make a simple swift file hello.swift with print("Hello World") and then call swiftc hello.swift and then run the binary ./hello, does that work? If it doesn't work, it might print out an informative error message that will give a hint about what's wrong.

@marcrasi That works!!!, but then why i am getting that error?

marcrasi commented 5 years ago

Here's another thing to try that might reveal a more informative error message:

marcrasi@marcrasi:~$ swiftc -g hello.swift 
marcrasi@marcrasi:~$ lldb ./hello
(lldb) target create "./hello"
Current executable set to './hello' (x86_64).
(lldb) b hello.swift:1
Breakpoint 1: where = hello`main + 15 at hello.swift:1:7, address = 0x0000000000000c7f
(lldb) run
Process 20603 launched: '/usr/local/google/home/marcrasi/hello' (x86_64)
Process 20603 stopped
* thread #1, name = 'hello', stop reason = breakpoint 1.1
    frame #0: 0x0000555555554c7f hello`main at hello.swift:1:7
-> 1    print("Hello World")
Target 0: (hello) stopped.
(lldb) 
lakshya-sky commented 5 years ago

@marcrasi i did same as you suggested and here is my output.

(lldb) target create "./hello"
Current executable set to './hello' (x86_64).
(lldb) b hello.swift:1
Breakpoint 1: where = hello`main + 15 at hello.swift:1:7, address = 0x0000000000000baf
(lldb) run
Process 5747 launched: '/home/dash/Downloads/swift_tf_gpu/usr/bin/hello' (x86_64)
Process 5747 stopped
* thread #1, name = 'hello', stop reason = breakpoint 1.1
    frame #0: 0x0000555555554baf hello`main at hello.swift:1:7
-> 1    print("Hello World")
Target 0: (hello) stopped.
(lldb) 

but when I try to run:

 ~/Downloads/swift_tf_gpu/usr/bin:~$ ./swift
error: failed to stop process at REPL breakpoint