diff --git a/configure.ac b/configure.ac index 0d001075..233c57b0 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,10 @@ 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 AC_CHECK_HEADERS([float.h limits.h stddef.h stdlib.h string.h sys/time.h stdint.h pthread.h]) # 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" ])