Skip to content

Conversation

xsacha
Copy link
Contributor

@xsacha xsacha commented Mar 28, 2019

Multiple configurations is the default (eg. Release;Debug) on Windows and this check always broke this configuration as CMAKE_BUILD_TYPE was not set. The workaround was to always set CMAKE_BUILD_TYPE to Debug or Release, which was very unfortunate.

The correct method is to use generator expressions that expand depending on the current CONFIG being processed.

Side note: Anywhere else CMAKE_BUILD_TYPE is checked should probably be fixed too.
Note that the CMakeLists.txt forces it in to Release mode. However, I came across this error when importing the prebuilt Config in to another project, where CMAKE_BUILD_TYPE was not set.

3>CMake Error at pre_built/pytorch-1.0.1/share/cmake/Caffe2/public/cuda.cmake:380 (message):
3> Unknown cmake build type:

Proper support for configurations would mean we can build debug and release at the same time and as you can see, it is less CMake code.

@xsacha
Copy link
Contributor Author

xsacha commented Mar 30, 2019

Anything wrong with commit how it is now?

@peterjc123
Copy link
Collaborator

@pytorchbot rebase this please

@pytorchbot
Copy link
Collaborator

Sorry, I can't merge this because there are conflicts. To merge this yourself, run the commands below:

git fetch origin master
git fetch git@github.com:xsacha/pytorch.git patch-3
git checkout FETCH_HEAD
git merge origin/master
git push git@github.com:xsacha/pytorch.git HEAD:patch-3

(To learn more about this bot, see Bot commands.)

@peterjc123
Copy link
Collaborator

@xsacha Could you please rebase this first, please?

@xsacha
Copy link
Contributor Author

xsacha commented Apr 1, 2019

Rebased, tests passed

@peterjc123
Copy link
Collaborator

@pytorchbot retest this please

@peterjc123
Copy link
Collaborator

@pytorchbot rebase this please

@pytorchbot
Copy link
Collaborator

Sorry, I can't merge this because there are conflicts. To merge this yourself, run the commands below:

git fetch origin master
git fetch git@github.com:xsacha/pytorch.git patch-3
git checkout FETCH_HEAD
git merge origin/master
git push git@github.com:xsacha/pytorch.git HEAD:patch-3

(To learn more about this bot, see Bot commands.)

@peterjc123
Copy link
Collaborator

Looks like conflicts are still there.

xsacha added 2 commits April 1, 2019 17:50
Multiple configurations is the default (eg. Release;Debug) on Windows and this check always broke this configuration as CMAKE_BUILD_TYPE was not set. The workaround was to always set CMAKE_BUILD_TYPE to Debug or Release, which was very unfortunate.

The correct method is to use generator expressions that expand depending on the current CONFIG being processed.
@xsacha
Copy link
Contributor Author

xsacha commented Apr 1, 2019

What a silly bot. There was no conflicts the first time or this time.

git pull --rebase upstream
From https://github.com/pytorch/pytorch

  • branch HEAD -> FETCH_HEAD
    First, rewinding head to replay your work on top of it...
    Applying: Fix multi-configuration on Windows CMake (CUDA)
    Applying: Remove another usage of CMAKE_BUILD_TYPE

@peterjc123
Copy link
Collaborator

@pytorchbot merge this please

@pytorchbot pytorchbot added the merge-this-please Was marked for merge with @pytorchbot merge this please label Apr 1, 2019
Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@ezyang is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@ezyang merged this pull request in 3027e78.

zdevito pushed a commit to zdevito/ATen that referenced this pull request Apr 2, 2019
Summary:
Multiple configurations is the default (eg. Release;Debug) on Windows and this check always broke this configuration as CMAKE_BUILD_TYPE was not set. The workaround was to always set CMAKE_BUILD_TYPE to Debug or Release, which was very unfortunate.

The correct method is to use generator expressions that expand depending on the current CONFIG being processed.

Side note: Anywhere else CMAKE_BUILD_TYPE is checked should probably be fixed too.
Note that the CMakeLists.txt forces it in to Release mode. However, I came across this error when importing the prebuilt Config in to another project, where CMAKE_BUILD_TYPE was not set.

> 3>CMake Error at pre_built/pytorch-1.0.1/share/cmake/Caffe2/public/cuda.cmake:380 (message):
> 3>  Unknown cmake build type:

Proper support for configurations would mean we can build debug and release at the same time and as you can see, it is less CMake code.
Pull Request resolved: pytorch/pytorch#18548

Differential Revision: D14730790

Pulled By: ezyang

fbshipit-source-id: 70ae16832870d742c577c34a50ec7564c3da0afb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-this-please Was marked for merge with @pytorchbot merge this please open source

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants