-
Notifications
You must be signed in to change notification settings - Fork 705
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Disable bogus warning and workaround GCC destructor bug
- Loading branch information
Showing
3 changed files
with
69 additions
and
0 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
easybuild/easyconfigs/p/PyTorch/PyTorch-2.0.1_disable-gcc12-warning.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
GCC 12 has a false positive warning when compiled for some architectures, e.g. Intel Sapphire Rapids. | ||
See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112370 | ||
|
||
Suppress this warning such that the build doesn't error. | ||
|
||
Author: Alexander Grund (TU Dresden) | ||
|
||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index 471fc8a8d3d..5eb7b432630 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -557,6 +557,7 @@ string(APPEND CMAKE_CUDA_FLAGS " -Xfatbin -compress-all") | ||
if(NOT MSVC) | ||
string(APPEND CMAKE_CUDA_FLAGS_DEBUG " -g -lineinfo --source-in-ptx") | ||
string(APPEND CMAKE_CUDA_FLAGS_RELWITHDEBINFO " -g -lineinfo --source-in-ptx") | ||
+ append_cxx_flag_if_supported("-Wno-free-nonheap-object" CMAKE_CXX_FLAGS) | ||
endif(NOT MSVC) | ||
|
||
# Set INTERN_BUILD_MOBILE for all mobile builds. Components that are not | ||
diff --git a/cmake/public/utils.cmake b/cmake/public/utils.cmake | ||
index 60cca5383dd..76c02d7479f 100644 | ||
--- a/cmake/public/utils.cmake | ||
+++ b/cmake/public/utils.cmake | ||
@@ -548,6 +548,8 @@ function(torch_update_find_cuda_flags) | ||
endif() | ||
endfunction() | ||
|
||
+include(CheckCXXCompilerFlag) | ||
+ | ||
############################################################################## | ||
# CHeck if given flag is supported and append it to provided outputvar | ||
# Also define HAS_UPPER_CASE_FLAG_NAME variable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
easybuild/easyconfigs/p/PyTorch/PyTorch-2.1.0_disable-gcc12-warning.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
GCC 12 has a false positive warning when compiled for some architectures, e.g. Intel Sapphire Rapids. | ||
See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112370 | ||
|
||
Suppress this warning such that the build doesn't error. | ||
|
||
Author: Alexander Grund (TU Dresden) | ||
|
||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index 3a48eaf4e29..faa06c8177a 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -561,6 +561,7 @@ if(MSVC) | ||
string(APPEND CMAKE_CXX_FLAGS " /FS") | ||
string(APPEND CMAKE_CUDA_FLAGS " -Xcompiler /FS") | ||
endif(MSVC) | ||
+append_cxx_flag_if_supported("-Wno-free-nonheap-object" CMAKE_CXX_FLAGS) | ||
|
||
string(APPEND CMAKE_CUDA_FLAGS " -Xfatbin -compress-all") | ||
|
||
diff --git a/cmake/public/utils.cmake b/cmake/public/utils.cmake | ||
index 4d48c0f0f3d..bda17319ce7 100644 | ||
--- a/cmake/public/utils.cmake | ||
+++ b/cmake/public/utils.cmake | ||
@@ -533,6 +533,8 @@ function(torch_update_find_cuda_flags) | ||
endif() | ||
endfunction() | ||
|
||
+include(CheckCXXCompilerFlag) | ||
+ | ||
############################################################################## | ||
# CHeck if given flag is supported and append it to provided outputvar | ||
# Also define HAS_UPPER_CASE_FLAG_NAME variable |