Skip to content

Commit 4d73198

Browse files
committed
Add check for hipcc
Signed-off-by: Joseph Schuchart <[email protected]>
1 parent 5fbc2d4 commit 4d73198

File tree

4 files changed

+64
-21
lines changed

4 files changed

+64
-21
lines changed

config/opal_check_hipcc.m4

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
dnl -*- autoconf -*-
2+
dnl
3+
dnl Copyright (c) 2024 Stony Brook University. All rights reserved.
4+
dnl
5+
dnl $COPYRIGHT$
6+
dnl
7+
dnl Additional copyrights may follow
8+
dnl
9+
dnl $HEADER$
10+
dnl
11+
12+
dnl
13+
dnl Check for HIPCC and bail out if HIPCC was requested
14+
dnl Options provided:
15+
dnl --with-hipcc[=path/to/hipcc]: provide a path to HIPCC
16+
dnl --enable-hipcc: require HIPCC, bail out if not found
17+
dnl
18+
19+
AC_DEFUN([OPAL_CHECK_HIPCC],[
20+
21+
# This option is probably only helpful to developers: have
22+
# configure fail if Sphinx is not found (i.e., if you don't have
23+
# the ability to use Sphinx to build the HTML docs and man pages).
24+
AC_ARG_ENABLE([hipcc],
25+
[AS_HELP_STRING([--enable-hipcc],
26+
[Force configure to fail if CUDA hipcc is not found (CUDA hipcc is used to build CUDA operator support).])])
27+
28+
AC_ARG_WITH([hipcc],
29+
[AS_HELP_STRING([--with-hipcc=DIR],
30+
[Path to the CUDA compiler])])
31+
32+
AS_IF([test -n "$with_hipcc"],
33+
[OPAL_HIPCC=$with_hipcc],
34+
# no path specified, try to find hipcc
35+
[AC_PATH_PROG([OPAL_HIPCC], [hipcc], [])])
36+
37+
# If the user requested to disable sphinx, then pretend we didn't
38+
# find it.
39+
AS_IF([test "$enable_hipcc" = "no"],
40+
[OPAL_HIPCC=])
41+
42+
# If --enable-sphinx was specified and we did not find Sphinx,
43+
# abort. This is likely only useful to prevent "oops!" moments
44+
# from developers.
45+
AS_IF([test -z "$OPAL_HIPCC" && test "$enable_hipcc" = "yes"],
46+
[AC_MSG_WARN([A suitable CUDA compiler was not found, but --enable-hipcc was specified])
47+
AC_MSG_ERROR([Cannot continue])])
48+
49+
OPAL_SUMMARY_ADD([Accelerators], [HIPCC compiler], [], [$OPAL_HIPCC])
50+
51+
])

config/opal_check_nvcc.m4

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
dnl -*- autoconf -*-
22
dnl
3-
dnl Copyright (c) 2020-2022 Cisco Systems, Inc. All rights reserved.
4-
dnl Copyright (c) 2024 Jeffrey M. Squyres. All rights reserved.
3+
dnl Copyright (c) 2024 Stony Brook University. All rights reserved.
54
dnl
65
dnl $COPYRIGHT$
76
dnl
@@ -10,26 +9,16 @@ dnl
109
dnl $HEADER$
1110
dnl
1211

13-
dnl Setup Sphinx for building HTML docs and man pages
1412
dnl
15-
dnl 1 -> sanity file to check if pre-built docs are already available
16-
dnl You probably want to pass something like
17-
dnl "$srcdir/docs/_build/man/foo.1"
13+
dnl Check for NVCC and bail out if NVCC was requested
14+
dnl Options provided:
15+
dnl --with-nvcc[=path/to/nvcc]: provide a path to NVCC
16+
dnl --enable-nvcc: require NVCC, bail out if not found
17+
dnl --nvcc-compute-arch: request a specific compute
18+
dnl architecture for the operator
19+
dnl kernels
1820
dnl
19-
dnl 2 -> (OPTIONAL) URL to display in AC_MSG_WARN when docs will not be installed
20-
dnl If $2 is empty, nothing will be displayed.
21-
dnl Note: if $2 contains a #, be sure to double quote it
22-
dnl (e.g., [[https://example.com/foo.html#some-anchor]])
23-
dnl
24-
dnl 3 -> (OPTIONAL) Filename of requirements.txt-like file containing
25-
dnl the required Pip modules (to be displayed if rendering a
26-
dnl simple RST project fails).
27-
dnl
28-
dnl This macro requires that OAC_PUSH_PREFIX was previously called.
29-
dnl The pushed prefix may be used if this macro chooses to set {OAC
30-
dnl prefix}_MAKEDIST_DISABLE. If set, it is a message indicating why
31-
dnl "make dist" should be disabled, suitable for emitting via
32-
dnl AC_MSG_WARN.
21+
3322
AC_DEFUN([OPAL_CHECK_NVCC],[
3423
3524
# This option is probably only helpful to developers: have

ompi/mca/op/rocm/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ rocm_sources = op_rocm_impl.hip
2626

2727
HIPCC = hipcc
2828

29-
.cpp.l$(OBJEXT):
29+
.hip.l$(OBJEXT):
3030
$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
3131
$(LIBTOOLFLAGS) --mode=compile $(HIPCC) -O2 -std=c++17 -fvectorize -prefer-non-pic -Wc,-fPIC,-g -c $<
3232

ompi/mca/op/rocm/configure.m4

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ AC_DEFUN([MCA_ompi_op_rocm_CONFIG],[
2424
AC_CONFIG_FILES([ompi/mca/op/rocm/Makefile])
2525

2626
OPAL_CHECK_ROCM([op_rocm])
27+
OPAL_CHECK_HIPCC([op_hipcc])
2728

2829
AS_IF([test "x$ROCM_SUPPORT" = "x1"],
2930
[$1],
@@ -33,4 +34,6 @@ AC_DEFUN([MCA_ompi_op_rocm_CONFIG],[
3334
AC_SUBST([op_rocm_LDFLAGS])
3435
AC_SUBST([op_rocm_LIBS])
3536

37+
AC_SUBST([OPAL_HIPCC])
38+
3639
])dnl

0 commit comments

Comments
 (0)