From 0ea84dc10eeecd6be10de91192faded3e48daaf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Pernet?= Date: Fri, 14 Oct 2022 14:41:31 +0200 Subject: [PATCH 1/5] Applying autoupdate --- configure.ac | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index 0d001075..9f3768bc 100644 --- a/configure.ac +++ b/configure.ac @@ -21,11 +21,10 @@ # ========LICENCE======== #/ -AC_PREREQ([2.67]) +AC_PREREQ([2.71]) -AC_INIT([FFLAS-FFPACK], [2.5.1],[ffpack-devel@googlegroups.com],[fflas-ffpack], - [https://github.com/linbox-team/fflas-ffpack]) +AC_INIT([FFLAS-FFPACK],[2.5.1],[ffpack-devel@googlegroups.com],[fflas-ffpack],[https://github.com/linbox-team/fflas-ffpack]) AC_CONFIG_MACRO_DIR([macros]) @@ -50,12 +49,20 @@ AC_PROG_CXX AM_PROG_AR # Libtool -AC_PROG_LIBTOOL +LT_INIT LT_PREREQ([2.4.3]) LT_INIT # Look for headers -AC_HEADER_STDC +m4_warn([obsolete], +[The preprocessor macro `STDC_HEADERS' is obsolete. + Except in unusual embedded environments, you can safely include all + ISO C90 headers unconditionally.])dnl +# Autoupdate added the next two lines to ensure that your configure +# script's behavior did not change. They are probably safe to remove. +AC_CHECK_INCLUDES_DEFAULT +AC_PROG_EGREP + AC_CHECK_HEADERS([float.h limits.h stddef.h stdlib.h string.h sys/time.h stdint.h pthread.h]) # From e2713d1809d49b6e55c3c0f7b61544b71123c475 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Pernet?= Date: Fri, 14 Oct 2022 14:46:02 +0200 Subject: [PATCH 2/5] remove suggested unnecessary lines --- configure.ac | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/configure.ac b/configure.ac index 9f3768bc..233c57b0 100644 --- a/configure.ac +++ b/configure.ac @@ -53,16 +53,6 @@ LT_INIT LT_PREREQ([2.4.3]) LT_INIT -# Look for headers -m4_warn([obsolete], -[The preprocessor macro `STDC_HEADERS' is obsolete. - Except in unusual embedded environments, you can safely include all - ISO C90 headers unconditionally.])dnl -# Autoupdate added the next two lines to ensure that your configure -# script's behavior did not change. They are probably safe to remove. -AC_CHECK_INCLUDES_DEFAULT -AC_PROG_EGREP - AC_CHECK_HEADERS([float.h limits.h stddef.h stdlib.h string.h sys/time.h stdint.h pthread.h]) # From 8d307eed5f094c3b7e39c8ef98198399d921f0b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Pernet?= Date: Fri, 14 Oct 2022 15:00:11 +0200 Subject: [PATCH 3/5] auto update of the macros --- macros/common.m4 | 3 +-- macros/cuda-check.m4 | 11 ++++----- macros/debug.m4 | 35 +++++++++++++-------------- macros/fflas-ffpack-blas.m4 | 39 ++++++++++--------------------- macros/fflas-ffpack-doc.m4 | 6 ++--- macros/fflas-ffpack-misc.m4 | 4 ++-- macros/fflas-ffpack-precompile.m4 | 2 +- macros/givaro-check.m4 | 16 ++++--------- macros/omp-check.m4 | 10 +++----- 9 files changed, 47 insertions(+), 79 deletions(-) diff --git a/macros/common.m4 b/macros/common.m4 index 1e361e58..c6bddb5f 100644 --- a/macros/common.m4 +++ b/macros/common.m4 @@ -103,8 +103,7 @@ dnl Append -march=native or -mcpu=native (if recognized by the compiler) to dnl OPTIM_FLAGS if not present in CXXFLAGS and not cross-compiling and dnl --without-archnative is not set AC_DEFUN([ARCH_FLAGS],[ - AC_ARG_WITH(archnative, [AC_HELP_STRING([--without-archnative], - [do not use -march=native or -mcpu=native (default is to use it if not already present in CXXFLAGS)])]) + AC_ARG_WITH(archnative, [AS_HELP_STRING([--without-archnative],[do not use -march=native or -mcpu=native (default is to use it if not already present in CXXFLAGS)])]) AX_CHECK_COMPILE_FLAG([-march=native], [ AS_CASE([$CXXFLAGS], diff --git a/macros/cuda-check.m4 b/macros/cuda-check.m4 index 7fc76093..965e4ca7 100644 --- a/macros/cuda-check.m4 +++ b/macros/cuda-check.m4 @@ -32,7 +32,7 @@ dnl Defines HAVE_CUDA AC_DEFUN([FF_CHECK_CUDA], [ AC_ARG_WITH(cuda, - [AC_HELP_STRING([--with-cuda=|yes|no],[ + [AS_HELP_STRING([--with-cuda=|yes|no],[ Use CUDA library. If argument is no, you do not have the library installed on your machine. If argument is yes or that means the library is reachable with the standard @@ -79,14 +79,11 @@ do LIBS="${LIBS} ${CUDA_LIBS}" CODE_CUDA=`cat macros/CodeChunk/cuda.C` - AC_TRY_LINK( - [ + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include - ], - [ CUresult a;], - [ + ]], [[ CUresult a;]])],[ dnl # See if we are running CUDA 4.0 with --enable-cxx - AC_TRY_RUN( + _au_m4_changequote([,])AC_TRY_RUN( [ ${CODE_CUDA} ], [ AC_MSG_RESULT(found) diff --git a/macros/debug.m4 b/macros/debug.m4 index bcafb211..ca3b67ec 100644 --- a/macros/debug.m4 +++ b/macros/debug.m4 @@ -26,7 +26,7 @@ dnl enable basic debug mode. AC_DEFUN([AC_DEBUG], [AC_MSG_CHECKING([whether to enable debugging options in the library]) AC_ARG_ENABLE(debug, - [AC_HELP_STRING([--enable-debug=yes|no], [enable debugging options in library])], + [AS_HELP_STRING([--enable-debug=yes|no],[enable debugging options in library])], USE_DEBUG=$enableval, USE_DEBUG=no) AC_MSG_RESULT([$USE_DEBUG]) @@ -39,7 +39,7 @@ AC_DEFUN([AC_DEBUG], AC_DEFUN([AC_PROFILE], [AC_MSG_CHECKING([whether to enable profiling everything in the library]) AC_ARG_ENABLE(profile, -[AC_HELP_STRING([--enable-profile=yes|no], [enable profiling options in library])], +[AS_HELP_STRING([--enable-profile=yes|no],[enable profiling options in library])], USE_PROFILE=$enableval, USE_PROFILE=no) AC_MSG_RESULT([$USE_PROFILE]) @@ -53,7 +53,7 @@ dnl Enable warnings from compiler. AC_DEFUN([AC_WARNINGS], [AC_MSG_CHECKING([whether to enable warnings when compiling the library]) AC_ARG_ENABLE(warnings, -[AC_HELP_STRING([--enable-warnings=yes|full|no], [enable warnings when compiling the library. +[AS_HELP_STRING([--enable-warnings=yes|full|no],[enable warnings when compiling the library. If nothing or yes is given, more aggressive compiler warnings are passed to the compiler. If full is given, we become paranoïd about warnings and treat them as errors.])], USE_WARNINGS=$enableval, @@ -72,63 +72,60 @@ AC_DEFUN([AC_COMPILER_NAME], [ dnl CHECKING for various compilers dnl ICC ? - AC_TRY_RUN( [ + AC_RUN_IFELSE([AC_LANG_SOURCE([[ #ifdef __INTEL_COMPILER int main() { return 0 ; } #else not intel - #endif], - [ AC_MSG_RESULT(icc) + #endif]])],[ AC_MSG_RESULT(icc) CCNAM=icc AC_SUBST(CCNAM) - ]) + ],[],[]) dnl PATHSCALE > 4 ? AS_IF([ test -z "${CCNAM}"], [ - AC_TRY_RUN( [ + AC_RUN_IFELSE([AC_LANG_SOURCE([[ #ifdef __PATHSCALE__ int main() { return !(__PATHCC__ >= 4) ; } #else not ekopath either. - #endif], - [ CCNAM=eko ]) + #endif]])],[ CCNAM=eko ],[],[]) ]) dnl CLANG >= 3.9 ? AS_IF([ test -z "${CCNAM}"], [ - AC_TRY_RUN( [ + AC_RUN_IFELSE([AC_LANG_SOURCE([[ #ifdef __clang__ int main() { return !((__clang_major__ >= 4) ||(__clang_major__ ==3 && __clang_minor__ >= 9) ) ; } #else not clang3.9 - #endif], [ + #endif]])],[ CCNAM=clang AC_SUBST(CCNAM) - AC_MSG_RESULT($CCNAM) ]) + AC_MSG_RESULT($CCNAM) ],[],[]) ]) dnl 3.1 < CLANG <= 3.8 ? AS_IF([ test -z "${CCNAM}"], [ - AC_TRY_RUN( [ + AC_RUN_IFELSE([AC_LANG_SOURCE([[ #ifdef __clang__ int main() { return !(__clang_major__ ==3 && __clang_minor__ >=1 && __clang_minor__ <=8) ; } #else not clang3.8 - #endif], [ + #endif]])],[ CCNAM=clang38 AC_SUBST(CCNAM) - AC_MSG_RESULT($CCNAM) ]) + AC_MSG_RESULT($CCNAM) ],[],[]) ]) dnl GCC >= 5 ? AS_IF([ test -z "${CCNAM}"], [ - AC_TRY_RUN( [ + AC_RUN_IFELSE([AC_LANG_SOURCE([[ #ifdef __GNUC__ int main() { return !(__GNUC__ >= 5 ) ; } #else not gcc neither. - #endif], - [ CCNAM=gcc ]) + #endif]])],[ CCNAM=gcc ],[],[]) ]) dnl other ? diff --git a/macros/fflas-ffpack-blas.m4 b/macros/fflas-ffpack-blas.m4 index 5022e11f..52f46ed1 100644 --- a/macros/fflas-ffpack-blas.m4 +++ b/macros/fflas-ffpack-blas.m4 @@ -26,8 +26,7 @@ dnl Defines HAVE_LAPACK, HAVE_CLAPACK, HAVE_BLAS, HAVE_CBLAS if available AC_DEFUN([FF_CHECK_BLAS_CFLAGS], [ AC_ARG_WITH(blas-cflags, - [AC_HELP_STRING([--with-blas-cflags=], - [ CFLAGS for BLAS/LAPACK (i.e. -I/path/to/toto-blas) ]) + [AS_HELP_STRING([--with-blas-cflags=],[ CFLAGS for BLAS/LAPACK (i.e. -I/path/to/toto-blas) ]) ]) BLAS_CFLAGS="$with_blas_cflags" AC_SUBST(BLAS_CFLAGS) @@ -37,8 +36,7 @@ AC_DEFUN([FF_CHECK_BLAS_CFLAGS], dnl AC_DEFUN([FF_CHECK_BLAS_LIBS], [ AC_ARG_WITH(blas-libs, - [AC_HELP_STRING([--with-blas-libs=], - [ LIBS for BLAS/LAPACK (i.e. -L/path/to/toto-blas -ltoto-blas) ]) + [AS_HELP_STRING([--with-blas-libs=],[ LIBS for BLAS/LAPACK (i.e. -L/path/to/toto-blas -ltoto-blas) ]) ]) BLAS_LIBS="$with_blas_libs" AC_SUBST(BLAS_LIBS) @@ -63,13 +61,13 @@ AC_DEFUN([FF_CHECK_USER_BLAS], dnl is there user CBLAS accessible ? AC_MSG_CHECKING(for BLAS) - AC_TRY_RUN([ ${CODE_CBLAS} ],[ + AC_RUN_IFELSE([AC_LANG_SOURCE([[ ${CODE_CBLAS} ]])],[ blas_found="yes" is_cblas="yes" AC_MSG_RESULT(found CBLAS) ],[ dnl No, then checking for Fortran BLAS - AC_TRY_RUN( + _au_m4_changequote([,])AC_TRY_RUN( [ ${CODE_FBLAS} ], [ blas_found="yes" is_cblas="no" @@ -79,7 +77,7 @@ AC_DEFUN([FF_CHECK_USER_BLAS], BLAS_LIBS="${BLAS_LIBS} -lopenblas -lpthread" AS_CASE([$CCNAM], [gcc*], [BLAS_LIBS="${BLAS_LIBS} -lgfortran"]) LIBS="${BACKUP_LIBS} ${BLAS_LIBS}" - AC_TRY_RUN( + _au_m4_changequote([,])AC_TRY_RUN( [ ${CODE_CBLAS} ],[ AC_MSG_RESULT(found OpenBLAS) blas_found="yes" @@ -162,12 +160,8 @@ AC_DEFUN([FF_CHECK_USER_LAPACK], CXXFLAGS="${BACKUP_CXXFLAGS} ${BLAS_CFLAGS} -I. -I.. -I${srcdir} -I${srcdir}/flas-ffpack ${GIVARO_CFLAGS}" LIBS="${BACKUP_LIBS} ${BLAS_LIBS}" - AC_TRY_RUN( - [ ${CODE_CLAPACK} ], - [ dgetrf_found="yes" ], - [ dgetrf_problem="problem" ], - [ dgetrf_found="" ] - ) + AC_RUN_IFELSE([AC_LANG_SOURCE([[ ${CODE_CLAPACK} ]])],[ dgetrf_found="yes" ],[ dgetrf_problem="problem" ],[ dgetrf_found="" + ]) AS_IF([ test "${dgetrf_found}" = "yes"], [ @@ -177,12 +171,8 @@ AC_DEFUN([FF_CHECK_USER_LAPACK], HAVE_LAPACK=yes ], [ - AC_TRY_RUN( - [ ${CODE_LAPACK} ], - [ dgetrf_found="yes"], - [ dgetrf_problem="$problem"], - [ dgetrf_found="" ] - ) + AC_RUN_IFELSE([AC_LANG_SOURCE([[ ${CODE_LAPACK} ]])],[ dgetrf_found="yes"],[ dgetrf_problem="$problem"],[ dgetrf_found="" + ]) AS_IF([ test "x${dgetrf_found}" = "xyes"], [ AC_SUBST(LAPACK_LIBS) @@ -208,8 +198,7 @@ AC_DEFUN([FF_CHECK_USER_LAPACK], AC_DEFUN([FF_OPENBLAS_NUM_THREADS], [ AC_ARG_WITH(openblas-num-threads, - [AC_HELP_STRING([--with-openblas-num-threads=], - [ Set the number of threads given to OpenBLAS]) + [AS_HELP_STRING([--with-openblas-num-threads=],[ Set the number of threads given to OpenBLAS]) ]) dnl testing if we are using openblas BACKUP_CXXFLAGS=${CXXFLAGS} @@ -222,12 +211,8 @@ AC_DEFUN([FF_OPENBLAS_NUM_THREADS], CXXFLAGS="${BACKUP_CXXFLAGS} ${BLAS_CFLAGS}" LIBS="${BACKUP_LIBS} ${BLAS_LIBS}" - AC_TRY_RUN( - [ ${CODE_OPENBLAS} ], - [ openblas_found="yes" ], - [ openblas_problem="problem" ], - [ openblas_found="" ] - ) + AC_RUN_IFELSE([AC_LANG_SOURCE([[ ${CODE_OPENBLAS} ]])],[ openblas_found="yes" ],[ openblas_problem="problem" ],[ openblas_found="" + ]) AS_IF([test "x$openblas_found" = "xyes"], [ diff --git a/macros/fflas-ffpack-doc.m4 b/macros/fflas-ffpack-doc.m4 index c225398e..a47ca931 100644 --- a/macros/fflas-ffpack-doc.m4 +++ b/macros/fflas-ffpack-doc.m4 @@ -28,7 +28,7 @@ AC_MSG_CHECKING(whether to build documentation) AC_ARG_WITH(docdir, -[AC_HELP_STRING([--with-docdir=], [Where the FFLAS-FFPACK documentation should be installed])], +[AS_HELP_STRING([--with-docdir=],[Where the FFLAS-FFPACK documentation should be installed])], [ FFLASFFPACK_DOC_PATH="$withval" ], @@ -39,7 +39,7 @@ AC_ARG_WITH(docdir, AC_SUBST(FFLASFFPACK_DOC_PATH) AC_ARG_WITH(doxygen, -[AC_HELP_STRING([--with-doxygen=], [Give the path to Doxygen. Note: --enable-doc needed])], +[AS_HELP_STRING([--with-doxygen=],[Give the path to Doxygen. Note: --enable-doc needed])], [ DOXYGEN_PATH="$PATH $withval" ], @@ -47,7 +47,7 @@ AC_ARG_WITH(doxygen, DOXYGEN_PATH="$PATH" ]) -AC_ARG_ENABLE(doc,[AC_HELP_STRING([--enable-doc], [Enable building documentation])], +AC_ARG_ENABLE(doc,[AS_HELP_STRING([--enable-doc],[Enable building documentation])], [ AC_MSG_RESULT(yes) AC_MSG_CHECKING(whether doxygen works) diff --git a/macros/fflas-ffpack-misc.m4 b/macros/fflas-ffpack-misc.m4 index c04836d4..875c087d 100644 --- a/macros/fflas-ffpack-misc.m4 +++ b/macros/fflas-ffpack-misc.m4 @@ -31,7 +31,7 @@ AC_DEFUN([FF_MISC], [ AC_ARG_WITH(default, -[AC_HELP_STRING([--with-default=], [Add to the default path for external package +[AS_HELP_STRING([--with-default=],[Add to the default path for external package checking. Set as default with /usr and /usr/local. ])], [if test "$withval" = yes ; then @@ -49,7 +49,7 @@ AC_ARG_WITH(default, AC_ARG_WITH(all, -[AC_HELP_STRING([--with-all= |yes|no], [Use all external packages. If the argument is no, +[AS_HELP_STRING([--with-all= |yes|no],[Use all external packages. If the argument is no, you not sure that all libraries are reachable with the default path. If the argument is yes or , that means that all libraries are reachable with the diff --git a/macros/fflas-ffpack-precompile.m4 b/macros/fflas-ffpack-precompile.m4 index 7b312319..0abdb68e 100644 --- a/macros/fflas-ffpack-precompile.m4 +++ b/macros/fflas-ffpack-precompile.m4 @@ -31,7 +31,7 @@ AC_DEFUN([FF_PRECOMPILE], AC_MSG_CHECKING([whether to compile the standard specializations]) AC_ARG_ENABLE(precompilation, -[AC_HELP_STRING([--enable-precompilation], [ Enable precompilation of the standard specializations])]) +[AS_HELP_STRING([--enable-precompilation],[ Enable precompilation of the standard specializations])]) AM_CONDITIONAL(FFLASFFPACK_PRECOMPILED, test "x$enable_precompilation" = "xyes") AS_IF([test "x$enable_precompilation" = "xyes"], [ diff --git a/macros/givaro-check.m4 b/macros/givaro-check.m4 index 1263f0c7..36a27ea3 100644 --- a/macros/givaro-check.m4 +++ b/macros/givaro-check.m4 @@ -34,7 +34,7 @@ AC_DEFUN([FF_CHECK_GIVARO], [ AC_ARG_WITH(givaro, -[AC_HELP_STRING([--with-givaro=|yes], [Use Givaro library. This library is mandatory for +[AS_HELP_STRING([--with-givaro=|yes],[Use Givaro library. This library is mandatory for LinBox compilation. If argument is yes or that means the library is reachable with the standard search path (/usr or /usr/local). Otherwise you give @@ -76,11 +76,8 @@ if test -r "$GIVARO_HOME/include/givaro/givconfig.h"; then LIBS="${BACKUP_LIBS} ${GIVARO_LIBS}" LD_RUN_PATH="${LD_RUN_PATH:+$LD_RUN_PATH$PATH_SEPARATOR}$givaro_lib_path" export LD_RUN_PATH - AC_TRY_LINK( - [#include ], - [Givaro::Integer a;], - [ - AC_TRY_RUN( + AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[Givaro::Integer a;]])],[ + _au_m4_changequote([,])AC_TRY_RUN( [#include int main () { if (GIVARO_VERSION >= $version_min && GIVARO_VERSION < $version_max) return 0; else return -1; /* old version of Givaro are defined as hexa 0x03yyzz*/ } ],[ @@ -96,8 +93,7 @@ if test -r "$GIVARO_HOME/include/givaro/givconfig.h"; then break ]) - ], - [ + ],[ givaro_found="yes" givaro_checked="$checked $GIVARO_HOME" #unset GIVARO_CFLAGS @@ -156,9 +152,7 @@ AC_DEFUN([FF_CHECK_GIVARO_USABILITY], LIBS="${BACKUP_LIBS} ${GIVARO_LIBS}" dnl try to compile a small example AC_MSG_CHECKING([for GIVARO usability]) - AC_TRY_LINK([#include ], [Givaro::Integer a;], - [AC_MSG_RESULT(yes)], - [AC_MSG_RESULT(no) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[Givaro::Integer a;]])],[AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no) AC_MSG_ERROR(The Givaro library could not be used with the compiler and the flags set up by the configure script) ]) dnl restore backu diff --git a/macros/omp-check.m4 b/macros/omp-check.m4 index 0a422797..e949b05c 100644 --- a/macros/omp-check.m4 +++ b/macros/omp-check.m4 @@ -26,8 +26,7 @@ dnl turn on OpenMP if available AC_DEFUN([FF_CHECK_OMP], [ AC_ARG_ENABLE(openmp, - [AC_HELP_STRING([--enable-openmp], - [ Use OpenMP ]) + [AS_HELP_STRING([--enable-openmp],[ Use OpenMP ]) ], [ avec_omp=$enable_openmp], [ avec_omp=yes ] @@ -37,16 +36,13 @@ AC_DEFUN([FF_CHECK_OMP], [ BACKUP_CXXFLAGS=${CXXFLAGS} CXXFLAGS="${BACKUP_CXXFLAGS} ${OPENMP_CXXFLAGS}" - AC_TRY_RUN([ + AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include int main() { int p = omp_get_num_threads(); return 0; } - ], - [ omp_found="yes" ], - [ omp_found="no" ], - [ + ]])],[ omp_found="yes" ],[ omp_found="no" ],[ echo "cross compiling...disabling" omp_found="no" ]) From cae7ddd96cb6ad734294c2353b4dfb18d82790f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Pernet?= Date: Fri, 14 Oct 2022 15:08:07 +0200 Subject: [PATCH 4/5] Revert "auto update of the macros" This reverts commit 8d307eed5f094c3b7e39c8ef98198399d921f0b6. --- macros/common.m4 | 3 ++- macros/cuda-check.m4 | 11 +++++---- macros/debug.m4 | 35 ++++++++++++++------------- macros/fflas-ffpack-blas.m4 | 39 +++++++++++++++++++++---------- macros/fflas-ffpack-doc.m4 | 6 ++--- macros/fflas-ffpack-misc.m4 | 4 ++-- macros/fflas-ffpack-precompile.m4 | 2 +- macros/givaro-check.m4 | 16 +++++++++---- macros/omp-check.m4 | 10 +++++--- 9 files changed, 79 insertions(+), 47 deletions(-) diff --git a/macros/common.m4 b/macros/common.m4 index c6bddb5f..1e361e58 100644 --- a/macros/common.m4 +++ b/macros/common.m4 @@ -103,7 +103,8 @@ dnl Append -march=native or -mcpu=native (if recognized by the compiler) to dnl OPTIM_FLAGS if not present in CXXFLAGS and not cross-compiling and dnl --without-archnative is not set AC_DEFUN([ARCH_FLAGS],[ - AC_ARG_WITH(archnative, [AS_HELP_STRING([--without-archnative],[do not use -march=native or -mcpu=native (default is to use it if not already present in CXXFLAGS)])]) + AC_ARG_WITH(archnative, [AC_HELP_STRING([--without-archnative], + [do not use -march=native or -mcpu=native (default is to use it if not already present in CXXFLAGS)])]) AX_CHECK_COMPILE_FLAG([-march=native], [ AS_CASE([$CXXFLAGS], diff --git a/macros/cuda-check.m4 b/macros/cuda-check.m4 index 965e4ca7..7fc76093 100644 --- a/macros/cuda-check.m4 +++ b/macros/cuda-check.m4 @@ -32,7 +32,7 @@ dnl Defines HAVE_CUDA AC_DEFUN([FF_CHECK_CUDA], [ AC_ARG_WITH(cuda, - [AS_HELP_STRING([--with-cuda=|yes|no],[ + [AC_HELP_STRING([--with-cuda=|yes|no],[ Use CUDA library. If argument is no, you do not have the library installed on your machine. If argument is yes or that means the library is reachable with the standard @@ -79,11 +79,14 @@ do LIBS="${LIBS} ${CUDA_LIBS}" CODE_CUDA=`cat macros/CodeChunk/cuda.C` - AC_LINK_IFELSE([AC_LANG_PROGRAM([[ + AC_TRY_LINK( + [ #include - ]], [[ CUresult a;]])],[ + ], + [ CUresult a;], + [ dnl # See if we are running CUDA 4.0 with --enable-cxx - _au_m4_changequote([,])AC_TRY_RUN( + AC_TRY_RUN( [ ${CODE_CUDA} ], [ AC_MSG_RESULT(found) diff --git a/macros/debug.m4 b/macros/debug.m4 index ca3b67ec..bcafb211 100644 --- a/macros/debug.m4 +++ b/macros/debug.m4 @@ -26,7 +26,7 @@ dnl enable basic debug mode. AC_DEFUN([AC_DEBUG], [AC_MSG_CHECKING([whether to enable debugging options in the library]) AC_ARG_ENABLE(debug, - [AS_HELP_STRING([--enable-debug=yes|no],[enable debugging options in library])], + [AC_HELP_STRING([--enable-debug=yes|no], [enable debugging options in library])], USE_DEBUG=$enableval, USE_DEBUG=no) AC_MSG_RESULT([$USE_DEBUG]) @@ -39,7 +39,7 @@ AC_DEFUN([AC_DEBUG], AC_DEFUN([AC_PROFILE], [AC_MSG_CHECKING([whether to enable profiling everything in the library]) AC_ARG_ENABLE(profile, -[AS_HELP_STRING([--enable-profile=yes|no],[enable profiling options in library])], +[AC_HELP_STRING([--enable-profile=yes|no], [enable profiling options in library])], USE_PROFILE=$enableval, USE_PROFILE=no) AC_MSG_RESULT([$USE_PROFILE]) @@ -53,7 +53,7 @@ dnl Enable warnings from compiler. AC_DEFUN([AC_WARNINGS], [AC_MSG_CHECKING([whether to enable warnings when compiling the library]) AC_ARG_ENABLE(warnings, -[AS_HELP_STRING([--enable-warnings=yes|full|no],[enable warnings when compiling the library. +[AC_HELP_STRING([--enable-warnings=yes|full|no], [enable warnings when compiling the library. If nothing or yes is given, more aggressive compiler warnings are passed to the compiler. If full is given, we become paranoïd about warnings and treat them as errors.])], USE_WARNINGS=$enableval, @@ -72,60 +72,63 @@ AC_DEFUN([AC_COMPILER_NAME], [ dnl CHECKING for various compilers dnl ICC ? - AC_RUN_IFELSE([AC_LANG_SOURCE([[ + AC_TRY_RUN( [ #ifdef __INTEL_COMPILER int main() { return 0 ; } #else not intel - #endif]])],[ AC_MSG_RESULT(icc) + #endif], + [ AC_MSG_RESULT(icc) CCNAM=icc AC_SUBST(CCNAM) - ],[],[]) + ]) dnl PATHSCALE > 4 ? AS_IF([ test -z "${CCNAM}"], [ - AC_RUN_IFELSE([AC_LANG_SOURCE([[ + AC_TRY_RUN( [ #ifdef __PATHSCALE__ int main() { return !(__PATHCC__ >= 4) ; } #else not ekopath either. - #endif]])],[ CCNAM=eko ],[],[]) + #endif], + [ CCNAM=eko ]) ]) dnl CLANG >= 3.9 ? AS_IF([ test -z "${CCNAM}"], [ - AC_RUN_IFELSE([AC_LANG_SOURCE([[ + AC_TRY_RUN( [ #ifdef __clang__ int main() { return !((__clang_major__ >= 4) ||(__clang_major__ ==3 && __clang_minor__ >= 9) ) ; } #else not clang3.9 - #endif]])],[ + #endif], [ CCNAM=clang AC_SUBST(CCNAM) - AC_MSG_RESULT($CCNAM) ],[],[]) + AC_MSG_RESULT($CCNAM) ]) ]) dnl 3.1 < CLANG <= 3.8 ? AS_IF([ test -z "${CCNAM}"], [ - AC_RUN_IFELSE([AC_LANG_SOURCE([[ + AC_TRY_RUN( [ #ifdef __clang__ int main() { return !(__clang_major__ ==3 && __clang_minor__ >=1 && __clang_minor__ <=8) ; } #else not clang3.8 - #endif]])],[ + #endif], [ CCNAM=clang38 AC_SUBST(CCNAM) - AC_MSG_RESULT($CCNAM) ],[],[]) + AC_MSG_RESULT($CCNAM) ]) ]) dnl GCC >= 5 ? AS_IF([ test -z "${CCNAM}"], [ - AC_RUN_IFELSE([AC_LANG_SOURCE([[ + AC_TRY_RUN( [ #ifdef __GNUC__ int main() { return !(__GNUC__ >= 5 ) ; } #else not gcc neither. - #endif]])],[ CCNAM=gcc ],[],[]) + #endif], + [ CCNAM=gcc ]) ]) dnl other ? diff --git a/macros/fflas-ffpack-blas.m4 b/macros/fflas-ffpack-blas.m4 index 52f46ed1..5022e11f 100644 --- a/macros/fflas-ffpack-blas.m4 +++ b/macros/fflas-ffpack-blas.m4 @@ -26,7 +26,8 @@ dnl Defines HAVE_LAPACK, HAVE_CLAPACK, HAVE_BLAS, HAVE_CBLAS if available AC_DEFUN([FF_CHECK_BLAS_CFLAGS], [ AC_ARG_WITH(blas-cflags, - [AS_HELP_STRING([--with-blas-cflags=],[ CFLAGS for BLAS/LAPACK (i.e. -I/path/to/toto-blas) ]) + [AC_HELP_STRING([--with-blas-cflags=], + [ CFLAGS for BLAS/LAPACK (i.e. -I/path/to/toto-blas) ]) ]) BLAS_CFLAGS="$with_blas_cflags" AC_SUBST(BLAS_CFLAGS) @@ -36,7 +37,8 @@ AC_DEFUN([FF_CHECK_BLAS_CFLAGS], dnl AC_DEFUN([FF_CHECK_BLAS_LIBS], [ AC_ARG_WITH(blas-libs, - [AS_HELP_STRING([--with-blas-libs=],[ LIBS for BLAS/LAPACK (i.e. -L/path/to/toto-blas -ltoto-blas) ]) + [AC_HELP_STRING([--with-blas-libs=], + [ LIBS for BLAS/LAPACK (i.e. -L/path/to/toto-blas -ltoto-blas) ]) ]) BLAS_LIBS="$with_blas_libs" AC_SUBST(BLAS_LIBS) @@ -61,13 +63,13 @@ AC_DEFUN([FF_CHECK_USER_BLAS], dnl is there user CBLAS accessible ? AC_MSG_CHECKING(for BLAS) - AC_RUN_IFELSE([AC_LANG_SOURCE([[ ${CODE_CBLAS} ]])],[ + AC_TRY_RUN([ ${CODE_CBLAS} ],[ blas_found="yes" is_cblas="yes" AC_MSG_RESULT(found CBLAS) ],[ dnl No, then checking for Fortran BLAS - _au_m4_changequote([,])AC_TRY_RUN( + AC_TRY_RUN( [ ${CODE_FBLAS} ], [ blas_found="yes" is_cblas="no" @@ -77,7 +79,7 @@ AC_DEFUN([FF_CHECK_USER_BLAS], BLAS_LIBS="${BLAS_LIBS} -lopenblas -lpthread" AS_CASE([$CCNAM], [gcc*], [BLAS_LIBS="${BLAS_LIBS} -lgfortran"]) LIBS="${BACKUP_LIBS} ${BLAS_LIBS}" - _au_m4_changequote([,])AC_TRY_RUN( + AC_TRY_RUN( [ ${CODE_CBLAS} ],[ AC_MSG_RESULT(found OpenBLAS) blas_found="yes" @@ -160,8 +162,12 @@ AC_DEFUN([FF_CHECK_USER_LAPACK], CXXFLAGS="${BACKUP_CXXFLAGS} ${BLAS_CFLAGS} -I. -I.. -I${srcdir} -I${srcdir}/flas-ffpack ${GIVARO_CFLAGS}" LIBS="${BACKUP_LIBS} ${BLAS_LIBS}" - AC_RUN_IFELSE([AC_LANG_SOURCE([[ ${CODE_CLAPACK} ]])],[ dgetrf_found="yes" ],[ dgetrf_problem="problem" ],[ dgetrf_found="" - ]) + AC_TRY_RUN( + [ ${CODE_CLAPACK} ], + [ dgetrf_found="yes" ], + [ dgetrf_problem="problem" ], + [ dgetrf_found="" ] + ) AS_IF([ test "${dgetrf_found}" = "yes"], [ @@ -171,8 +177,12 @@ AC_DEFUN([FF_CHECK_USER_LAPACK], HAVE_LAPACK=yes ], [ - AC_RUN_IFELSE([AC_LANG_SOURCE([[ ${CODE_LAPACK} ]])],[ dgetrf_found="yes"],[ dgetrf_problem="$problem"],[ dgetrf_found="" - ]) + AC_TRY_RUN( + [ ${CODE_LAPACK} ], + [ dgetrf_found="yes"], + [ dgetrf_problem="$problem"], + [ dgetrf_found="" ] + ) AS_IF([ test "x${dgetrf_found}" = "xyes"], [ AC_SUBST(LAPACK_LIBS) @@ -198,7 +208,8 @@ AC_DEFUN([FF_CHECK_USER_LAPACK], AC_DEFUN([FF_OPENBLAS_NUM_THREADS], [ AC_ARG_WITH(openblas-num-threads, - [AS_HELP_STRING([--with-openblas-num-threads=],[ Set the number of threads given to OpenBLAS]) + [AC_HELP_STRING([--with-openblas-num-threads=], + [ Set the number of threads given to OpenBLAS]) ]) dnl testing if we are using openblas BACKUP_CXXFLAGS=${CXXFLAGS} @@ -211,8 +222,12 @@ AC_DEFUN([FF_OPENBLAS_NUM_THREADS], CXXFLAGS="${BACKUP_CXXFLAGS} ${BLAS_CFLAGS}" LIBS="${BACKUP_LIBS} ${BLAS_LIBS}" - AC_RUN_IFELSE([AC_LANG_SOURCE([[ ${CODE_OPENBLAS} ]])],[ openblas_found="yes" ],[ openblas_problem="problem" ],[ openblas_found="" - ]) + AC_TRY_RUN( + [ ${CODE_OPENBLAS} ], + [ openblas_found="yes" ], + [ openblas_problem="problem" ], + [ openblas_found="" ] + ) AS_IF([test "x$openblas_found" = "xyes"], [ diff --git a/macros/fflas-ffpack-doc.m4 b/macros/fflas-ffpack-doc.m4 index a47ca931..c225398e 100644 --- a/macros/fflas-ffpack-doc.m4 +++ b/macros/fflas-ffpack-doc.m4 @@ -28,7 +28,7 @@ AC_MSG_CHECKING(whether to build documentation) AC_ARG_WITH(docdir, -[AS_HELP_STRING([--with-docdir=],[Where the FFLAS-FFPACK documentation should be installed])], +[AC_HELP_STRING([--with-docdir=], [Where the FFLAS-FFPACK documentation should be installed])], [ FFLASFFPACK_DOC_PATH="$withval" ], @@ -39,7 +39,7 @@ AC_ARG_WITH(docdir, AC_SUBST(FFLASFFPACK_DOC_PATH) AC_ARG_WITH(doxygen, -[AS_HELP_STRING([--with-doxygen=],[Give the path to Doxygen. Note: --enable-doc needed])], +[AC_HELP_STRING([--with-doxygen=], [Give the path to Doxygen. Note: --enable-doc needed])], [ DOXYGEN_PATH="$PATH $withval" ], @@ -47,7 +47,7 @@ AC_ARG_WITH(doxygen, DOXYGEN_PATH="$PATH" ]) -AC_ARG_ENABLE(doc,[AS_HELP_STRING([--enable-doc],[Enable building documentation])], +AC_ARG_ENABLE(doc,[AC_HELP_STRING([--enable-doc], [Enable building documentation])], [ AC_MSG_RESULT(yes) AC_MSG_CHECKING(whether doxygen works) diff --git a/macros/fflas-ffpack-misc.m4 b/macros/fflas-ffpack-misc.m4 index 875c087d..c04836d4 100644 --- a/macros/fflas-ffpack-misc.m4 +++ b/macros/fflas-ffpack-misc.m4 @@ -31,7 +31,7 @@ AC_DEFUN([FF_MISC], [ AC_ARG_WITH(default, -[AS_HELP_STRING([--with-default=],[Add to the default path for external package +[AC_HELP_STRING([--with-default=], [Add to the default path for external package checking. Set as default with /usr and /usr/local. ])], [if test "$withval" = yes ; then @@ -49,7 +49,7 @@ AC_ARG_WITH(default, AC_ARG_WITH(all, -[AS_HELP_STRING([--with-all= |yes|no],[Use all external packages. If the argument is no, +[AC_HELP_STRING([--with-all= |yes|no], [Use all external packages. If the argument is no, you not sure that all libraries are reachable with the default path. If the argument is yes or , that means that all libraries are reachable with the diff --git a/macros/fflas-ffpack-precompile.m4 b/macros/fflas-ffpack-precompile.m4 index 0abdb68e..7b312319 100644 --- a/macros/fflas-ffpack-precompile.m4 +++ b/macros/fflas-ffpack-precompile.m4 @@ -31,7 +31,7 @@ AC_DEFUN([FF_PRECOMPILE], AC_MSG_CHECKING([whether to compile the standard specializations]) AC_ARG_ENABLE(precompilation, -[AS_HELP_STRING([--enable-precompilation],[ Enable precompilation of the standard specializations])]) +[AC_HELP_STRING([--enable-precompilation], [ Enable precompilation of the standard specializations])]) AM_CONDITIONAL(FFLASFFPACK_PRECOMPILED, test "x$enable_precompilation" = "xyes") AS_IF([test "x$enable_precompilation" = "xyes"], [ diff --git a/macros/givaro-check.m4 b/macros/givaro-check.m4 index 36a27ea3..1263f0c7 100644 --- a/macros/givaro-check.m4 +++ b/macros/givaro-check.m4 @@ -34,7 +34,7 @@ AC_DEFUN([FF_CHECK_GIVARO], [ AC_ARG_WITH(givaro, -[AS_HELP_STRING([--with-givaro=|yes],[Use Givaro library. This library is mandatory for +[AC_HELP_STRING([--with-givaro=|yes], [Use Givaro library. This library is mandatory for LinBox compilation. If argument is yes or that means the library is reachable with the standard search path (/usr or /usr/local). Otherwise you give @@ -76,8 +76,11 @@ if test -r "$GIVARO_HOME/include/givaro/givconfig.h"; then LIBS="${BACKUP_LIBS} ${GIVARO_LIBS}" LD_RUN_PATH="${LD_RUN_PATH:+$LD_RUN_PATH$PATH_SEPARATOR}$givaro_lib_path" export LD_RUN_PATH - AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[Givaro::Integer a;]])],[ - _au_m4_changequote([,])AC_TRY_RUN( + AC_TRY_LINK( + [#include ], + [Givaro::Integer a;], + [ + AC_TRY_RUN( [#include int main () { if (GIVARO_VERSION >= $version_min && GIVARO_VERSION < $version_max) return 0; else return -1; /* old version of Givaro are defined as hexa 0x03yyzz*/ } ],[ @@ -93,7 +96,8 @@ if test -r "$GIVARO_HOME/include/givaro/givconfig.h"; then break ]) - ],[ + ], + [ givaro_found="yes" givaro_checked="$checked $GIVARO_HOME" #unset GIVARO_CFLAGS @@ -152,7 +156,9 @@ AC_DEFUN([FF_CHECK_GIVARO_USABILITY], LIBS="${BACKUP_LIBS} ${GIVARO_LIBS}" dnl try to compile a small example AC_MSG_CHECKING([for GIVARO usability]) - AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[Givaro::Integer a;]])],[AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no) + AC_TRY_LINK([#include ], [Givaro::Integer a;], + [AC_MSG_RESULT(yes)], + [AC_MSG_RESULT(no) AC_MSG_ERROR(The Givaro library could not be used with the compiler and the flags set up by the configure script) ]) dnl restore backu diff --git a/macros/omp-check.m4 b/macros/omp-check.m4 index e949b05c..0a422797 100644 --- a/macros/omp-check.m4 +++ b/macros/omp-check.m4 @@ -26,7 +26,8 @@ dnl turn on OpenMP if available AC_DEFUN([FF_CHECK_OMP], [ AC_ARG_ENABLE(openmp, - [AS_HELP_STRING([--enable-openmp],[ Use OpenMP ]) + [AC_HELP_STRING([--enable-openmp], + [ Use OpenMP ]) ], [ avec_omp=$enable_openmp], [ avec_omp=yes ] @@ -36,13 +37,16 @@ AC_DEFUN([FF_CHECK_OMP], [ BACKUP_CXXFLAGS=${CXXFLAGS} CXXFLAGS="${BACKUP_CXXFLAGS} ${OPENMP_CXXFLAGS}" - AC_RUN_IFELSE([AC_LANG_SOURCE([[ + AC_TRY_RUN([ #include int main() { int p = omp_get_num_threads(); return 0; } - ]])],[ omp_found="yes" ],[ omp_found="no" ],[ + ], + [ omp_found="yes" ], + [ omp_found="no" ], + [ echo "cross compiling...disabling" omp_found="no" ]) From 462d35d5d59cd9d2bc4d79e71c9172767522d95e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Pernet?= Date: Fri, 14 Oct 2022 15:15:42 +0200 Subject: [PATCH 5/5] update macros --- macros/common.m4 | 3 +- macros/cuda-check.m4 | 11 +++---- macros/debug.m4 | 35 ++++++++++------------ macros/fflas-ffpack-blas.m4 | 49 ++++++++++--------------------- macros/fflas-ffpack-doc.m4 | 6 ++-- macros/fflas-ffpack-misc.m4 | 4 +-- macros/fflas-ffpack-precompile.m4 | 2 +- macros/givaro-check.m4 | 16 ++++------ macros/omp-check.m4 | 10 ++----- 9 files changed, 51 insertions(+), 85 deletions(-) diff --git a/macros/common.m4 b/macros/common.m4 index 1e361e58..c6bddb5f 100644 --- a/macros/common.m4 +++ b/macros/common.m4 @@ -103,8 +103,7 @@ dnl Append -march=native or -mcpu=native (if recognized by the compiler) to dnl OPTIM_FLAGS if not present in CXXFLAGS and not cross-compiling and dnl --without-archnative is not set AC_DEFUN([ARCH_FLAGS],[ - AC_ARG_WITH(archnative, [AC_HELP_STRING([--without-archnative], - [do not use -march=native or -mcpu=native (default is to use it if not already present in CXXFLAGS)])]) + AC_ARG_WITH(archnative, [AS_HELP_STRING([--without-archnative],[do not use -march=native or -mcpu=native (default is to use it if not already present in CXXFLAGS)])]) AX_CHECK_COMPILE_FLAG([-march=native], [ AS_CASE([$CXXFLAGS], diff --git a/macros/cuda-check.m4 b/macros/cuda-check.m4 index 7fc76093..965e4ca7 100644 --- a/macros/cuda-check.m4 +++ b/macros/cuda-check.m4 @@ -32,7 +32,7 @@ dnl Defines HAVE_CUDA AC_DEFUN([FF_CHECK_CUDA], [ AC_ARG_WITH(cuda, - [AC_HELP_STRING([--with-cuda=|yes|no],[ + [AS_HELP_STRING([--with-cuda=|yes|no],[ Use CUDA library. If argument is no, you do not have the library installed on your machine. If argument is yes or that means the library is reachable with the standard @@ -79,14 +79,11 @@ do LIBS="${LIBS} ${CUDA_LIBS}" CODE_CUDA=`cat macros/CodeChunk/cuda.C` - AC_TRY_LINK( - [ + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include - ], - [ CUresult a;], - [ + ]], [[ CUresult a;]])],[ dnl # See if we are running CUDA 4.0 with --enable-cxx - AC_TRY_RUN( + _au_m4_changequote([,])AC_TRY_RUN( [ ${CODE_CUDA} ], [ AC_MSG_RESULT(found) diff --git a/macros/debug.m4 b/macros/debug.m4 index bcafb211..ca3b67ec 100644 --- a/macros/debug.m4 +++ b/macros/debug.m4 @@ -26,7 +26,7 @@ dnl enable basic debug mode. AC_DEFUN([AC_DEBUG], [AC_MSG_CHECKING([whether to enable debugging options in the library]) AC_ARG_ENABLE(debug, - [AC_HELP_STRING([--enable-debug=yes|no], [enable debugging options in library])], + [AS_HELP_STRING([--enable-debug=yes|no],[enable debugging options in library])], USE_DEBUG=$enableval, USE_DEBUG=no) AC_MSG_RESULT([$USE_DEBUG]) @@ -39,7 +39,7 @@ AC_DEFUN([AC_DEBUG], AC_DEFUN([AC_PROFILE], [AC_MSG_CHECKING([whether to enable profiling everything in the library]) AC_ARG_ENABLE(profile, -[AC_HELP_STRING([--enable-profile=yes|no], [enable profiling options in library])], +[AS_HELP_STRING([--enable-profile=yes|no],[enable profiling options in library])], USE_PROFILE=$enableval, USE_PROFILE=no) AC_MSG_RESULT([$USE_PROFILE]) @@ -53,7 +53,7 @@ dnl Enable warnings from compiler. AC_DEFUN([AC_WARNINGS], [AC_MSG_CHECKING([whether to enable warnings when compiling the library]) AC_ARG_ENABLE(warnings, -[AC_HELP_STRING([--enable-warnings=yes|full|no], [enable warnings when compiling the library. +[AS_HELP_STRING([--enable-warnings=yes|full|no],[enable warnings when compiling the library. If nothing or yes is given, more aggressive compiler warnings are passed to the compiler. If full is given, we become paranoïd about warnings and treat them as errors.])], USE_WARNINGS=$enableval, @@ -72,63 +72,60 @@ AC_DEFUN([AC_COMPILER_NAME], [ dnl CHECKING for various compilers dnl ICC ? - AC_TRY_RUN( [ + AC_RUN_IFELSE([AC_LANG_SOURCE([[ #ifdef __INTEL_COMPILER int main() { return 0 ; } #else not intel - #endif], - [ AC_MSG_RESULT(icc) + #endif]])],[ AC_MSG_RESULT(icc) CCNAM=icc AC_SUBST(CCNAM) - ]) + ],[],[]) dnl PATHSCALE > 4 ? AS_IF([ test -z "${CCNAM}"], [ - AC_TRY_RUN( [ + AC_RUN_IFELSE([AC_LANG_SOURCE([[ #ifdef __PATHSCALE__ int main() { return !(__PATHCC__ >= 4) ; } #else not ekopath either. - #endif], - [ CCNAM=eko ]) + #endif]])],[ CCNAM=eko ],[],[]) ]) dnl CLANG >= 3.9 ? AS_IF([ test -z "${CCNAM}"], [ - AC_TRY_RUN( [ + AC_RUN_IFELSE([AC_LANG_SOURCE([[ #ifdef __clang__ int main() { return !((__clang_major__ >= 4) ||(__clang_major__ ==3 && __clang_minor__ >= 9) ) ; } #else not clang3.9 - #endif], [ + #endif]])],[ CCNAM=clang AC_SUBST(CCNAM) - AC_MSG_RESULT($CCNAM) ]) + AC_MSG_RESULT($CCNAM) ],[],[]) ]) dnl 3.1 < CLANG <= 3.8 ? AS_IF([ test -z "${CCNAM}"], [ - AC_TRY_RUN( [ + AC_RUN_IFELSE([AC_LANG_SOURCE([[ #ifdef __clang__ int main() { return !(__clang_major__ ==3 && __clang_minor__ >=1 && __clang_minor__ <=8) ; } #else not clang3.8 - #endif], [ + #endif]])],[ CCNAM=clang38 AC_SUBST(CCNAM) - AC_MSG_RESULT($CCNAM) ]) + AC_MSG_RESULT($CCNAM) ],[],[]) ]) dnl GCC >= 5 ? AS_IF([ test -z "${CCNAM}"], [ - AC_TRY_RUN( [ + AC_RUN_IFELSE([AC_LANG_SOURCE([[ #ifdef __GNUC__ int main() { return !(__GNUC__ >= 5 ) ; } #else not gcc neither. - #endif], - [ CCNAM=gcc ]) + #endif]])],[ CCNAM=gcc ],[],[]) ]) dnl other ? diff --git a/macros/fflas-ffpack-blas.m4 b/macros/fflas-ffpack-blas.m4 index 5022e11f..6ae2a951 100644 --- a/macros/fflas-ffpack-blas.m4 +++ b/macros/fflas-ffpack-blas.m4 @@ -26,8 +26,7 @@ dnl Defines HAVE_LAPACK, HAVE_CLAPACK, HAVE_BLAS, HAVE_CBLAS if available AC_DEFUN([FF_CHECK_BLAS_CFLAGS], [ AC_ARG_WITH(blas-cflags, - [AC_HELP_STRING([--with-blas-cflags=], - [ CFLAGS for BLAS/LAPACK (i.e. -I/path/to/toto-blas) ]) + [AS_HELP_STRING([--with-blas-cflags=],[ CFLAGS for BLAS/LAPACK (i.e. -I/path/to/toto-blas) ]) ]) BLAS_CFLAGS="$with_blas_cflags" AC_SUBST(BLAS_CFLAGS) @@ -37,8 +36,7 @@ AC_DEFUN([FF_CHECK_BLAS_CFLAGS], dnl AC_DEFUN([FF_CHECK_BLAS_LIBS], [ AC_ARG_WITH(blas-libs, - [AC_HELP_STRING([--with-blas-libs=], - [ LIBS for BLAS/LAPACK (i.e. -L/path/to/toto-blas -ltoto-blas) ]) + [AS_HELP_STRING([--with-blas-libs=],[ LIBS for BLAS/LAPACK (i.e. -L/path/to/toto-blas -ltoto-blas) ]) ]) BLAS_LIBS="$with_blas_libs" AC_SUBST(BLAS_LIBS) @@ -63,15 +61,14 @@ AC_DEFUN([FF_CHECK_USER_BLAS], dnl is there user CBLAS accessible ? AC_MSG_CHECKING(for BLAS) - AC_TRY_RUN([ ${CODE_CBLAS} ],[ + AC_RUN_IFELSE([AC_LANG_SOURCE([[ ${CODE_CBLAS} ]])],[ blas_found="yes" is_cblas="yes" AC_MSG_RESULT(found CBLAS) ],[ dnl No, then checking for Fortran BLAS - AC_TRY_RUN( - [ ${CODE_FBLAS} ], - [ blas_found="yes" + AC_RUN_IFELSE([AC_LANG_SOURCE([[ ${CODE_FBLAS} ]])], [ + blas_found="yes" is_cblas="no" AC_MSG_RESULT(found Fortran BLAS) ],[ @@ -79,8 +76,7 @@ AC_DEFUN([FF_CHECK_USER_BLAS], BLAS_LIBS="${BLAS_LIBS} -lopenblas -lpthread" AS_CASE([$CCNAM], [gcc*], [BLAS_LIBS="${BLAS_LIBS} -lgfortran"]) LIBS="${BACKUP_LIBS} ${BLAS_LIBS}" - AC_TRY_RUN( - [ ${CODE_CBLAS} ],[ + AC_RUN_IFELSE([AC_LANG_SOURCE([[ ${CODE_CBLAS} ]])],[ AC_MSG_RESULT(found OpenBLAS) blas_found="yes" is_cblas="yes" @@ -94,19 +90,19 @@ AC_DEFUN([FF_CHECK_USER_BLAS], AC_MSG_RESULT(cross compiling) blas_cross="yes" AC_SUBST(BLAS_LIBS) - ]) + ],[],[]) ],[ blas_found="yes" is_cblas="no" AC_MSG_RESULT(cross compiling) blas_cross="yes" - ]) + ],[],[]) ],[ blas_found="yes" AC_MSG_RESULT(cross compiling) is_cblas="yes" blas_cross="yes" - ]) + ],[],[]) AS_IF([ test "x$blas_found" = "xyes" ], [ @@ -162,12 +158,8 @@ AC_DEFUN([FF_CHECK_USER_LAPACK], CXXFLAGS="${BACKUP_CXXFLAGS} ${BLAS_CFLAGS} -I. -I.. -I${srcdir} -I${srcdir}/flas-ffpack ${GIVARO_CFLAGS}" LIBS="${BACKUP_LIBS} ${BLAS_LIBS}" - AC_TRY_RUN( - [ ${CODE_CLAPACK} ], - [ dgetrf_found="yes" ], - [ dgetrf_problem="problem" ], - [ dgetrf_found="" ] - ) + AC_RUN_IFELSE([AC_LANG_SOURCE([[ ${CODE_CLAPACK} ]])],[ dgetrf_found="yes" ],[ dgetrf_problem="problem" ],[ dgetrf_found="" + ]) AS_IF([ test "${dgetrf_found}" = "yes"], [ @@ -177,12 +169,8 @@ AC_DEFUN([FF_CHECK_USER_LAPACK], HAVE_LAPACK=yes ], [ - AC_TRY_RUN( - [ ${CODE_LAPACK} ], - [ dgetrf_found="yes"], - [ dgetrf_problem="$problem"], - [ dgetrf_found="" ] - ) + AC_RUN_IFELSE([AC_LANG_SOURCE([[ ${CODE_LAPACK} ]])],[ dgetrf_found="yes"],[ dgetrf_problem="$problem"],[ dgetrf_found="" + ]) AS_IF([ test "x${dgetrf_found}" = "xyes"], [ AC_SUBST(LAPACK_LIBS) @@ -208,8 +196,7 @@ AC_DEFUN([FF_CHECK_USER_LAPACK], AC_DEFUN([FF_OPENBLAS_NUM_THREADS], [ AC_ARG_WITH(openblas-num-threads, - [AC_HELP_STRING([--with-openblas-num-threads=], - [ Set the number of threads given to OpenBLAS]) + [AS_HELP_STRING([--with-openblas-num-threads=],[ Set the number of threads given to OpenBLAS]) ]) dnl testing if we are using openblas BACKUP_CXXFLAGS=${CXXFLAGS} @@ -222,12 +209,8 @@ AC_DEFUN([FF_OPENBLAS_NUM_THREADS], CXXFLAGS="${BACKUP_CXXFLAGS} ${BLAS_CFLAGS}" LIBS="${BACKUP_LIBS} ${BLAS_LIBS}" - AC_TRY_RUN( - [ ${CODE_OPENBLAS} ], - [ openblas_found="yes" ], - [ openblas_problem="problem" ], - [ openblas_found="" ] - ) + AC_RUN_IFELSE([AC_LANG_SOURCE([[ ${CODE_OPENBLAS} ]])],[ openblas_found="yes" ],[ openblas_problem="problem" ],[ openblas_found="" + ]) AS_IF([test "x$openblas_found" = "xyes"], [ diff --git a/macros/fflas-ffpack-doc.m4 b/macros/fflas-ffpack-doc.m4 index c225398e..a47ca931 100644 --- a/macros/fflas-ffpack-doc.m4 +++ b/macros/fflas-ffpack-doc.m4 @@ -28,7 +28,7 @@ AC_MSG_CHECKING(whether to build documentation) AC_ARG_WITH(docdir, -[AC_HELP_STRING([--with-docdir=], [Where the FFLAS-FFPACK documentation should be installed])], +[AS_HELP_STRING([--with-docdir=],[Where the FFLAS-FFPACK documentation should be installed])], [ FFLASFFPACK_DOC_PATH="$withval" ], @@ -39,7 +39,7 @@ AC_ARG_WITH(docdir, AC_SUBST(FFLASFFPACK_DOC_PATH) AC_ARG_WITH(doxygen, -[AC_HELP_STRING([--with-doxygen=], [Give the path to Doxygen. Note: --enable-doc needed])], +[AS_HELP_STRING([--with-doxygen=],[Give the path to Doxygen. Note: --enable-doc needed])], [ DOXYGEN_PATH="$PATH $withval" ], @@ -47,7 +47,7 @@ AC_ARG_WITH(doxygen, DOXYGEN_PATH="$PATH" ]) -AC_ARG_ENABLE(doc,[AC_HELP_STRING([--enable-doc], [Enable building documentation])], +AC_ARG_ENABLE(doc,[AS_HELP_STRING([--enable-doc],[Enable building documentation])], [ AC_MSG_RESULT(yes) AC_MSG_CHECKING(whether doxygen works) diff --git a/macros/fflas-ffpack-misc.m4 b/macros/fflas-ffpack-misc.m4 index c04836d4..875c087d 100644 --- a/macros/fflas-ffpack-misc.m4 +++ b/macros/fflas-ffpack-misc.m4 @@ -31,7 +31,7 @@ AC_DEFUN([FF_MISC], [ AC_ARG_WITH(default, -[AC_HELP_STRING([--with-default=], [Add to the default path for external package +[AS_HELP_STRING([--with-default=],[Add to the default path for external package checking. Set as default with /usr and /usr/local. ])], [if test "$withval" = yes ; then @@ -49,7 +49,7 @@ AC_ARG_WITH(default, AC_ARG_WITH(all, -[AC_HELP_STRING([--with-all= |yes|no], [Use all external packages. If the argument is no, +[AS_HELP_STRING([--with-all= |yes|no],[Use all external packages. If the argument is no, you not sure that all libraries are reachable with the default path. If the argument is yes or , that means that all libraries are reachable with the diff --git a/macros/fflas-ffpack-precompile.m4 b/macros/fflas-ffpack-precompile.m4 index 7b312319..0abdb68e 100644 --- a/macros/fflas-ffpack-precompile.m4 +++ b/macros/fflas-ffpack-precompile.m4 @@ -31,7 +31,7 @@ AC_DEFUN([FF_PRECOMPILE], AC_MSG_CHECKING([whether to compile the standard specializations]) AC_ARG_ENABLE(precompilation, -[AC_HELP_STRING([--enable-precompilation], [ Enable precompilation of the standard specializations])]) +[AS_HELP_STRING([--enable-precompilation],[ Enable precompilation of the standard specializations])]) AM_CONDITIONAL(FFLASFFPACK_PRECOMPILED, test "x$enable_precompilation" = "xyes") AS_IF([test "x$enable_precompilation" = "xyes"], [ diff --git a/macros/givaro-check.m4 b/macros/givaro-check.m4 index 1263f0c7..36a27ea3 100644 --- a/macros/givaro-check.m4 +++ b/macros/givaro-check.m4 @@ -34,7 +34,7 @@ AC_DEFUN([FF_CHECK_GIVARO], [ AC_ARG_WITH(givaro, -[AC_HELP_STRING([--with-givaro=|yes], [Use Givaro library. This library is mandatory for +[AS_HELP_STRING([--with-givaro=|yes],[Use Givaro library. This library is mandatory for LinBox compilation. If argument is yes or that means the library is reachable with the standard search path (/usr or /usr/local). Otherwise you give @@ -76,11 +76,8 @@ if test -r "$GIVARO_HOME/include/givaro/givconfig.h"; then LIBS="${BACKUP_LIBS} ${GIVARO_LIBS}" LD_RUN_PATH="${LD_RUN_PATH:+$LD_RUN_PATH$PATH_SEPARATOR}$givaro_lib_path" export LD_RUN_PATH - AC_TRY_LINK( - [#include ], - [Givaro::Integer a;], - [ - AC_TRY_RUN( + AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[Givaro::Integer a;]])],[ + _au_m4_changequote([,])AC_TRY_RUN( [#include int main () { if (GIVARO_VERSION >= $version_min && GIVARO_VERSION < $version_max) return 0; else return -1; /* old version of Givaro are defined as hexa 0x03yyzz*/ } ],[ @@ -96,8 +93,7 @@ if test -r "$GIVARO_HOME/include/givaro/givconfig.h"; then break ]) - ], - [ + ],[ givaro_found="yes" givaro_checked="$checked $GIVARO_HOME" #unset GIVARO_CFLAGS @@ -156,9 +152,7 @@ AC_DEFUN([FF_CHECK_GIVARO_USABILITY], LIBS="${BACKUP_LIBS} ${GIVARO_LIBS}" dnl try to compile a small example AC_MSG_CHECKING([for GIVARO usability]) - AC_TRY_LINK([#include ], [Givaro::Integer a;], - [AC_MSG_RESULT(yes)], - [AC_MSG_RESULT(no) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[Givaro::Integer a;]])],[AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no) AC_MSG_ERROR(The Givaro library could not be used with the compiler and the flags set up by the configure script) ]) dnl restore backu diff --git a/macros/omp-check.m4 b/macros/omp-check.m4 index 0a422797..e949b05c 100644 --- a/macros/omp-check.m4 +++ b/macros/omp-check.m4 @@ -26,8 +26,7 @@ dnl turn on OpenMP if available AC_DEFUN([FF_CHECK_OMP], [ AC_ARG_ENABLE(openmp, - [AC_HELP_STRING([--enable-openmp], - [ Use OpenMP ]) + [AS_HELP_STRING([--enable-openmp],[ Use OpenMP ]) ], [ avec_omp=$enable_openmp], [ avec_omp=yes ] @@ -37,16 +36,13 @@ AC_DEFUN([FF_CHECK_OMP], [ BACKUP_CXXFLAGS=${CXXFLAGS} CXXFLAGS="${BACKUP_CXXFLAGS} ${OPENMP_CXXFLAGS}" - AC_TRY_RUN([ + AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include int main() { int p = omp_get_num_threads(); return 0; } - ], - [ omp_found="yes" ], - [ omp_found="no" ], - [ + ]])],[ omp_found="yes" ],[ omp_found="no" ],[ echo "cross compiling...disabling" omp_found="no" ])