From e373ed7e0bcdce1f75bcd1ea8d32acfa91dab7ab Mon Sep 17 00:00:00 2001 From: sfilippone Date: Fri, 1 Dec 2023 15:10:39 +0100 Subject: [PATCH] Modify configry to only use HAVE_CUDA, since SPGU is recompiled. --- Make.inc.in | 1 - config/pac.m4 | 2 +- configure | 59 +++++++++++++++++++++++++++------------------------ configure.ac | 59 ++++++++++++++++++++++++++------------------------- 4 files changed, 62 insertions(+), 59 deletions(-) diff --git a/Make.inc.in b/Make.inc.in index 6a4b378d..858ad336 100755 --- a/Make.inc.in +++ b/Make.inc.in @@ -72,7 +72,6 @@ CUDALD=@CUDALD@ LCUDA=@LCUDA@ SPGPU_LIBS=@SPGPU_LIBS@ -SPGPU_DEFINES=@SPGPU_DEFINES@ CUDA_DIR=@CUDA_DIR@ CUDA_DEFINES=@CUDA_DEFINES@ diff --git a/config/pac.m4 b/config/pac.m4 index e4065402..52185439 100644 --- a/config/pac.m4 +++ b/config/pac.m4 @@ -2104,7 +2104,7 @@ dnl dnl @author Salvatore Filippone dnl AC_DEFUN(PAC_CHECK_CUDA, -[AC_ARG_WITH(cuda, AC_HELP_STRING([--with-cuda=DIR], [Specify the directory for CUDA library and includes.]), +[AC_ARG_WITH(cuda, AC_HELP_STRING([--with-cuda=DIR], [Specify the CUDA install directory.]), [pac_cv_cuda_dir=$withval], [pac_cv_cuda_dir='']) diff --git a/configure b/configure index b98c6ca0..48487f98 100755 --- a/configure +++ b/configure @@ -665,7 +665,6 @@ CUDA_INCLUDES CUDA_DEFINES CUDA_DIR EXTRALDLIBS -SPGPU_DEFINES SPGPU_LIBS SPGPU_FLAGS METISINCFILE @@ -1533,7 +1532,7 @@ Optional Packages: --with-amddir=DIR Specify the directory for AMD library and includes. --with-amdincdir=DIR Specify the directory for AMD includes. --with-amdlibdir=DIR Specify the directory for AMD library. - --with-cuda=DIR Specify the directory for CUDA library and includes. + --with-cuda=DIR Specify the CUDA install directory. --with-cudacc A comma-separated list of CCs to compile to, for example, --with-cudacc=50,60,70,75 @@ -10678,7 +10677,7 @@ CPPFLAGS="$SAVE_CPPFLAGS" if test "x$pac_cv_have_cuda" == "xyes"; then -ac_ext=c + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' @@ -10809,17 +10808,15 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu LIBS="$SAVE_LIBS" CPPFLAGS="$SAVE_CPPFLAGS" -CUDA_VERSION="$pac_cv_cuda_version"; -CUDA_SHORT_VERSION=$(expr $pac_cv_cuda_version / 1000); -if test "x$pac_cv_have_cuda" == "xyes" ; then - SPGPU_DEFINES="-DHAVE_SPGPU -DHAVE_GPU"; + CUDA_VERSION="$pac_cv_cuda_version"; + CUDA_SHORT_VERSION=$(expr $pac_cv_cuda_version / 1000); + HAVE_CUDA="yes"; SPGPU_LIBS="-lspgpu"; CUDAD=cudad; CUDALD=cudald; LCUDA="-lpsb_cuda"; EXTRALDLIBS="-lstdc++"; -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: At this point GPUTARGET is $CUDAD $CUDALD" >&5 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: At this point GPUTARGET is $CUDAD $CUDALD" >&5 printf "%s\n" "$as_me: At this point GPUTARGET is $CUDAD $CUDALD" >&6;} @@ -10833,26 +10830,27 @@ else $as_nop fi -if test "x$pac_cv_cudacc" == "x"; then - pac_cv_cudacc="30,35,37,50,60"; -fi -CUDEFINES="--dopt=on"; -for cc in `echo $pac_cv_cudacc|sed 's/,/ /gi'` -do - CUDEFINES="$CUDEFINES -gencode arch=compute_$cc,code=sm_$cc"; -done -if test "x$pac_cv_cuda_version" != "xunknown"; then - CUDEFINES="$CUDEFINES -DCUDA_SHORT_VERSION=${CUDA_SHORT_VERSION} -DCUDA_VERSION=${CUDA_VERSION}" - FDEFINES="$FDEFINES -DCUDA_SHORT_VERSION=${CUDA_SHORT_VERSION} -DCUDA_VERSION=${CUDA_VERSION}" - CDEFINES="$CDEFINES -DCUDA_SHORT_VERSION=${CUDA_SHORT_VERSION} -DCUDA_VERSION=${CUDA_VERSION}" -fi - + if test "x$pac_cv_cudacc" == "x"; then + pac_cv_cudacc="50,60,70,75"; + CUDA_CC="$pac_cv_cudacc"; + fi + CUDEFINES="--dopt=on"; + for cc in `echo $pac_cv_cudacc|sed 's/,/ /gi'` + do + CUDEFINES="$CUDEFINES -gencode arch=compute_$cc,code=sm_$cc"; + done + if test "x$pac_cv_cuda_version" != "xunknown"; then + CUDEFINES="$CUDEFINES -DCUDA_SHORT_VERSION=${CUDA_SHORT_VERSION} -DCUDA_VERSION=${CUDA_VERSION}" + FDEFINES="$FDEFINES -DCUDA_SHORT_VERSION=${CUDA_SHORT_VERSION} -DCUDA_VERSION=${CUDA_VERSION}" + CDEFINES="$CDEFINES -DCUDA_SHORT_VERSION=${CUDA_SHORT_VERSION} -DCUDA_VERSION=${CUDA_VERSION}" + fi fi if test "x$pac_cv_ipk_size" != "x4"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: For CUDA I need psb_ipk_ to be 4 bytes but it is $pac_cv_ipk_size, disabling CUDA/SPGPU" >&5 printf "%s\n" "$as_me: For CUDA I need psb_ipk_ to be 4 bytes but it is $pac_cv_ipk_size, disabling CUDA/SPGPU" >&6;} - SPGPU_DEFINES=""; + HAVE_CUDA="no"; + CUDA_CC=""; SPGPU_LIBS=""; CUDAD=""; CUDALD=""; @@ -10921,9 +10919,9 @@ UTILLIBNAME=libpsb_util.a PSBLASRULES=' PSBLDLIBS=$(LAPACK) $(BLAS) $(METIS_LIB) $(AMD_LIB) $(LIBS) -CXXDEFINES=$(PSBCXXDEFINES) $(SPGPU_DEFINES) $(CUDA_DEFINES) -CDEFINES=$(PSBCDEFINES) $(SPGPU_DEFINES) $(CUDA_DEFINES) -FDEFINES=$(PSBFDEFINES) $(SPGPU_DEFINES) $(CUDA_DEFINES) +CXXDEFINES=$(PSBCXXDEFINES) $(CUDA_DEFINES) +CDEFINES=$(PSBCDEFINES) $(CUDA_DEFINES) +FDEFINES=$(PSBFDEFINES) $(CUDA_DEFINES) # These should be portable rules, arent they? @@ -10957,7 +10955,6 @@ FDEFINES=$(PSBFDEFINES) $(SPGPU_DEFINES) $(CUDA_DEFINES) - ############################################################################### @@ -12290,6 +12287,9 @@ fi FCOPT : ${FCOPT} CCOPT : ${CCOPT} + CUDA : ${HAVE_CUDA} + CUDA_CC : ${CUDA_CC} + BLAS : ${BLAS_LIBS} METIS usable : ${psblas_cv_have_metis} @@ -12320,6 +12320,9 @@ printf "%s\n" "$as_me: FCOPT : ${FCOPT} CCOPT : ${CCOPT} + CUDA : ${HAVE_CUDA} + CUDA_CC : ${CUDA_CC} + BLAS : ${BLAS_LIBS} METIS usable : ${psblas_cv_have_metis} diff --git a/configure.ac b/configure.ac index add09a79..4b76485b 100755 --- a/configure.ac +++ b/configure.ac @@ -793,41 +793,40 @@ fi PAC_CHECK_CUDA() if test "x$pac_cv_have_cuda" == "xyes"; then - -PAC_CHECK_CUDA_VERSION() -CUDA_VERSION="$pac_cv_cuda_version"; -CUDA_SHORT_VERSION=$(expr $pac_cv_cuda_version / 1000); -dnl PAC_CHECK_SPGPU() -if test "x$pac_cv_have_cuda" == "xyes" ; then - SPGPU_DEFINES="-DHAVE_SPGPU -DHAVE_GPU"; + + PAC_CHECK_CUDA_VERSION() + CUDA_VERSION="$pac_cv_cuda_version"; + CUDA_SHORT_VERSION=$(expr $pac_cv_cuda_version / 1000); + dnl PAC_CHECK_SPGPU() + HAVE_CUDA="yes"; SPGPU_LIBS="-lspgpu"; CUDAD=cudad; CUDALD=cudald; LCUDA="-lpsb_cuda"; EXTRALDLIBS="-lstdc++"; -fi -AC_MSG_NOTICE([At this point GPUTARGET is $CUDAD $CUDALD]) - -PAC_ARG_WITH_CUDACC() -if test "x$pac_cv_cudacc" == "x"; then - pac_cv_cudacc="30,35,37,50,60"; -fi -CUDEFINES="--dopt=on"; -for cc in `echo $pac_cv_cudacc|sed 's/,/ /gi'` -do - CUDEFINES="$CUDEFINES -gencode arch=compute_$cc,code=sm_$cc"; -done -if test "x$pac_cv_cuda_version" != "xunknown"; then - CUDEFINES="$CUDEFINES -DCUDA_SHORT_VERSION=${CUDA_SHORT_VERSION} -DCUDA_VERSION=${CUDA_VERSION}" - FDEFINES="$FDEFINES -DCUDA_SHORT_VERSION=${CUDA_SHORT_VERSION} -DCUDA_VERSION=${CUDA_VERSION}" - CDEFINES="$CDEFINES -DCUDA_SHORT_VERSION=${CUDA_SHORT_VERSION} -DCUDA_VERSION=${CUDA_VERSION}" -fi + AC_MSG_NOTICE([At this point GPUTARGET is $CUDAD $CUDALD]) + PAC_ARG_WITH_CUDACC() + if test "x$pac_cv_cudacc" == "x"; then + pac_cv_cudacc="50,60,70,75"; + CUDA_CC="$pac_cv_cudacc"; + fi + CUDEFINES="--dopt=on"; + for cc in `echo $pac_cv_cudacc|sed 's/,/ /gi'` + do + CUDEFINES="$CUDEFINES -gencode arch=compute_$cc,code=sm_$cc"; + done + if test "x$pac_cv_cuda_version" != "xunknown"; then + CUDEFINES="$CUDEFINES -DCUDA_SHORT_VERSION=${CUDA_SHORT_VERSION} -DCUDA_VERSION=${CUDA_VERSION}" + FDEFINES="$FDEFINES -DCUDA_SHORT_VERSION=${CUDA_SHORT_VERSION} -DCUDA_VERSION=${CUDA_VERSION}" + CDEFINES="$CDEFINES -DCUDA_SHORT_VERSION=${CUDA_SHORT_VERSION} -DCUDA_VERSION=${CUDA_VERSION}" + fi fi if test "x$pac_cv_ipk_size" != "x4"; then AC_MSG_NOTICE([For CUDA I need psb_ipk_ to be 4 bytes but it is $pac_cv_ipk_size, disabling CUDA/SPGPU]) - SPGPU_DEFINES=""; + HAVE_CUDA="no"; + CUDA_CC=""; SPGPU_LIBS=""; CUDAD=""; CUDALD=""; @@ -896,9 +895,9 @@ AC_SUBST(FINCLUDES) PSBLASRULES=' PSBLDLIBS=$(LAPACK) $(BLAS) $(METIS_LIB) $(AMD_LIB) $(LIBS) -CXXDEFINES=$(PSBCXXDEFINES) $(SPGPU_DEFINES) $(CUDA_DEFINES) -CDEFINES=$(PSBCDEFINES) $(SPGPU_DEFINES) $(CUDA_DEFINES) -FDEFINES=$(PSBFDEFINES) $(SPGPU_DEFINES) $(CUDA_DEFINES) +CXXDEFINES=$(PSBCXXDEFINES) $(CUDA_DEFINES) +CDEFINES=$(PSBCDEFINES) $(CUDA_DEFINES) +FDEFINES=$(PSBFDEFINES) $(CUDA_DEFINES) # These should be portable rules, arent they? @@ -923,7 +922,6 @@ AC_SUBST(METISINCFILE) AC_SUBST(SPGPU_FLAGS) AC_SUBST(SPGPU_LIBS) dnl AC_SUBST(SPGPU_DIR) -AC_SUBST(SPGPU_DEFINES) dnl AC_SUBST(SPGPU_INCLUDES) dnl AC_SUBST(SPGPU_INCDIR) AC_SUBST(EXTRALDLIBS) @@ -962,6 +960,9 @@ AC_MSG_NOTICE([ FCOPT : ${FCOPT} CCOPT : ${CCOPT} + CUDA : ${HAVE_CUDA} + CUDA_CC : ${CUDA_CC} + BLAS : ${BLAS_LIBS} METIS usable : ${psblas_cv_have_metis}