Skip to content
This repository has been archived by the owner on Mar 30, 2022. It is now read-only.

Verify Installation Step in Installation instructions fail on Windows #421

Closed
maxvol opened this issue Apr 16, 2020 · 11 comments
Closed

Verify Installation Step in Installation instructions fail on Windows #421

maxvol opened this issue Apr 16, 2020 · 11 comments

Comments

@maxvol
Copy link
Contributor

maxvol commented Apr 16, 2020

swift test.swift test.swift:1:8: error: missing required module 'CTensorFlow' import TensorFlow ^
with S4TF from 15 April 2020 on Windows 10 Version 1803 (OS Build 17134.1304)
Toolchain is installed in C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain

@ematejska
Copy link
Contributor

ematejska commented Apr 16, 2020 via email

@compnerd
Copy link
Contributor

@maxvol could you please provide a full compiler invocation that you are using?

@maxvol
Copy link
Contributor Author

maxvol commented Apr 17, 2020

@compnerd ah, you mean that i missed an installation step? do i need to build TF first? i followed all the installation steps listed, but it seems that toolchain is only part of the problem and TF lib has to be built separately? if so, please add this to the installation manual.

@jhoughjr
Copy link

I followed the instructions day before yesterday and am having the same error. All prereqs are installed.

@compnerd
Copy link
Contributor

No, swift-apis should be part of the installation which will have the CTensorFlow module. The disk layout requires that you are adding the include path though. You will need to have a -I C:\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk\usr\lib\swift in addition to the -sdk C:\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk.

Effectively, your invocation should be something along the lines of:

set SDKROOT=%SystemDrive%/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk
swiftc -sdk %SDKROOT% -I %SDKROOT%/usr/lib/swift -L %SDKROOT%/usr/lib/swift/windows -emit-executable -o reduced.exe reduced.swift

This is better captured in the docs for swift-models. I just want to ensure that the flags are being passed :)

@maxvol
Copy link
Contributor Author

maxvol commented Apr 18, 2020

@compnerd thanks, that worked! still, i am unable to run the installation test (swift test.swift) even with these flags (error: could not load the swift standard library). so i have 3 questions:

  1. is it somehow possible not to use flags directly but store them in some kind environment variable?
  2. how to run interpreter (i.e. swift, not swiftc) so that it works? ;)
  3. is it possible to run either one directly from VC2019? how?

@compnerd
Copy link
Contributor

Glad to hear that was it. Interesting, I've not tried it recently, but that has worked for me in the past. As to your questions ...

  1. No, swiftc does not consult the environment.
  2. I've not spent much time with the interpreter, but, yes, if you are interested in working on it it should be possible :). Probably requires a fair amount of work in the compiler.
  3. I assume that was a typo, and you meant VS2019? If so, yes, it is possible if someone is willing to do the work. It will require a new toolset definition and possibly a plugin for diagnostic reporting. Additionally, it probably will need a separate property sheet for the configuration of the targets.

Im happy to see someone else take on the last two items, but in the mean time, I would recommend that you use CMake+Ninja :)

@maxvol
Copy link
Contributor Author

maxvol commented Apr 21, 2020

@compnerd thanks, clear. i am only asking about #2 because ironically it was given as an installation test ;)

@compnerd
Copy link
Contributor

Hmm, I thought that the installation test was generating an executable. That’s something that we should clarify for the windows side. Thanks for the heads up on that. A patch to the documentation would be wonderful if you would like to get more involved in the project :)

@maxvol
Copy link
Contributor Author

maxvol commented Apr 22, 2020

@compnerd sure, please let me know how to contribute.

@compnerd
Copy link
Contributor

@maxvol I think that the first thing to do would be to update the documentation to make the difference clear. I would suggest that expanding the differences in the verification step in https://github.com/tensorflow/swift/blob/master/Installation.md would be a great first step.

Once the instructions are updated, we can start looking at what it would take to enable the interpreter mode on Windows :). But we should do that as a separate issue.

@compnerd compnerd changed the title Windows installation failure Verify Installation Step in Installation instructions fail on Windows Apr 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants