Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#65501 closed defect (fixed)

py-pytorch @1.12.0: builds failing for big sur and monterey: error: unknown warning option '-Wno-unused-but-set-variable'

Reported by: mascguy (Christopher Nielsen) Owned by: mascguy (Christopher Nielsen)
Priority: Normal Milestone:
Component: ports Version: 2.7.2
Keywords: bigsur monterey Cc: cjones051073 (Chris Jones)
Port: py-pytorch

Description

Similar issue, relative to what we've dealt with previously in other ports.

error: unknown warning option '-Wno-unused-but-set-variable'; did you mean '-Wno-unused-const-variable'? [-Werror,-Wunknown-warning-option]
make[2]: *** [third_party/fbgemm/asmjit/CMakeFiles/asmjit.dir/src/asmjit/core/archtraits.cpp.o] Error 1

There are also various CMake warnings, though those are also seen elsewhere without failure.

More digging needed.

Change History (4)

comment:1 Changed 2 years ago by mascguy (Christopher Nielsen)

Owner: set to mascguy
Status: newassigned

Tracked by upstream issue:

74805 - Failure to build with clang because of unknown warning option error

Apparently Clang 13 did recognize this warning originally, but it was ultimately reverted:

https://reviews.llvm.org/rG6d8d1338629ceeaf6f56dc9eabc72e1a63f05169

In any case, the reporter suggested the following patch. Assuming it works locally for Big Sur and Monterey, I'll commit the fix.

diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake
index ba2e71211f..f68cec720d 100644
--- a/cmake/Dependencies.cmake
+++ b/cmake/Dependencies.cmake
@@ -818,7 +818,7 @@ if(USE_FBGEMM)
     set_property(TARGET fbgemm PROPERTY POSITION_INDEPENDENT_CODE ON)
     if("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 13.0.0)
         # See https://github.com/pytorch/pytorch/issues/74352
-        target_compile_options(asmjit PRIVATE -Wno-deprecated-copy -Wno-unused-but-set-variable)
+        target_compile_options(asmjit PRIVATE -Wno-deprecated-copy)
     endif()
   endif()

comment:2 Changed 2 years ago by mascguy (Christopher Nielsen)

Upstream has committed two formal fixes to master - with the second further tweaking the logic - so we'll use the end result of these:

The subsequent PR - correcting the first - is:

Last edited 2 years ago by mascguy (Christopher Nielsen) (previous) (diff)

comment:3 Changed 2 years ago by Christopher Nielsen <mascguy@…>

Resolution: fixed
Status: assignedclosed

In 270c13b905d57c46140d87b5fc32b3817280dbef/macports-ports (master):

py-pytorch: patch for clang 13 unused-but-set-variable
Fixes: #65501

comment:4 Changed 2 years ago by jmroot (Joshua Root)

This sort of thing is why we prefer to not use -Werror for port builds.

Note: See TracTickets for help on using tickets.