Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Applying autoupdate #376

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,10 @@
# ========LICENCE========
#/

AC_PREREQ([2.67])
AC_PREREQ([2.71])


AC_INIT([FFLAS-FFPACK], [2.5.1],[[email protected]],[fflas-ffpack],
[https://github.com/linbox-team/fflas-ffpack])
AC_INIT([FFLAS-FFPACK],[2.5.1],[[email protected]],[fflas-ffpack],[https://github.com/linbox-team/fflas-ffpack])


AC_CONFIG_MACRO_DIR([macros])
Expand All @@ -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])

#
Expand Down
3 changes: 1 addition & 2 deletions macros/common.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down
11 changes: 4 additions & 7 deletions macros/cuda-check.m4
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ dnl Defines HAVE_CUDA
AC_DEFUN([FF_CHECK_CUDA], [

AC_ARG_WITH(cuda,
[AC_HELP_STRING([--with-cuda=<path>|yes|no],[
[AS_HELP_STRING([--with-cuda=<path>|yes|no],[
Use CUDA library.
If argument is no, you do not have the library installed on your machine.
If argument is yes or <empty> that means the library is reachable with the standard
Expand Down Expand Up @@ -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 <cuda.h>
],
[ 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)
Expand Down
35 changes: 16 additions & 19 deletions macros/debug.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand All @@ -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])
Expand All @@ -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,
Expand All @@ -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 ?
Expand Down
49 changes: 16 additions & 33 deletions macros/fflas-ffpack-blas.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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>],
[ CFLAGS for BLAS/LAPACK (i.e. -I/path/to/toto-blas) ])
[AS_HELP_STRING([--with-blas-cflags=<cflags>],[ CFLAGS for BLAS/LAPACK (i.e. -I/path/to/toto-blas) ])
])
BLAS_CFLAGS="$with_blas_cflags"
AC_SUBST(BLAS_CFLAGS)
Expand All @@ -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>],
[ LIBS for BLAS/LAPACK (i.e. -L/path/to/toto-blas -ltoto-blas) ])
[AS_HELP_STRING([--with-blas-libs=<libs>],[ LIBS for BLAS/LAPACK (i.e. -L/path/to/toto-blas -ltoto-blas) ])
])
BLAS_LIBS="$with_blas_libs"
AC_SUBST(BLAS_LIBS)
Expand All @@ -63,24 +61,22 @@ 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)
],[
dnl No, then checking for OpenBLAS
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"
Expand All @@ -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" ],
[
Expand Down Expand Up @@ -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"],
[
Expand All @@ -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)
Expand All @@ -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=<num-threads>],
[ Set the number of threads given to OpenBLAS])
[AS_HELP_STRING([--with-openblas-num-threads=<num-threads>],[ Set the number of threads given to OpenBLAS])
])
dnl testing if we are using openblas
BACKUP_CXXFLAGS=${CXXFLAGS}
Expand All @@ -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"],
[
Expand Down
6 changes: 3 additions & 3 deletions macros/fflas-ffpack-doc.m4
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ AC_MSG_CHECKING(whether to build documentation)


AC_ARG_WITH(docdir,
[AC_HELP_STRING([--with-docdir=<path>], [Where the FFLAS-FFPACK documentation should be installed])],
[AS_HELP_STRING([--with-docdir=<path>],[Where the FFLAS-FFPACK documentation should be installed])],
[
FFLASFFPACK_DOC_PATH="$withval"
],
Expand All @@ -39,15 +39,15 @@ AC_ARG_WITH(docdir,
AC_SUBST(FFLASFFPACK_DOC_PATH)

AC_ARG_WITH(doxygen,
[AC_HELP_STRING([--with-doxygen=<path>], [Give the path to Doxygen. Note: --enable-doc needed])],
[AS_HELP_STRING([--with-doxygen=<path>],[Give the path to Doxygen. Note: --enable-doc needed])],
[
DOXYGEN_PATH="$PATH $withval"
],
[
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)
Expand Down
4 changes: 2 additions & 2 deletions macros/fflas-ffpack-misc.m4
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ AC_DEFUN([FF_MISC],
[

AC_ARG_WITH(default,
[AC_HELP_STRING([--with-default=<path>], [Add <path> to the default path for external package
[AS_HELP_STRING([--with-default=<path>],[Add <path> to the default path for external package
checking. Set as default with /usr and /usr/local.
])],
[if test "$withval" = yes ; then
Expand All @@ -49,7 +49,7 @@ AC_ARG_WITH(default,


AC_ARG_WITH(all,
[AC_HELP_STRING([--with-all= <path>|yes|no], [Use all external packages. If the argument is no,
[AS_HELP_STRING([--with-all= <path>|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 <empty>,
that means that all libraries are reachable with the
Expand Down
2 changes: 1 addition & 1 deletion macros/fflas-ffpack-precompile.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
[
Expand Down
16 changes: 5 additions & 11 deletions macros/givaro-check.m4
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ AC_DEFUN([FF_CHECK_GIVARO],
[

AC_ARG_WITH(givaro,
[AC_HELP_STRING([--with-givaro=<path>|yes], [Use Givaro library. This library is mandatory for
[AS_HELP_STRING([--with-givaro=<path>|yes],[Use Givaro library. This library is mandatory for
LinBox compilation. If argument is yes or <empty>
that means the library is reachable with the standard
search path (/usr or /usr/local). Otherwise you give
Expand Down Expand Up @@ -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/givinteger.h>],
[Givaro::Integer a;],
[
AC_TRY_RUN(
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <givaro/givinteger.h>]], [[Givaro::Integer a;]])],[
_au_m4_changequote([,])AC_TRY_RUN(
[#include <givaro/givconfig.h>
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*/ }
],[
Expand All @@ -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
Expand Down Expand Up @@ -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/givinteger.h>], [Givaro::Integer a;],
[AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <givaro/givinteger.h>]], [[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
Expand Down
Loading