Skip to content

Commit

Permalink
configure: fix default variable name for blas and lapack (#4343)
Browse files Browse the repository at this point in the history
In addition: improve handling of configuration with LAPACK
without BLAS
  • Loading branch information
nilason authored Sep 19, 2024
1 parent 89cfc52 commit a94c3b0
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 12 deletions.
18 changes: 12 additions & 6 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -5611,7 +5611,7 @@ if test ${with_blas+y}
then :
withval=$with_blas;
else $as_nop
with-blas="no"
with_blas=no
fi


Expand All @@ -5621,7 +5621,7 @@ if test ${with_lapack+y}
then :
withval=$with_lapack;
else $as_nop
with-lapack="no"
with_lapack=no
fi


Expand Down Expand Up @@ -13719,10 +13719,10 @@ case "$with_blas" in
no)
;;
yes)
USE_BLAS="$with_blas"
USE_BLAS=1
;;
*)
USE_BLAS=yes
USE_BLAS=1
BLAS_PKGS="$with_blas"
;;
esac
Expand Down Expand Up @@ -13832,15 +13832,21 @@ case "$with_lapack" in
no)
;;
yes)
USE_LAPACK="$with_lapack"
USE_LAPACK=1
;;
*)
USE_LAPACK=yes
USE_LAPACK=1
LAPACK_PKG="$with_lapack"
;;
esac

# LAPACK is useless without BLAS
if test -z "$USE_BLAS" && test -n "$USE_LAPACK"; then
USE_LAPACK=
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: LAPACK is disabled, BLAS configuration is missing" >&5
printf "%s\n" "$as_me: WARNING: LAPACK is disabled, BLAS configuration is missing" >&2;}
fi

if test -n "$USE_BLAS" && test -n "$USE_LAPACK"; then

lapack_ok=no
Expand Down
17 changes: 11 additions & 6 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -323,13 +323,13 @@ AC_ARG_WITH([blas],
[AS_HELP_STRING([--with-blas=pkg-config-package],
[enable BLAS support with by adding name of pkg-config package name
for CBLAS library, e.g. '--with-lapack-package=openblas',
default: cblas])],, [with-blas="no"])
default: cblas])],, [with_blas=no])

AC_ARG_WITH([lapack],
[AS_HELP_STRING([--with-lapack=pkg-config-package],
[enable LAPACK support with by adding name of pkg-config package name
for LAPACKE library, e.g. '--with-lapack-package=openblas',
default: lapacke])],, [with-lapack="no"])
default: lapacke])],, [with_lapack=no])

AC_ARG_WITH(libpng,
[ --with-libpng[=path/libpng-config]
Expand Down Expand Up @@ -1594,10 +1594,10 @@ case "$with_blas" in
no)
;;
yes)
USE_BLAS="$with_blas"
USE_BLAS=1
;;
*)
USE_BLAS=yes
USE_BLAS=1
BLAS_PKGS="$with_blas"
;;
esac
Expand Down Expand Up @@ -1665,15 +1665,20 @@ case "$with_lapack" in
no)
;;
yes)
USE_LAPACK="$with_lapack"
USE_LAPACK=1
;;
*)
USE_LAPACK=yes
USE_LAPACK=1
LAPACK_PKG="$with_lapack"
;;
esac

# LAPACK is useless without BLAS
if test -z "$USE_BLAS" && test -n "$USE_LAPACK"; then
USE_LAPACK=
AC_MSG_WARN([LAPACK is disabled, BLAS configuration is missing])
fi

if test -n "$USE_BLAS" && test -n "$USE_LAPACK"; then

lapack_ok=no
Expand Down

0 comments on commit a94c3b0

Please sign in to comment.