Skip to content

Commit 0254552

Browse files
committed
accelerator/rocm: update configure logic and Makefile
update configure and compile logic to avoid adding hip libraries to the generic Open MPI LIBS. Signed-off-by: Edgar Gabriel <Edgar.Gabriel@amd.com>
1 parent 2a93bda commit 0254552

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

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)