Skip to content

Commit

Permalink
Check if mkl_pardiso.h is located inside a subfolder or not
Browse files Browse the repository at this point in the history
  • Loading branch information
octave-user committed Dec 27, 2023
1 parent e01f3c5 commit 251aa9f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@
/* Define to 1 if you have the <mkl/mkl_pardiso.h> header file. */
#undef HAVE_MKL_MKL_PARDISO_H

/* Define to 1 if you have the <mkl_pardiso.h> header file. */
#undef HAVE_MKL_PARDISO_H

/* Define to 1 if you have the `MPI_Comm_rank' function. */
#undef HAVE_MPI_COMM_RANK

Expand Down Expand Up @@ -228,6 +231,9 @@
/* Define to 1 if you have the <zmumps_c.h> header file. */
#undef HAVE_ZMUMPS_C_H

/* Define if mkl_pardiso.h is not located in a subfolder */
#undef MKL_PARDISO_H

/* macro for alternative Octave symbols */
#undef OCTAVE__FEVAL

Expand Down
9 changes: 9 additions & 0 deletions src/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ CPPFLAGS="${PARDISO_INC} ${CPPFLAGS}"
LIBS="${PARDISO_LIBS} ${LIBS}"

AC_CHECK_HEADERS([mkl/mkl_pardiso.h \
mkl_pardiso.h \
omp.h])
AC_CHECK_FUNCS([pardiso_64],[have_pardiso=yes],[have_pardiso=no])
AC_CHECK_FUNCS([omp_set_num_threads \
Expand All @@ -193,6 +194,14 @@ if test "${ac_cv_header_omp_h}" = "yes" -a "${have_omp_threads}" = "yes"; then
AC_DEFINE([USE_OMP_THREADS],1,[Define if omp_set_num_threads and omp_get_num_threads can be used])
fi

if test "${ac_cv_header_mkl_mkl_pardiso_h}" = "yes"; then
AC_DEFINE([MKL_PARDISO_H], [<mkl/mkl_pardiso.h>], [Define if mkl_pardiso.h is located in a subfolder called mkl])
else
if test "${ac_cv_header_mkl_pardiso_h}" = "yes"; then
AC_DEFINE([MKL_PARDISO_H], [<mkl_pardiso.h>], [Define if mkl_pardiso.h is not located in a subfolder])
fi
fi

AM_CONDITIONAL([USE_PARDISO],[test "${ac_cv_header_mkl_mkl_pardiso_h}" = "yes" && test "${have_pardiso}" = "yes"])

CPPFLAGS="${TCPPFLAGS}"
Expand Down
2 changes: 1 addition & 1 deletion src/pardiso.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include <vector>
#include <octave/oct.h>

#include <mkl/mkl_pardiso.h>
#include MKL_PARDISO_H

#ifdef USE_OMP_THREADS
#include <omp.h>
Expand Down

0 comments on commit 251aa9f

Please sign in to comment.