Skip to content

Let Python build scripts accept both CMAKE_BUILD_TYPE and the oldschool DEBUG and REL_WITH_DEB_INFO variables. - #22875

Closed
xuhdev wants to merge 3 commits into
pytorch:masterfrom
xuhdev:build/emanicipate-build-type
Closed

xuhdev wants to merge 3 commits into
pytorch:masterfrom
xuhdev:build/emanicipate-build-type

Conversation

@xuhdev

@xuhdev xuhdev commented Jul 15, 2019

Copy link
Copy Markdown
Collaborator

Currently the build type is decided by the environment variable DEBUG
and REL_WITH_DEB_INFO. This commit also lets CMAKE_BUILD_TYPE be
effective. This makes the interface more consistent with CMake. This
also prepares #22776.

@pytorchbot pytorchbot added the module: build Build system issues label Jul 15, 2019
@xuhdev
xuhdev requested a review from ezyang July 15, 2019 19:44
@xuhdev xuhdev changed the title Let Python build scripts accept both CMAKE_BUILD_TYPE and the oldschool DEBUG variable. Let Python build scripts accept both CMAKE_BUILD_TYPE and the oldschool DEBUG and REL_WITH_DEB_INFO variables. Jul 15, 2019
ezyang
ezyang previously approved these changes Jul 16, 2019

@facebook-github-bot facebook-github-bot 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.

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

@xuhdev

xuhdev commented Jul 16, 2019

Copy link
Copy Markdown
Collaborator Author

@pytorchbot rebase this please

2 similar comments
@xuhdev

xuhdev commented Jul 17, 2019

Copy link
Copy Markdown
Collaborator Author

@pytorchbot rebase this please

@xuhdev

xuhdev commented Jul 19, 2019

Copy link
Copy Markdown
Collaborator Author

@pytorchbot rebase this please

@ezyang

ezyang commented Jul 22, 2019

Copy link
Copy Markdown
Contributor

I think the Windows error is real:

08:40:21        "C:\Jenkins\workspace\caffe2-builds\py2-cuda9.0-cudnn7-windows-build\build\install.vcxproj" (default target) (1) ->
08:40:21        "C:\Jenkins\workspace\caffe2-builds\py2-cuda9.0-cudnn7-windows-build\build\ALL_BUILD.vcxproj" (default target) (3) ->
08:40:21        "C:\Jenkins\workspace\caffe2-builds\py2-cuda9.0-cudnn7-windows-build\build\caffe2\Dict_test.vcxproj" (default target) (10) ->
08:40:21        "C:\Jenkins\workspace\caffe2-builds\py2-cuda9.0-cudnn7-windows-build\build\caffe2\torch.vcxproj" (default target) (47) ->
08:40:21        (ClCompile target) -> 
08:40:21          cl : Command line error D8016: '/Ox' and '/RTC1' command-line options are incompatible [C:\Jenkins\workspace\caffe2-builds\py2-cuda9.0-cudnn7-windows-build\build\caffe2\torch.vcxproj]
08:40:21 

@xuhdev
xuhdev force-pushed the build/emanicipate-build-type branch from 878fd23 to 2edb553 Compare July 22, 2019 18:52
@xuhdev
xuhdev requested a review from ezyang July 22, 2019 18:52
@xuhdev

xuhdev commented Jul 22, 2019

Copy link
Copy Markdown
Collaborator Author

@ezyang The reason it failed before is that the CI uses an IDE project file (i.e., VStudio) on Windows, which is a multi-configuration native build system. For such a project file, CMAKE_BUILD_TYPE set in CMakeCache.txt won't be effective, while it is effective for single-configuration native build system such as Makefile. For a multi-configuration native build system, --config must be passed to determine which build type to use. Previously, I removed --config in the build command, and that's why on Windows things are messed.

Here is a useful explanation for the underlying story: https://stackoverflow.com/a/24470998/1150462

@xuhdev

xuhdev commented Jul 22, 2019 •

Copy link
Copy Markdown
Collaborator Author

The latest error doesn't seem related

…ol DEBUG variable.

Currently the build type is decided by the environment variable DEBUG
and REL_WITH_DEB_INFO. This commit also lets CMAKE_BUILD_TYPE be
effective. This makes the interface more consistent with CMake. This
also prepares pytorch#22776.
@xuhdev
xuhdev force-pushed the build/emanicipate-build-type branch from 2edb553 to 15711bd Compare July 22, 2019 20:19
@xuhdev

xuhdev commented Jul 22, 2019

Copy link
Copy Markdown
Collaborator Author

@pytorchbot rebase this please

@xuhdev

xuhdev commented Jul 23, 2019

Copy link
Copy Markdown
Collaborator Author

@pytorchbot rebase this please

@facebook-github-bot facebook-github-bot 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.

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

@facebook-github-bot

Copy link
Copy Markdown
Contributor

@ezyang merged this pull request in fd1d06e.

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