Skip to content

Commit

Permalink
Fix for P10 using gcc-toolset-12 (#121)
Browse files Browse the repository at this point in the history
  • Loading branch information
Aman-Surkar authored Feb 2, 2024
1 parent fa074f0 commit 21dad05
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 9 deletions.
6 changes: 3 additions & 3 deletions pytorch-1.10/recipe/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ set -ex

if [[ $ppc_arch == "p10" ]]
then
if [[ -z "${GCC_11_HOME}" ]];
if [[ -z "${GCC_HOME}" ]];
then
echo "Please set GCC_11_HOME to the install path of gcc-toolset-11"
echo "Please set GCC_HOME to the install path of gcc-toolset-12"
exit 1
else
export PATH=${GCC_11_HOME}/bin/:$PATH
export PATH=${GCC_HOME}/bin/:$PATH
fi
fi

Expand Down
2 changes: 1 addition & 1 deletion pytorch-1.10/recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ build:
detect_binary_files_with_prefix: False
script_env:
- CUDA_HOME #[build_type == 'cuda']
- GCC_11_HOME #[ppc_arch == 'p10']
- GCC_HOME #[ppc_arch == 'p10']

test:
imports:
Expand Down
24 changes: 24 additions & 0 deletions pytorch-2.0/recipe/0311-Disabled-Wno-error-flag-for-p10.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
From b8ee69e58e07023d9ef1c0d15b3d2df2f8626de1 Mon Sep 17 00:00:00 2001
From: Aman-Surkar <aman_surkar@persistent.com>
Date: Tue, 30 Jan 2024 06:47:01 +0000
Subject: [PATCH] Disabled--Wno-error-flag-for-p10

---
test/cpp/api/CMakeLists.txt | 1 +
1 file changed, 1 insertion(+)

diff --git a/test/cpp/api/CMakeLists.txt b/test/cpp/api/CMakeLists.txt
index 6b801a07318..d65e0c8fc50 100644
--- a/test/cpp/api/CMakeLists.txt
+++ b/test/cpp/api/CMakeLists.txt
@@ -80,6 +80,7 @@ if(NOT MSVC)
target_compile_options_if_supported(test_api "-Wno-maybe-uninitialized")
# gcc gives nonsensical warnings about variadic.h
target_compile_options_if_supported(test_api "-Wno-unused-but-set-parameter")
+ target_compile_options_if_supported(test_api "-Wno-error=nonnull")
endif()

if(INSTALL_TEST)
--
2.40.1

6 changes: 3 additions & 3 deletions pytorch-2.0/recipe/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ set -ex

if [[ $ppc_arch == "p10" ]]
then
if [[ -z "${GCC_11_HOME}" ]];
if [[ -z "${GCC_HOME}" ]];
then
echo "Please set GCC_11_HOME to the install path of gcc-toolset-11"
echo "Please set GCC_HOME to the install path of gcc-toolset-12"
exit 1
else
export PATH=${GCC_11_HOME}/bin/:$PATH
export PATH=${GCC_HOME}/bin/:$PATH
rm ${PREFIX}/lib/libstdc++.so*
rm ${BUILD_PREFIX}/lib/libstdc++.so*
fi
Expand Down
5 changes: 3 additions & 2 deletions pytorch-2.0/recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ source:
- 0309-fallback-to-cpu_kernel-with-VSX.patch # [ppc64le]
# - 0302-cpp-extension.patch
- 0310-PR100149.patch #[ppc_arch == "p10"]
- 0311-Disabled-Wno-error-flag-for-p10.patch #[ppc_arch == "p10"]

requirements:
build:
Expand Down Expand Up @@ -83,7 +84,7 @@ requirements:
- tensorboard {{ tensorboard }}

build:
number: 1
number: 2
{% if build_type == 'cpu' %}
string: {{ build_type }}_py{{ python | replace(".", "") }}_pb{{ protobuf | replace(".*", "")}}_{{ PKG_BUILDNUM }}
{% else %}
Expand All @@ -92,7 +93,7 @@ build:
detect_binary_files_with_prefix: False
script_env:
- CUDA_HOME #[build_type == 'cuda']
- GCC_11_HOME #[ppc_arch == 'p10']
- GCC_HOME #[ppc_arch == 'p10']

test:
imports:
Expand Down

0 comments on commit 21dad05

Please sign in to comment.