1787
1798
if test x"${rheo_ldadd_blas}" != x"yes" -a x"${rheo_ldadd_blas}" != x""; then
1788
1799
LDADD_BLAS="${rheo_ldadd_blas}"
1789
1800
elif test x"${rheo_libdir_blas}" != x"yes" -a x"${rheo_libdir_blas}" != x""; then
1790
LDADD_BLAS="-L${rheo_libdir_blas} -lblas"
1801
LDADD_BLAS="-L${rheo_libdir_blas} -llapack -lblas"
1803
LDADD_BLAS="-llapack -lblas"
1794
1805
[AC_DEFINE(HAVE_BLAS)]
1795
1806
[AC_MSG_RESULT(${LDADD_BLAS})]
1797
1808
dnl -----------------------------------------------------------------------------
1810
dnl # @code{RHEO_CHECK_TRILINOS}
1812
dnl # Check for the "trilinos" distributed preconditioner libraries.
1813
dnl # Defines HAVE_TRILINOS and substitues
1814
dnl # INCLUDES_TRILINOS and LDADD_TRILINOS.
1815
dnl # Requires the MPI and SCOTCH libraries.
1816
dnl -----------------------------------------------------------------------------
1817
AC_DEFUN([RHEO_CHECK_TRILINOS],
1818
[AH_TEMPLATE([HAVE_TRILINOS], Defines if you have the trilinos distributed direct solver libraries)]
1819
[AC_SUBST(INCLUDES_TRILINOS)]
1820
[AC_SUBST(LDADD_TRILINOS)]
1821
rheo_have_trilinos=yes
1823
INCLUDES_TRILINOS=""
1824
if test x"${rheo_libdir_trilinos}" != x"yes" -a x"${rheo_libdir_trilinos}" != x""; then
1825
LDADD_TRILINOS="-L${rheo_libdir_trilinos}"
1827
LDADD_TRILINOS="${LDADD_TRILINOS} -ltrilinos_ifpack -ltrilinos_amesos -ltrilinos_epetra -ltrilinos_teuchos -ltrilinos_galeri -ltrilinos_triutils"
1828
if test x"${rheo_incdir_trilinos}" = x"yes" -o x"${rheo_incdir_trilinos}" = x""; then
1829
rheo_incdir_trilinos="/usr/include/trilinos"
1831
INCLUDES_TRILINOS="-I${rheo_incdir_trilinos}"
1832
PREV_CPPFLAGS=$CPPFLAGS
1833
CPPFLAGS="${CPPFLAGS} ${INCLUDES_TRILINOS} -Wno-error"
1834
[AC_CHECK_HEADER(Ifpack_Preconditioner.h, true, rheo_have_trilinos=no)]
1835
CPPFLAGS="${PREV_CPPFLAGS}"
1836
if test x"${rheo_have_trilinos}" = x"yes"; then
1837
[AC_DEFINE(HAVE_TRILINOS)]
1838
[AC_MSG_CHECKING(for trilinos library)]
1839
[AC_MSG_RESULT(${LDADD_TRILINOS})]
1842
INCLUDES_TRILINOS=""
1845
dnl -----------------------------------------------------------------------------
1799
1847
dnl # @code{RHEO_CHECK_PASTIX}
1801
dnl # Check for the "pastix" distributed direct solver libraries.
1849
dnl # Check for the "pastix" sequential or distributed direct solver libraries,
1850
dnl # depending on the "rheo_use_distributed" shell variable.
1802
1851
dnl # Defines HAVE_PASTIX and substitues
1803
1852
dnl # INCLUDES_PASTIX and LDADD_PASTIX.
1804
dnl # Requires the MPI and SCOTCH libraries.
1805
1853
dnl -----------------------------------------------------------------------------
1806
1854
AC_DEFUN([RHEO_CHECK_PASTIX],
1807
1855
[AH_TEMPLATE([HAVE_PASTIX], Defines if you have the pastix distributed direct solver libraries)]
1808
1856
[AC_SUBST(INCLUDES_PASTIX)]
1809
1857
[AC_SUBST(LDADD_PASTIX)]
1810
[AC_MSG_CHECKING(for pastix library)]
1811
1858
rheo_have_pastix=yes
1812
if test x"${rheo_libdir_pastix}" = x"yes" -o x"${rheo_libdir_pastix}" = x""; then
1813
rheo_libdir_pastix="\${HOME}/lib"
1861
if test x"${rheo_libdir_pastix}" != x"yes" -a x"${rheo_libdir_pastix}" != x""; then
1862
LDADD_PASTIX="-L${rheo_libdir_pastix}"
1815
if test x"${rheo_have_mpi}" = x"yes"; then
1816
LDADD_PASTIX="-L${rheo_libdir_pastix} -lpastix -lrt \${LDADD_BLAS}"
1864
if test x"${rheo_use_distributed}" = x"yes"; then
1865
LDADD_PASTIX="${LDADD_PASTIX} -lpastix_mpi_nosmp -lrt"
1818
LDADD_PASTIX="-L${rheo_libdir_pastix} -lpastix_32bit_nompi_smp_int_double_real_scotch_i686_pc_linux -lrt -lpthread ${LDADD_BLAS}"
1867
LDADD_PASTIX="${LDADD_PASTIX} -lpastix_seq_nosmp -lrt -lpthread"
1820
1869
if test x"${rheo_incdir_pastix}" = x"yes" -o x"${rheo_incdir_pastix}" = x""; then
1821
rheo_incdir_pastix="\${HOME}/include/pastix"
1870
rheo_incdir_pastix="/usr/include/pastix"
1823
1872
INCLUDES_PASTIX="-I${rheo_incdir_pastix}"
1824
[AC_DEFINE(HAVE_PASTIX)]
1825
[AC_MSG_RESULT(${LDADD_PASTIX})]
1873
PREV_CPPFLAGS=$CPPFLAGS
1874
CPPFLAGS="${CPPFLAGS} ${INCLUDES_PASTIX}"
1875
dnl custom check header for pastix:
1876
dnl [AC_CHECK_HEADER(pastix.h, true, rheo_have_pastix=no)]
1877
[AC_MSG_CHECKING(for pastix.h)]
1879
changequote(%%, %%)dnl
1882
#define COMPLEXFLOAT_ /* workarroud a compile problem here */
1883
#define COMPLEXDOUBLE_
1887
# define FORCE_NOMPI
1888
# define MPI_Comm int
1889
#endif // HAVE_MPI_H
1891
#include "cscd_utils.h"
1892
#undef COMPLEXFLOAT_
1893
#undef COMPLEXDOUBLE_
1900
changequote([, ])dnl
1904
[AC_MSG_RESULT(${rheo_have_pastix})]
1905
CPPFLAGS="${PREV_CPPFLAGS}"
1906
if test x"${rheo_have_pastix}" = x"yes"; then
1907
[AC_DEFINE(HAVE_PASTIX)]
1908
[AC_MSG_CHECKING(for pastix library)]
1909
[AC_MSG_RESULT(${LDADD_PASTIX})]
1915
dnl -----------------------------------------------------------------------------
1917
dnl # @code{RHEO_CHECK_MUMPS}
1919
dnl # Check for the "mumps" distributed direct solver libraries.
1920
dnl # Defines HAVE_MUMPS and substitues
1921
dnl # INCLUDES_MUMPS and LDADD_MUMPS.
1922
dnl # Requires the MPI and SCOTCH libraries.
1923
dnl -----------------------------------------------------------------------------
1924
AC_DEFUN([RHEO_CHECK_MUMPS],
1925
[AH_TEMPLATE([HAVE_MUMPS], Defines if you have the mumps distributed direct solver libraries)]
1926
[AC_SUBST(INCLUDES_MUMPS)]
1927
[AC_SUBST(LDADD_MUMPS)]
1928
[AC_SUBST(INCLUDES_BLACS)]
1929
[AC_SUBST(LDADD_BLACS)]
1930
[AC_SUBST(INCLUDES_SCALAPACK)]
1931
[AC_SUBST(LDADD_SCALAPACK)]
1932
[AC_MSG_CHECKING(for mumps library)]
1935
# ----------------------------
1936
# check for mumps header
1937
# ----------------------------
1938
if test x"${rheo_incdir_mumps}" != x"yes" -a x"${rheo_incdir_mumps}" != x""; then
1939
INCLUDES_MUMPS="-I${rheo_incdir_mumps}"
1941
CPPFLAGS="${CPPFLAGS} ${INCLUDES_MUMPS}"
1942
[AC_CHECK_HEADER(dmumps_c.h, true, rheo_have_mumps=no)]
1943
if test x"${rheo_libdir_mumps}" != x"yes" -a x"${rheo_libdir_mumps}" != x""; then
1944
LDADD_MUMPS="-L${rheo_libdir_mumps}"
1946
rheo_have_mumps_mpi=no
1947
rheo_have_mumps_seq=no
1949
if test x"${rheo_use_distributed}" != x"no"; then
1950
# ----------------------------
1951
# check for mumps mpi lib
1952
# ----------------------------
1954
LDADD_BLACS="-lblacs-openmpi"
1955
INCLUDES_SCALAPACK=""
1956
LDADD_SCALAPACK="-lscalapack-openmpi"
1957
ldadd_mumps_mpi="${LDADD_MUMPS} -ldmumps -lmumps_common -lpord -lptesmumps ${LDADD_SCALAPACK} ${LDADD_BLACS}"
1958
LDADD_MUMPS_MPI="${LDADD_MUMPS} -ldmumps -lmumps_common -lpord -lptesmumps \${LDADD_SCALAPACK} \${LDADD_BLACS}"
1959
[AC_MSG_CHECKING(for libdmumps)]
1961
LIBS="${LIBS} ${ldadd_mumps_mpi} ${LDADD_MPI}"
1963
changequote(%%, %%)dnl
1966
#include <dmumps_c.h>
1972
changequote([, ])dnl
1973
rheo_have_mumps_mpi=yes,
1974
rheo_have_mumps_mpi=no
1977
if test x"$rheo_have_mumps_mpi" = x"yes"; then
1979
LDADD_MUMPS="${LDADD_MUMPS_MPI}"
1980
[AC_MSG_RESULT(${ldadd_mumps_mpi})]
1982
rheo_use_distributed=no
1985
INCLUDES_SCALAPACK=""
1988
[AC_MSG_RESULT(** WARNING: the distributed feature is turned off because libmumps/mpi is not available)]
1991
if test x"${rheo_have_mumps}" != x"yes"; then
1992
# ----------------------------
1993
# check for mumps seq lib
1994
# ----------------------------
1995
LDADD_MUMPS_SEQ="${LDADD_MUMPS} -ldmumps_seq"
1996
[AC_MSG_CHECKING(for libdmumps_seq)]
1998
LIBS="${LIBS} ${LDADD_MUMPS_SEQ}"
2000
changequote(%%, %%)dnl
2003
#include <dmumps_c.h>
2009
changequote([, ])dnl
2010
rheo_have_mumps_seq=yes,
2011
rheo_have_mumps_seq=no
2014
if test x"$rheo_have_mumps_seq" = x"yes"; then
2016
LDADD_MUMPS="${LDADD_MUMPS_SEQ}"
2017
[AC_MSG_RESULT(${LDADD_MUMPS_SEQ})]
2022
if test x"${rheo_have_mumps}" = x"yes"; then
2023
[AC_DEFINE(HAVE_MUMPS)]
2028
CPPFLAGS="${PREV_CPPFLAGS}"
2030
dnl -----------------------------------------------------------------------------
2032
dnl # @code{RHEO_CHECK_STD_INITIALIER_LIST}
2034
dnl # Some compilers (e.g. GNU C++ 4.4.x) does not support
2035
dnl # the std::initializer_list feature.
2036
dnl # Set the corresponding
2037
dnl # shell variable "rheo_have_std_initializer_list"
2038
dnl # to "yes" and defines HAVE_STD_INITIALIZER_LIST.
2039
dnl # If not, set the variable no "no".
2040
dnl -----------------------------------------------------------------------------
2041
AC_DEFUN([RHEO_CHECK_STD_INITIALIZER_LIST],
2042
[AC_MSG_CHECKING(for std::initializer_list)]
2043
[AH_TEMPLATE([HAVE_STD_INITIALIZER_LIST], Defines if you have std::initializer_list, as c++ 2011 standard)]
2045
changequote(%%, %%)dnl
2049
// vec U = { u, 0 };
2050
// csr A = { {a,b}, {trans(b), 0} };
2051
// csr B = { {a,u}, {trans(u), 0} };
2052
// where trans(vec) is a special wraper vec_trans juste used for
2053
// this circonstance
2054
#include <initializer_list>
2057
// union of all possible types:
2058
// will be : vec<T> or T
2059
// or, for csr : csr<T>, vec<T> or T
2064
X(int j =0) : i(j), d(), is_int(true) {}
2065
X(double e) : i(), d(e), is_int(false) {}
2066
friend std::ostream& operator<< (std::ostream& o, const X& x) {
2067
if (x.is_int) return o << "i"<<x.i; else return o << "d"<<x.d;
2074
U (const std::initializer_list<T>& liste) : u() {
2075
for(const T* i = liste.begin(); i != liste.end(); ++i) {
2079
friend std::ostream& operator<< (std::ostream& o, const U& v) {
2081
for(typename std::list<T>::const_iterator i = v.u.begin(); i != v.u.end(); ++i) {
2082
std::cout << *i << " ";
2084
return std::cout << "}";
2090
std::cout << "u="<<u<<std::endl;
2091
U<U<X>> a = {{1,2.3},u};
2092
std::cout << "a="<<a<<std::endl;
2095
changequote([, ])dnl
2096
rheo_have_std_initializer_list=yes
2097
[AC_DEFINE(HAVE_STD_INITIALIZER_LIST)],
2098
rheo_have_std_initializer_list=no
2100
[AC_MSG_RESULT($rheo_have_std_initializer_list)]
2102
dnl -----------------------------------------------------------------------------
2104
dnl # @code{RHEO_CHECK_CGAL}
2106
dnl # Check for the "cgal" computational geometry library.
2107
dnl # Defines HAVE_CGAL and substitues
2108
dnl # INCLUDES_CGAL and LDADD_CGAL.
2109
dnl -----------------------------------------------------------------------------
2110
AC_DEFUN([RHEO_CHECK_CGAL],
2111
[AH_TEMPLATE([HAVE_CGAL], Defines if you have the CGAL library)]
2112
[AC_SUBST(INCLUDES_CGAL)]
2113
[AC_SUBST(INCLUDES_CGAL_INTERN)]
2114
[AC_SUBST(LDADD_CGAL)]
2117
INCLUDES_CGAL_INTERN="-frounding-math"; # TODO: GCC ONLY
2118
LDADD_CGAL="-lCGAL_Core -lCGAL -lboost_thread -lgmp"
2119
if test x"${rheo_incdir_cgal}" != x"yes" -a x"${rheo_incdir_cgal}" != x""; then
2120
INCLUDES_CGAL="-I${rheo_incdir_cgal}"
2122
if test x"${rheo_libdir_cgal}" != x"yes" -a x"${rheo_libdir_cgal}" != x""; then
2123
LDADD_CGAL="-L${rheo_libdir_cgal} ${LDADD_CGAL}"
2125
PREV_CPPFLAGS=$CPPFLAGS
2126
CPPFLAGS="${CPPFLAGS} ${INCLUDES_CGAL}"
2127
[AC_CHECK_HEADER(CGAL/Filtered_kernel.h, true, rheo_have_cgal=no)]
2128
CPPFLAGS="${PREV_CPPFLAGS}"
2129
[AC_MSG_CHECKING(for cgal library)]
2130
if test x"${rheo_have_cgal}" = x"yes"; then
2131
[AC_DEFINE(HAVE_CGAL)]
2132
[AC_MSG_RESULT(${LDADD_CGAL})]
2135
dnl -----------------------------------------------------------------------------
2137
dnl # @code{RHEO_DEBIAN_FIX_LIBTOOL}
2139
dnl # Fix rpath libtool issue for debian packaging.
2140
dnl # See also http://wiki.debian.org/RpathIssue
2141
dnl -----------------------------------------------------------------------------
2142
AC_DEFUN([RHEO_DEBIAN_FIX_LIBTOOL],
2143
[AC_MSG_RESULT(debian patching for libtool rpath problem)]
2144
if test -f ${srcdir}/config/debian_fix_libtool.sh; then
2145
/bin/sh ${srcdir}/config/debian_fix_libtool.sh
2147
[AC_MSG_ERROR(file debian_fix_libtool.sh not found)]
1827
2150
dnl -----------------------------------------------------------------------------