From 01a7ca3d6402bec2cf3faacc0f15e4ce18805e52 Mon Sep 17 00:00:00 2001 From: Mingzhe Li Date: Mon, 9 Jul 2018 15:34:11 -0700 Subject: [PATCH] Fix Pytorch Mac build issues (#9283) Summary: Breaking this out of #8338 This fixed Mac build issues after BUILD_CAFFE2 and BUILD_ATEN are removed. cc orionr Pull Request resolved: https://github.com/pytorch/pytorch/pull/9283 Reviewed By: orionr Differential Revision: D8773459 Pulled By: mingzhe09088 fbshipit-source-id: 71942e8e6891a625e6b1a7dc0160e87444c64209 --- CMakeLists.txt | 6 +++++- caffe2/core/net_async_polling.h | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d51529dcfe8..aa943e43789 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -219,9 +219,13 @@ if(NOT MSVC) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-private-field") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-inconsistent-missing-override") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-aligned-allocation-unavailable") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-c++14-extensions") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-constexpr-not-const") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-missing-braces") endif() if ((APPLE AND (NOT ("${CLANG_VERSION_STRING}" VERSION_LESS "9.0"))) - OR (CMAKE_COMPILER_IS_GNUCXX AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0))) + OR (CMAKE_COMPILER_IS_GNUCXX + AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0 AND NOT APPLE))) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -faligned-new") endif() if ($ENV{WERROR}) diff --git a/caffe2/core/net_async_polling.h b/caffe2/core/net_async_polling.h index 570d0ec9247..dc807bb04b0 100644 --- a/caffe2/core/net_async_polling.h +++ b/caffe2/core/net_async_polling.h @@ -37,7 +37,7 @@ class AsyncPollingNet : public AsyncNetBase { // Polling std::vector status_; - void reset(); + void reset() override; std::atomic has_chain_failed_; DISABLE_COPY_AND_ASSIGN(AsyncPollingNet);