Skip to content

Commit 33a11af

Browse files
authored
Merge pull request #12026 from edgargabriel/topic/rocm-ldflags-libs
accelerator/rocm: fix ldflags and libs
2 parents f2d10ef + 0254552 commit 33a11af

File tree

4 files changed

+17
-23
lines changed

4 files changed

+17
-23
lines changed

.github/workflows/compile-rocm.yaml

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,26 @@ env:
66
ROCM_VER: 5-4
77
jobs:
88
compile-rocm:
9-
runs-on: ubuntu-20.04
9+
runs-on: ubuntu-22.04
1010
steps:
1111
- name: Install dependencies
1212
run: |
13-
sudo apt-get update
14-
sudo apt-get install -y --no-install-recommends wget lsb-core software-properties-common gpg curl
13+
sudo apt update
14+
sudo apt install -y --no-install-recommends wget lsb-core software-properties-common gpg curl
1515
- name: Install extra dependencies
1616
run: |
17-
curl -fsSL https://repo.radeon.com/rocm/rocm.gpg.key | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/rocm-keyring.gpg
18-
echo 'deb [arch=amd64 signed-by=/etc/apt/trusted.gpg.d/rocm-keyring.gpg] https://repo.radeon.com/rocm/apt/debian focal main' | sudo tee /etc/apt/sources.list.d/rocm.list
19-
sudo apt-get update
20-
sudo apt-get install -y rocm-hip-runtime
17+
sudo mkdir --parents --mode=0755 /etc/apt/keyrings
18+
wget https://repo.radeon.com/rocm/rocm.gpg.key -O - | gpg --dearmor | sudo tee /etc/apt/keyrings/rocm.gpg > /dev/null
19+
echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/amdgpu/5.7.1/ubuntu jammy main" | sudo tee /etc/apt/sources.list.d/amdgpu.list
20+
echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/rocm/apt/5.7.1 jammy main" | sudo tee --append /etc/apt/sources.list.d/rocm.list
21+
echo -e 'Package: *\nPin: release o=repo.radeon.com\nPin-Priority: 600' | sudo tee /etc/apt/preferences.d/rocm-pin-600
22+
sudo apt update
23+
sudo apt install -y rocm-hip-runtime
2124
- uses: actions/checkout@v3
2225
with:
2326
submodules: recursive
2427
- name: Build Open MPI
2528
run: |
2629
./autogen.pl
2730
./configure --prefix=${PWD}/install --with-rocm=/opt/rocm --disable-mpi-fortran
28-
make -j
29-
- name: Clean up
30-
run: |
31-
ls -la ./
32-
rm -rf ./*
33-
rm -rf ./.??*
34-
ls -la ./
31+
LD_LIBRARY_PATH=/opt/rocm/lib make -j

config/opal_check_rocm.m4

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ AC_DEFUN([OPAL_CHECK_ROCM],[
3636
[ with_rocm="/opt/rocm"] )
3737
3838
rocm_CPPFLAGS="-D__HIP_PLATFORM_AMD__"
39-
rocm_LDFLAGS="-L${with_rocm}/lib/hip"
39+
rocm_LDFLAGS="-L${with_rocm}/lib/"
4040
4141
AS_IF([ test -n "$with_rocm" && test "$with_rocm" != "no" ],
4242
[ OPAL_APPEND([CPPFLAGS], [$rocm_CPPFLAGS])
@@ -52,15 +52,11 @@ AC_DEFUN([OPAL_CHECK_ROCM],[
5252
5353
LDFLAGS="$rocm_save_LDFLAGS"
5454
LIBS="$rocm_save_LIBS"
55-
OPAL_APPEND([CPPFLAGS], [${$1_CPPFLAGS}] )
56-
OPAL_APPEND([LDFLAGS], [${$1_LDFLAGS}] )
57-
OPAL_APPEND([LIBS], [${$1_LIBS}] )
58-
59-
AS_IF([ test "$opal_check_rocm_happy" = "no" ],
60-
[ CPPFLAGS="$rocm_save_CPPFLAGS"])
55+
CPPFLAGS="$rocm_save_CPPFLAGS"
6156
6257
AS_IF([ test "$opal_check_rocm_happy" = "yes" ],
63-
[ AC_DEFINE_UNQUOTED([OPAL_ROCM_SUPPORT], [1], [Enable ROCm support])
58+
[ OPAL_APPEND([$1_CPPFLAGS], [$rocm_CPPFLAGS])
59+
AC_DEFINE_UNQUOTED([OPAL_ROCM_SUPPORT], [1], [Enable ROCm support])
6460
ROCM_SUPPORT=1 ],
6561
[ AC_DEFINE_UNQUOTED([OPAL_ROCM_SUPPORT], [0], [Disable ROCm support])
6662
ROCM_SUPPORT=0 ])

opal/mca/accelerator/rocm/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#
1414

1515

16-
AM_CPPFLAGS = $(common_rocm_CPPFLAGS)
16+
AM_CPPFLAGS = $(opal_rocm_CPPFLAGS)
1717

1818
sources = \
1919
accelerator_rocm.h \

opal/mca/accelerator/rocm/configure.m4

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,5 @@ AC_DEFUN([MCA_opal_accelerator_rocm_CONFIG],[
2424
[$2])
2525
AC_SUBST([opal_rocm_LDFLAGS])
2626
AC_SUBST([opal_rocm_LIBS])
27+
AC_SUBST([opal_rocm_CPPFLAGS])
2728
])dnl

0 commit comments

Comments
 (0)