[BUG FIX] autotools: ICB must be checked first (MPI changes compilers).

This commit is contained in:
Franck HOUSSEN
2021-10-04 22:50:16 +02:00
parent 5cc85ad6f6
commit c7382178cf
2 changed files with 51 additions and 44 deletions
+3
View File
@@ -1,5 +1,8 @@
arpack-ng - 3.9.0
[ Franck Houssen ]
* [BUG FIX] autotools: ICB must be checked first (MPI changes compilers).
[ Haoyang Liu ]
* CMake: minimum required version changed to 3.0
* CMake: add C99 standard checking
+48 -44
View File
@@ -47,28 +47,7 @@ ifdef([LT_INIT], [], [
LT_PREREQ([2.4.2])
LT_INIT([win32-dll disable-static])
dnl See if compiling parpack
AC_ARG_ENABLE([mpi],
[AS_HELP_STRING(
[--enable-mpi],
[build parallel version of arpack with MPI])],
[],
[AS_VAR_SET([enable_mpi], [no])])
AS_IF([test x"$enable_mpi" != x"no"], [
FCFLAGS_SAVE=$FCFLAGS
FCFLAGS=""
FFLAGS_SAVE=$FFLAGS
FFLAGS=""
AC_LANG_PUSH([Fortran 77])
AX_MPI([], AC_MSG_ERROR([could not compile a Fortran MPI test program]))
AC_SUBST([MPI_Fortran_LIBS], [$MPILIBS])
F77=$MPIF77
AC_LANG_POP([Fortran 77])
FCFLAGS=$FCFLAGS_SAVE
FFLAGS=$FFLAGS_SAVE
])
dnl Reminder: checking for ISO_C_BINDING must be done before MPI as MPI changes compilers.
dnl See if compiling with ISO_C_BINDING support
AC_ARG_ENABLE([icb],
@@ -77,6 +56,30 @@ AC_ARG_ENABLE([icb],
[],
[AS_VAR_SET([enable_icb], [no])])
if test x"$enable_icb" != x"no"; then
AC_LANG_PUSH([Fortran])
AC_MSG_CHECKING([for iso_c_binding module compilation])
AC_LINK_IFELSE(
[
AC_LANG_PROGRAM(
[],
[
USE iso_c_binding
IMPLICIT NONE
INTEGER(C_INT) :: a
a = 1
]
)
],
[AC_MSG_RESULT([yes])],
[
AC_MSG_RESULT([no])
AC_MSG_ERROR([Fortran compiler does not support iso_c_binding])
]
)
AC_LANG_POP([Fortran])
fi
dnl See if compiling matrix market example based on ICB
AC_ARG_ENABLE([icb-exmm],
[AS_HELP_STRING([--enable-icb-exmm],
@@ -120,29 +123,30 @@ if test x"$enable_icb_exmm" != x"no"; then
AC_LANG_POP([C++])
fi
if test x"$enable_icb" != x"no"; then
AC_LANG_PUSH([Fortran])
AC_MSG_CHECKING([for iso_c_binding module compilation])
AC_LINK_IFELSE(
[
AC_LANG_PROGRAM(
[],
[
USE iso_c_binding
IMPLICIT NONE
INTEGER(C_INT) :: a
a = 1
]
)
],
[AC_MSG_RESULT([yes])],
[
AC_MSG_RESULT([no])
AC_MSG_ERROR([Fortran compiler does not support iso_c_binding])
]
)
AC_LANG_POP([Fortran])
dnl See if compiling parpack
AC_ARG_ENABLE([mpi],
[AS_HELP_STRING(
[--enable-mpi],
[build parallel version of arpack with MPI])],
[],
[AS_VAR_SET([enable_mpi], [no])])
AS_IF([test x"$enable_mpi" != x"no"], [
FCFLAGS_SAVE=$FCFLAGS
FCFLAGS=""
FFLAGS_SAVE=$FFLAGS
FFLAGS=""
AC_LANG_PUSH([Fortran 77])
AX_MPI([], AC_MSG_ERROR([could not compile a Fortran MPI test program]))
AC_SUBST([MPI_Fortran_LIBS], [$MPILIBS])
F77=$MPIF77
AC_LANG_POP([Fortran 77])
FCFLAGS=$FCFLAGS_SAVE
FFLAGS=$FFLAGS_SAVE
])
if test x"$enable_icb" != x"no"; then
if test x"$enable_mpi" != x"no"; then
FCFLAGS_SAVE=$FCFLAGS
FCFLAGS=""