-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Remove config.h.in file from version control * Remove autogen script * Add with-hypre-dir option * Update install instructions * Check for srun or mpirun * Improve checking for dependency libraries
- Loading branch information
Showing
7 changed files
with
134 additions
and
184 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
AC_PREREQ([2.69]) | ||
AC_INIT([hypredrive], [0.1], [[email protected]]) | ||
AC_INIT([hypredrive], | ||
[0.1], | ||
[https://github.com/hypre-space/hypredrive/issues], | ||
[hypredrive], | ||
[https://github.com/hypre-space/hypredrive]) | ||
AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects]) | ||
|
||
dnl Include m4 macros | ||
|
@@ -32,17 +36,29 @@ AM_PROG_CC_C_O() | |
AM_PROG_AR | ||
LT_INIT([disable-shared]) | ||
|
||
dnl Specify hypre include directory | ||
AC_ARG_WITH([hypre-include], | ||
[AS_HELP_STRING([--with-hypre-include=DIR], [Required: Path to HYPRE include dir.])], | ||
[CFLAGS+=" -I$withval"], | ||
[AC_MSG_ERROR([--with-hypre-include=DIR is required. Please specify the path to the HYPRE include directory.])]) | ||
dnl Check for --with-hypre-dir first | ||
AC_ARG_WITH([hypre-dir], | ||
[AS_HELP_STRING([--with-hypre-dir=DIR], [Optional: Path to HYPRE directory. Specifies both include and library dirs.])], | ||
[ | ||
CFLAGS+=" -I$withval/include" | ||
LDFLAGS+=" -L$withval/lib -Wl,-rpath,$withval/lib" | ||
]) | ||
|
||
dnl Specify hypre include directory only if hypre-dir is not specified | ||
AS_IF([test -z "$with_hypre_dir"], [ | ||
AC_ARG_WITH([hypre-include], | ||
[AS_HELP_STRING([--with-hypre-include=DIR], [Required if --with-hypre-dir is not specified: Path to HYPRE include dir.])], | ||
[CFLAGS+=" -I$withval"], | ||
[AC_MSG_ERROR([--with-hypre-include=DIR or --with-hypre-dir=DIR is required. Please specify the path to the HYPRE include directory.])]) | ||
]) | ||
|
||
dnl Specify hypre lib directory | ||
AC_ARG_WITH([hypre-lib], | ||
[AS_HELP_STRING([--with-hypre-lib=DIR], [Required: Path to HYPRE library dir.])], | ||
[LDFLAGS+=" -L$withval -Wl,-rpath,${withval}"], | ||
[AC_MSG_ERROR([--with-hypre-lib=DIR is required. Please specify the path to the HYPRE library directory.])]) | ||
dnl Specify hypre lib directory only if hypre-dir is not specified | ||
AS_IF([test -z "$with_hypre_dir"], [ | ||
AC_ARG_WITH([hypre-lib], | ||
[AS_HELP_STRING([--with-hypre-lib=DIR], [Required if --with-hypre-dir is not specified: Path to HYPRE library dir.])], | ||
[LDFLAGS+=" -L$withval -Wl,-rpath,$withval"], | ||
[AC_MSG_ERROR([--with-hypre-lib=DIR or --with-hypre-dir=DIR is required. Please specify the path to the HYPRE library directory.])]) | ||
]) | ||
|
||
dnl Check for CUDA support | ||
AC_ARG_WITH([cuda], | ||
|
@@ -56,13 +72,46 @@ AC_ARG_WITH([cuda-home], | |
[cuda_home="$withval"], | ||
[cuda_home="$CUDA_HOME"]) | ||
|
||
dnl Verify CUDA_HOME is defined if CUDA support is enabled | ||
dnl Verify CUDA support | ||
AS_IF([test "x$with_cuda" = "xyes"], [ | ||
dnl Check for CUDA_HOME | ||
AS_IF([test -z "$cuda_home"], [ | ||
AC_MSG_ERROR([CUDA home directory is not defined. Please define the CUDA_HOME environment variable or use --with-cuda-home=DIR.]) | ||
]) | ||
dnl Update LDFLAGS and LIBS | ||
LDFLAGS+=" -L$cuda_home/lib64 -Wl,-rpath,$cuda_home/lib64" | ||
LIBS+=" -lcudart -lcusparse -lcublas -lcurand -lcusolver -lstdc++" | ||
dnl Check for libcudart | ||
AC_CHECK_LIB([cudart], | ||
[cudaMalloc], | ||
[AC_MSG_NOTICE([libcudart found.])], | ||
[AC_MSG_ERROR([libcudart not found. Please ensure CUDA is installed correctly.])]) | ||
dnl Check for libcudart | ||
AC_CHECK_LIB([cusparse], | ||
[cusparseCreate], | ||
[AC_MSG_NOTICE([libcusparse found.])], | ||
[AC_MSG_ERROR([libcusparse not found. Please ensure CUDA is installed correctly.])]) | ||
dnl Check for libcublas | ||
AC_CHECK_LIB([cublas], | ||
[cublasCreate], | ||
[AC_MSG_NOTICE([libcublas found.])], | ||
[AC_MSG_ERROR([libcublas not found. Please ensure CUDA is installed correctly.])]) | ||
dnl Check for libcusolver | ||
AC_CHECK_LIB([cusolver], | ||
[cusolverDnCreate], | ||
[AC_MSG_NOTICE([libcusolver found.])], | ||
[AC_MSG_ERROR([libcusolver not found. Please ensure CUDA is installed correctly.])]) | ||
dnl Check for libcurand | ||
AC_CHECK_LIB([curand], | ||
[curandCreateGenerator], | ||
[AC_MSG_NOTICE([libcurand found.])], | ||
[AC_MSG_ERROR([libcurand not found. Please ensure CUDA is installed correctly.])]) | ||
]) | ||
|
||
dnl Check for HIP support | ||
|
@@ -79,25 +128,61 @@ AC_ARG_WITH([rocm-path], | |
|
||
dnl Verify ROCM_PATH is defined if HIP support is enabled | ||
AS_IF([test "x$with_hip" = "xyes"], [ | ||
dnl Check for ROCM_PATH | ||
AS_IF([test -z "$rocm_path"], [ | ||
AC_MSG_ERROR([ROCM home directory is not defined. Please define the ROCM_PATH environment variable or use --with-rocm-path=DIR.]) | ||
]) | ||
dnl Update LDFLAGS and LIBS | ||
LDFLAGS+=" -L$rocm_path/lib -Wl,-rpath,$rocm_path/lib" | ||
LIBS+=" -lamdhip64 -lrocsparse -lrocblas -lrocrand -lrocsolver -lstdc++" | ||
dnl Check for libamdhip64 | ||
AC_CHECK_LIB([amdhip64], | ||
[hipMalloc], | ||
[AC_MSG_NOTICE([libamdhip64 found.])], | ||
[AC_MSG_ERROR([libamdhip64 not found. Please ensure ROCm is installed correctly.])]) | ||
dnl Check for librocsparse | ||
AC_CHECK_LIB([rocsparse], | ||
[rocsparse_create_handle], | ||
[AC_MSG_NOTICE([librocsparse found.])], | ||
[AC_MSG_ERROR([librocsparse not found. Please ensure ROCm is installed correctly.])]) | ||
dnl Check for librocblas | ||
AC_CHECK_LIB([rocblas], | ||
[rocblas_create_handle], | ||
[AC_MSG_NOTICE([librocblas found.])], | ||
[AC_MSG_ERROR([librocblas not found. Please ensure ROCm is installed correctly.])]) | ||
dnl Check for librocrand | ||
AC_CHECK_LIB([rocrand], | ||
[rocrand_create_generator], | ||
[AC_MSG_NOTICE([librocrand found.])], | ||
[AC_MSG_ERROR([librocrand not found. Please ensure ROCm is installed correctly.])]) | ||
dnl Check for librocsolver | ||
AC_CHECK_LIB([rocsolver], | ||
[rocsolver_create_handle], | ||
[AC_MSG_NOTICE([librocsolver found.])], | ||
[AC_MSG_ERROR([librocsolver not found. Please ensure ROCm is installed correctly.])]) | ||
]) | ||
|
||
dnl Avoid using CUDA and HIP | ||
AS_IF([test "x$with_cuda" = "xyes" -a "x$with_hip" = "xyes"], [ | ||
AC_MSG_ERROR([--with-cuda and --with-hip options are mutually exclusive. Please choose one.]) | ||
]) | ||
|
||
AC_CHECK_LIB([m], [sin], | ||
[], | ||
dnl Check for libm | ||
AC_CHECK_LIB([m], [sin], [], | ||
[AC_MSG_ERROR([libm (math library) not found or not usable])]) | ||
|
||
dnl Check for libHYPRE | ||
AC_CHECK_LIB([HYPRE], [HYPRE_IJMatrixCreate], [], | ||
[AC_MSG_ERROR([HYPRE library not found or not usable])]) | ||
|
||
dnl Check for HYPRE headers | ||
AC_CHECK_HEADER([HYPRE_config.h], [], | ||
[AC_MSG_ERROR([HYPRE headers not found or not usable. Please ensure the correct path is specified with --with-hypre-include and the headers are installed.])]) | ||
|
||
|
Oops, something went wrong.