Skip to content

Commit 1273b50

Browse files
jayhawk-commitsjharryma
authored andcommitted
Update workflows to gcc-toolset-13 and fix OpenBLAS build (#1746)
- Update workflows to use new manylinux docker image produced by #1745 - For Linux, turn on `DYNAMIC_ARCH` for OpenBLAS build to resolve #83. - `DYNAMIC_ARCH` support does not exist for MSVC and multi-arch support for Windows seems shoddy overall. [Reference 1](OpenMathLib/OpenBLAS#2826 (comment)) and [Reference 2](OpenMathLib/OpenBLAS#3985) - Remove usage of f2c version of an older lapack as it is considered fallback option. [Reference](OpenMathLib/OpenBLAS#4318 (comment)) - Patch amd-llvm compiler to be able to find stdc++ from gcc-toolset-13 during link time.
1 parent 92518a7 commit 1273b50

File tree

8 files changed

+46
-11
lines changed

8 files changed

+46
-11
lines changed

.github/workflows/build_portable_linux_artifacts.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
permissions:
4141
id-token: write
4242
container:
43-
image: ghcr.io/rocm/therock_build_manylinux_x86_64@sha256:2f3ebd0beb04c449fdb36933e54bdc69483b914fb9005594d3fc9444c206b54b
43+
image: ghcr.io/rocm/therock_build_manylinux_x86_64@sha256:4443d9d710b9471e8ef658d509358bd92602498e67161b9280474bce0bb0decd
4444
options: -v /runner/config:/home/awsconfig/
4545
env:
4646
AWS_SHARED_CREDENTIALS_FILE: /home/awsconfig/credentials.ini

.github/workflows/build_portable_linux_python_packages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
# Note: GitHub-hosted runners run out of disk space for some gpu families
4646
runs-on: ${{ github.repository_owner == 'ROCm' && 'azure-linux-scale-rocm' || 'ubuntu-24.04' }}
4747
env:
48-
BUILD_IMAGE: ghcr.io/rocm/therock_build_manylinux_x86_64@sha256:2f3ebd0beb04c449fdb36933e54bdc69483b914fb9005594d3fc9444c206b54b
48+
BUILD_IMAGE: ghcr.io/rocm/therock_build_manylinux_x86_64@sha256:4443d9d710b9471e8ef658d509358bd92602498e67161b9280474bce0bb0decd
4949
ARTIFACT_RUN_ID: "${{ inputs.artifact_run_id != '' && inputs.artifact_run_id || github.run_id }}"
5050
ARTIFACTS_DIR: "${{ github.workspace }}/artifacts"
5151
PACKAGES_DIR: "${{ github.workspace }}/packages"

.github/workflows/build_portable_linux_pytorch_wheels.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ jobs:
104104
name: Build | ${{ inputs.amdgpu_family }} | py ${{ inputs.python_version }} | torch ${{ inputs.pytorch_version }}
105105
runs-on: ${{ github.repository_owner == 'ROCm' && 'azure-linux-scale-rocm' || 'ubuntu-24.04' }}
106106
container:
107-
image: ghcr.io/rocm/therock_build_manylinux_x86_64@sha256:2f3ebd0beb04c449fdb36933e54bdc69483b914fb9005594d3fc9444c206b54b
107+
image: ghcr.io/rocm/therock_build_manylinux_x86_64@sha256:4443d9d710b9471e8ef658d509358bd92602498e67161b9280474bce0bb0decd
108108
env:
109109
OUTPUT_DIR: ${{ github.workspace }}/output
110110
PACKAGE_DIST_DIR: ${{ github.workspace }}/output/packages/dist

.github/workflows/release_portable_linux_packages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ jobs:
145145
env:
146146
TEATIME_LABEL_GH_GROUP: 1
147147
OUTPUT_DIR: ${{ github.workspace }}/output
148-
BUILD_IMAGE: ghcr.io/rocm/therock_build_manylinux_x86_64@sha256:2f3ebd0beb04c449fdb36933e54bdc69483b914fb9005594d3fc9444c206b54b
148+
BUILD_IMAGE: ghcr.io/rocm/therock_build_manylinux_x86_64@sha256:4443d9d710b9471e8ef658d509358bd92602498e67161b9280474bce0bb0decd
149149
DIST_ARCHIVE: "${{ github.workspace }}/output/therock-dist-linux-${{ matrix.target_bundle.amdgpu_family }}${{ inputs.package_suffix }}-${{ needs.setup_metadata.outputs.version }}.tar.gz"
150150
FILE_NAME: "therock-dist-linux-${{ matrix.target_bundle.amdgpu_family }}${{ inputs.package_suffix }}-${{ needs.setup_metadata.outputs.version }}.tar.gz"
151151
RELEASE_TYPE: "${{ needs.setup_metadata.outputs.release_type }}"

build_tools/linux_portable_build.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ def main(argv: list[str]):
128128
p.add_argument("--docker", default="docker", help="Docker or podman binary")
129129
p.add_argument(
130130
"--image",
131-
default="ghcr.io/rocm/therock_build_manylinux_x86_64@sha256:2f3ebd0beb04c449fdb36933e54bdc69483b914fb9005594d3fc9444c206b54b",
131+
default="ghcr.io/rocm/therock_build_manylinux_x86_64@sha256:4443d9d710b9471e8ef658d509358bd92602498e67161b9280474bce0bb0decd",
132132
help="Build docker image",
133133
)
134134
p.add_argument(

docs/environment_setup_guide.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ If having trouble building on a system, we will typically want to eliminate envi
5454
Our open-source binaries are typically built within a [manylinux container](https://github.com/pypa/manylinux) (see [the docker file](../dockerfiles/build_manylinux_x86_64.Dockerfile)). These images are versioned by the glibc version they target, and if dependencies are controlled carefully, binaries built on them should work on systems with the same or higher glibc version.
5555

5656
Present version: glibc 2.28
57-
Based on upstream: AlmaLinux 8 with gcc toolset 12
57+
Based on upstream: AlmaLinux 8 with gcc toolset 13
5858

5959
While this generally implies that the project should build on similarly versioned alternative EL distributions, do note that we install several upgraded tools (see dockerfile above) in our standard CI pipelines.
6060

61-
Reference image: `ghcr.io/rocm/therock_build_manylinux_x86_64@sha256:2f3ebd0beb04c449fdb36933e54bdc69483b914fb9005594d3fc9444c206b54b`
61+
Reference image: `ghcr.io/rocm/therock_build_manylinux_x86_64@sha256:4443d9d710b9471e8ef658d509358bd92602498e67161b9280474bce0bb0decd`
6262

6363
### Ubuntu 22.04
6464

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
From b58aca008a73e791872fe77858b7e5748f6b1508 Mon Sep 17 00:00:00 2001
2+
From: Joseph Macaranas <[email protected]>
3+
Date: Thu, 9 Oct 2025 23:49:19 -0400
4+
Subject: [PATCH] Add gcc-toolset-13 prefix detection
5+
6+
---
7+
clang/lib/Driver/ToolChains/Gnu.cpp | 1 +
8+
1 file changed, 1 insertion(+)
9+
10+
diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp
11+
index bf2a444520a2..fe2cb025a86c 100644
12+
--- a/clang/lib/Driver/ToolChains/Gnu.cpp
13+
+++ b/clang/lib/Driver/ToolChains/Gnu.cpp
14+
@@ -2441,6 +2441,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
15+
D.getVFS().exists("/opt/rh")) {
16+
// TODO: We may want to remove this, since the functionality
17+
// can be achieved using config files.
18+
+ Prefixes.push_back("/opt/rh/gcc-toolset-13/root/usr");
19+
Prefixes.push_back("/opt/rh/gcc-toolset-12/root/usr");
20+
Prefixes.push_back("/opt/rh/gcc-toolset-11/root/usr");
21+
Prefixes.push_back("/opt/rh/gcc-toolset-10/root/usr");
22+
--
23+
2.48.1
24+

third-party/host-blas/CMakeLists.txt

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,16 @@ if(NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
3030
TOUCH "${_download_stamp}"
3131
)
3232

33+
# MSVC does not support VLA and AT&T assembly which are required by DYNAMIC_ARCH
34+
# See: https://github.com/OpenMathLib/OpenBLAS/issues/2826#issuecomment-814170090
35+
# Multi-arch support on Windows seems to be a problem not limited to MSVC
36+
# See: https://github.com/OpenMathLib/OpenBLAS/issues/3985
37+
if(WIN32)
38+
set(_enable_dynamicArch "OFF")
39+
else()
40+
set(_enable_dynamicArch "ON")
41+
endif()
42+
3343
therock_cmake_subproject_declare(therock-host-blas
3444
BACKGROUND_BUILD
3545
EXCLUDE_FROM_ALL
@@ -45,10 +55,11 @@ if(NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
4555
CMAKE_ARGS
4656
"-DSOURCE_DIR=${_source_dir}"
4757
-DBUILD_SHARED_LIBS=ON
48-
# TODO: DYNAMIC_ARCH=ON produces illegal elf files
49-
# See: https://github.com/ROCm/TheRock/issues/83
50-
-DDYNAMIC_ARCH=OFF
51-
-DC_LAPACK=ON
58+
# https://github.com/OpenMathLib/OpenBLAS?tab=readme-ov-file#x86x86-64
59+
# Picking HASWELL as a baseline that supports modern AMD and Intel CPUs
60+
-DCMAKE_CROSSCOMPILING=ON
61+
-DTARGET=HASWELL
62+
-DDYNAMIC_ARCH=${_enable_dynamicArch}
5263
-DBUILD_TESTING=OFF
5364
EXTRA_DEPENDS
5465
"${_download_stamp}"

0 commit comments

Comments
 (0)