Skip to content

CMake (Windows): Added support for ninja build and some fixes/changes - #16763

Merged
jhseu merged 2 commits into
tensorflow:masterfrom
ChaseOxide:master
Feb 8, 2018
Merged

jhseu merged 2 commits into
tensorflow:masterfrom
ChaseOxide:master

Conversation

@ChaseOxide

Copy link
Copy Markdown
Contributor

Most changes have comments stuck with them, but here's the summary of it.

Changes made:

  • Added EXACT flag on find_package CUDA to clarify it is building for exactly that version, the output "minimum required" can be misleading
  • Tests if the compiler is compatible with CUDA before it starts building
  • BYPRODUCTS/BUILD_BYPRODUCTS are added for Ninja to search for dependency, otherwise it will output the error shown below
    ninja: error: 'zlib/install/lib/zlibstatic.lib', needed by 'proto_text.exe', missing and no known rule to make it
  • Visual Studio is the only generator with that will output under $(Configuration) directory, thus removed if it is not Visual Studio
  • Fixed CONFIGURE_COMMAND causing some CMake versions to break (it resets to default generator, the CMake I tried uses NMake Makefiles as default, which causes the output below
    ...
    Submodule path 'third_party/benchmark': checked out '360e66c1c4777c99402cf8cd535aa510fee16573'
    Performing update step for 'protobuf'
    No patch step for 'protobuf'
    Performing configure step for 'protobuf'
    CMake Error at CMakeLists.txt:12 (project):
      Generator
    
        NMake Makefiles
    
      does not support platform specification, but platform
    
        x64
    
      was specified.
    
    -- Building for: NMake Makefiles
    -- Configuring incomplete, errors occurred!
    ...
    

Additional Info: The current version of CMake has a problem with its ninja generator, as it may produce an error below
ninja: fatal: CreateProcess: The filename or extension is too long.
The CMake with its ninja generator improved can be found here

@googlebot

Copy link
Copy Markdown

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address on your commit. Check your existing CLA data and verify that your email is set on your git commits.
  • If your company signed a CLA, they designated a Point of Contact who decides which employees are authorized to participate. You may need to contact the Point of Contact for your company and ask to be added to the group of authorized contributors. If you don't know who your Point of Contact is, direct the project maintainer to go/cla#troubleshoot. The email used to register you as an authorized contributor must be the email used for the Git commit.
  • In order to pass this check, please resolve this problem and have the pull request author add another comment and the bot will run again. If the bot doesn't comment, it means it doesn't think anything has changed.

@ChaseOxide

Copy link
Copy Markdown
Contributor Author

I signed it!

@googlebot

Copy link
Copy Markdown

CLAs look good, thanks!

@googlebot googlebot added cla: yes and removed cla: no labels Feb 5, 2018
@jhseu
jhseu requested a review from mrry February 5, 2018 21:51
@jhseu jhseu self-assigned this Feb 5, 2018

@mrry mrry left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution! Looks fine to me modulo one typo.

Comment thread tensorflow/contrib/cmake/CMakeLists.txt Outdated
# later command will make use of the value in tensorflow_CUDA_VERSION
find_package(CUDA ${tensorflow_CUDA_VERSION} REQUIRED EXACT)

# Test compatibality of compiler on CUDA

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit (typo): "compatibility"

@mrry

mrry commented Feb 5, 2018

Copy link
Copy Markdown
Contributor

@jhseu Before merging this, we should probably run a manual Windows CMake GPU build in addition to the regular presubmits.

@jhseu jhseu added the kokoro:force-run Tests on submitted change label Feb 6, 2018
@kokoro-team kokoro-team removed the kokoro:force-run Tests on submitted change label Feb 6, 2018
@jhseu
jhseu merged commit d83d1a4 into tensorflow:master Feb 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants