Skip to content

Fix build error mkldnn due to corruptted CMAKE_REQUIRED_LIBRARIES#12195

Closed
Jianhui-Li wants to merge 1 commit intopytorch:masterfrom
Jianhui-Li:fix_build
Closed

Fix build error mkldnn due to corruptted CMAKE_REQUIRED_LIBRARIES#12195
Jianhui-Li wants to merge 1 commit intopytorch:masterfrom
Jianhui-Li:fix_build

Conversation

@Jianhui-Li
Copy link

This is to fix cmake-time compilation error.

When we change script to build Caffe2 with mkldnn, we run into some cmake-time compilation support check (like in libsleef) failed due to incorrect setting of CMAKE_REQUIRED_LIBRARIES. It is a global setting which can interfere camke compilation if it is not clean up properly. FindBLAS.cmake and FindLAPACK.cmake didn't clean this flag, and causes incorrect building of libsleef.so.

@yinghai @gujinghui

Signed-off-by: Gu, Jinghui <jinghui.gu@intel.com>
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.

yinghai has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@yinghai
Copy link
Contributor

yinghai commented Oct 3, 2018

@gujinghui Could you describe how to reproduce the error you saw?

@orionr Does this look good to you?

@yinghai yinghai requested a review from orionr October 3, 2018 04:31
Copy link
Contributor

@orionr orionr left a comment

Choose a reason for hiding this comment

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

Thank you for this! Looks good. Also seems like this has already been fixed in the upstream location (I didn't check everything, but a spot check seemed to match) at https://github.com/Kitware/CMake/blob/master/Modules/FindBLAS.cmake and https://github.com/Kitware/CMake/blob/master/Modules/FindLAPACK.cmake

zdevito pushed a commit to zdevito/ATen that referenced this pull request Oct 4, 2018
…2195)

Summary:
This is to fix cmake-time compilation error.

 When we change script to build Caffe2 with mkldnn, we run into some cmake-time compilation support check (like in libsleef) failed due to incorrect setting of CMAKE_REQUIRED_LIBRARIES.  It is a global setting which can interfere camke compilation if it is not clean up properly.  FindBLAS.cmake and FindLAPACK.cmake didn't clean this flag, and causes incorrect building of libsleef.so.

yinghai gujinghui
Pull Request resolved: pytorch/pytorch#12195

Differential Revision: D10159314

Pulled By: yinghai

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants