220
220
dnl -----------------------------------------------------------------------------
222
dnl # @code{RHEO_CHECK_BOOST}
222
dnl # @code{RHEO_CHECK_BOOST_UBLAS}
224
224
dnl # Check to see if boost headers exists.
225
225
dnl # If so, set the shell variable "rheo_have_boost"
233
233
dnl # by appropriates "--with-boost-includes="'rheo_incdir_boost'
234
234
dnl # and "--with-boost-libdir="'rheo_libdir_boost' options.
236
AC_DEFUN([RHEO_CHECK_BOOST],
236
AC_DEFUN([RHEO_CHECK_BOOST_UBLAS],
237
237
[AH_TEMPLATE([HAVE_BOOST], Defines if you have boost library)]
238
238
[AC_SUBST(INCLUDES_BOOST)]
239
239
[AC_SUBST(LDADD_BOOST)]
470
470
# assume debian style :
471
471
rheo_have_umfpack=yes
472
rheo_libdir_umfpack=/usr/lib
473
dnl dependencies: amd blas
474
lib="-lumfpack -lamd -lblas"
475
[AC_MSG_RESULT($lib)]
477
incdir_list="/usr/include/umfpack /usr/include/ufsparse /usr/include/suitesparse"
472
if test x"${rheo_libs_umfpack}" != x"yes" -a x"${rheo_libs_umfpack}" != x""; then
473
LDADD_UMFPACK="${rheo_libs_umfpack}"
475
LDADD_UMFPACK="-lumfpack -lamd"
477
if test x"${rheo_libdir_umfpack}" != x"yes" -a x"${rheo_libdir_umfpack}" != x""; then
478
LDADD_UMFPACK="-L${rheo_libdir_umfpack} ${LDADD_UMFPACK}"
480
[AC_MSG_RESULT($LDADD_UMFPACK)]
478
481
if test x"${rheo_incdir_umfpack}" != x""; then
479
incdir_list="${rheo_incdir_umfpack} ${incdir_list}"
482
incdir_list="${rheo_incdir_umfpack}"
484
incdir_list="/usr/include/umfpack /usr/include/ufsparse /usr/include/suitesparse"
481
486
[AC_MSG_CHECKING(for umfpack.h)]
482
487
rheo_incdir_umfpack=""
1415
1420
AC_DEFUN([RHEO_GXX2011],
1416
1421
PREV_CXXFLAGS="$CXXFLAGS"
1417
1422
CXXFLAGS="${CXXFLAGS} -std=c++11"
1423
[AH_TEMPLATE([HAVE_CXX_STD_2011], Defines if you have a 2011 compilant c++ compiler)]
1418
1424
[AC_MSG_CHECKING(for 2011 GNU C++ option -std=c++11)]
1419
1425
[AC_TRY_COMPILE(
1420
1426
changequote(%%, %%)dnl
1429
1435
rheo_gxx2011=no
1431
1437
[AC_MSG_RESULT(${rheo_gxx2011})]
1438
if test x"${rheo_gxx2011}" = x"yes"; then
1439
# TODO: are some versions of the intel c++ compilers 2011 compilant ?
1440
[AC_DEFINE(HAVE_CXX_STD_2011)]
1432
1442
CXXFLAGS="${PREV_CXXFLAGS}"
1434
1444
dnl -----------------------------------------------------------------------------
1568
1578
if test x"${rheo_incdir_mpi}" = x""; then
1569
1579
rheo_incdir_mpi="/usr/lib/openmpi/include"
1571
# add -lmpi_f77 for mumps scalapck and blacs libs
1572
INCLUDES_MPI="-pthread -I${rheo_incdir_mpi}"
1573
LDADD_MPI="-pthread -L${rheo_libdir_mpi} -lmpi_cxx -lmpi_f77 -lmpi -lopen-rte -lopen-pal"
1581
# add -lmpi_f77 for mumps scalapck and blacs libs (obsolete)
1582
INCLUDES_MPI="-I${rheo_incdir_mpi}"
1583
if test x"${rheo_libs_mpi}" != x""; then
1584
rheo_libs_openmpi="${rheo_libs_mpi}"
1586
LDADD_MPI="-L${rheo_libdir_mpi} ${rheo_libs_openmpi}"
1576
1589
INCLUDES_MPI="-I/usr/include/lam"
1642
1655
dnl # Check for the "parmetis" and "metis" libraries.
1643
1656
dnl # Defines HAVE_PARMETIS and substitues
1644
dnl # INCLUDES_MPI and LDADD_MPI.
1657
dnl # INCLUDES_PARMETIS and LDADD_PARMETIS.
1645
1658
dnl # Requires the MPI library.
1646
1659
dnl -----------------------------------------------------------------------------
1647
1660
AC_DEFUN([RHEO_CHECK_PARMETIS],
1650
1663
[AC_SUBST(LDADD_PARMETIS)]
1651
1664
[AC_MSG_CHECKING(for parmetis library)]
1652
1665
rheo_have_parmetis=yes
1653
if test x"${rheo_libdir_parmetis}" != x"yes" -a x"${rheo_libdir_parmetis}" != x""; then
1654
libpath="${rheo_libdir_parmetis} ${rheo_libdir_parmetis}/lib"
1656
libpath="/usr/lib /lib"
1658
rheo_libdir_parmetis=""
1659
for d in ${libpath}; do
1666
if test x"${rheo_libdir_parmetis}" = x"yes" -o x"${rheo_libdir_parmetis}" = x""; then
1667
libpath="/usr/lib /lib"
1668
rheo_libdir_parmetis=""
1669
for d in ${libpath}; do
1660
1670
if test -f $d/libparmetis.so -a -f $d/libmetis.so || test -f $d/libparmetis.a -a -f $d/libmetis.a; then
1661
1671
rheo_libdir_parmetis=$d
1665
1676
if test x"${rheo_libdir_parmetis}" = x""; then
1666
1677
rheo_have_parmetis="no"
1725
1736
if test x"${rheo_have_scotch}" = x"yes"; then
1726
1737
[AC_DEFINE(HAVE_SCOTCH)]
1727
1738
INCLUDES_SCOTCH=""
1729
if test x"${rheo_have_mpi}" = x"yes"; then
1730
LDADD_SCOTCH="-lptscotchparmetis -lptscotch -lptscotcherrexit"
1739
LDADD_SCOTCH="${rheo_libs_scotch}"
1740
if test x"${rheo_have_mpi}" != x"yes"; then
1741
LDADD_SCOTCH="-lscotch -lscotcherrexit"
1732
LDADD_SCOTCH="$LDADD_SCOTCH -lscotch -lscotcherrexit"
1733
if test "${rheo_libdir_scotch}" != "/lib" -a "${rheo_libdir_scotch}" != "/usr/lib"; then
1743
if test x"${rheo_libdir_scotch}" != x"" -a x"${rheo_libdir_scotch}" != x"/usr/lib"; then
1734
1744
LDADD_SCOTCH="-L${rheo_libdir_scotch} ${LDADD_SCOTCH}"
1736
1746
rheo_have_scotch=yes
1743
1753
dnl -----------------------------------------------------------------------------
1755
dnl # @code{RHEO_CHECK_BOOST}
1757
dnl # Check for the "boost" library.
1758
dnl # Defines HAVE_BOOST and substitues LDADD_BOOST and INCLUDES_BOOST.
1759
dnl -----------------------------------------------------------------------------
1760
AC_DEFUN([RHEO_CHECK_BOOST],
1761
[AH_TEMPLATE([HAVE_BOOST], Defines if you have the basic linea algebra subroutines libraries)]
1762
[AC_SUBST(INCLUDES_BOOST)]
1763
[AC_SUBST(LDADD_BOOST)]
1764
[AC_MSG_CHECKING(for boost library)]
1767
if test x"${rheo_incdir_boost}" != x"yes" -a x"${rheo_incdir_boost}" != x""; then
1768
INCLUDES_BOOST="-I${rheo_incdir_boost}"
1771
if test x"${rheo_libdir_boost}" != x"yes" -a x"${rheo_libdir_boost}" != x""; then
1772
LDADD_BOOST="-L${rheo_libdir_boost}"
1774
[AC_DEFINE(HAVE_BOOST)]
1775
[AC_MSG_RESULT(${LDADD_BOOST})]
1777
dnl -----------------------------------------------------------------------------
1745
1779
dnl # @code{RHEO_CHECK_BLAS}
1747
1781
dnl # Check for the "blas" basic linear algebra subroutines library.
1754
1788
[AC_MSG_CHECKING(for blas library)]
1755
1789
rheo_have_blas=yes
1756
1790
INCLUDES_BLAS=""
1757
if test x"${rheo_ldadd_blas}" != x"yes" -a x"${rheo_ldadd_blas}" != x""; then
1758
LDADD_BLAS="${rheo_ldadd_blas}"
1759
elif test x"${rheo_libdir_blas}" != x"yes" -a x"${rheo_libdir_blas}" != x""; then
1760
LDADD_BLAS="-L${rheo_libdir_blas} -llapack -lblas"
1762
LDADD_BLAS="-llapack -lblas"
1791
if test x"${rheo_libs_blas}" != x"yes" -a x"${rheo_libs_blas}" != x""; then
1792
LDADD_BLAS="${rheo_libs_blas}"
1794
if test x"${rheo_libdir_blas}" != x"yes" -a x"${rheo_libdir_blas}" != x""; then
1795
LDADD_BLAS="-L${rheo_libdir_blas} ${LDADD_BLAS}"
1764
1797
[AC_DEFINE(HAVE_BLAS)]
1765
1798
[AC_MSG_RESULT(${LDADD_BLAS})]
1767
1800
dnl -----------------------------------------------------------------------------
1802
dnl # @code{RHEO_CHECK_SCALAPACK}
1804
dnl # Check for the "scalapack" basic linear algebra subroutines library.
1805
dnl # Defines HAVE_SCALAPACK and substitues LDADD_SCALAPACK and INCLUDES_SCALAPACK.
1806
dnl -----------------------------------------------------------------------------
1807
AC_DEFUN([RHEO_CHECK_SCALAPACK],
1808
[AH_TEMPLATE([HAVE_SCALAPACK], Defines if you have the scalable linea algebra subroutines libraries)]
1809
[AC_SUBST(INCLUDES_SCALAPACK)]
1810
[AC_SUBST(LDADD_SCALAPACK)]
1811
[AC_MSG_CHECKING(for scalapack library)]
1812
rheo_have_scalapack=yes
1813
INCLUDES_SCALAPACK=""
1814
LDADD_SCALAPACK="${rheo_libs_scalapack}"
1815
if test x"${rheo_libdir_scalapack}" != x"yes" -a x"${rheo_libdir_scalapack}" != x""; then
1816
LDADD_SCALAPACK="-L${rheo_libdir_scalapack} ${LDADD_SCALAPACK}"
1818
[AC_DEFINE(HAVE_SCALAPACK)]
1819
[AC_MSG_RESULT(${LDADD_SCALAPACK})]
1821
dnl -----------------------------------------------------------------------------
1769
1823
dnl # @code{RHEO_CHECK_TRILINOS}
1771
1825
dnl # Check for the "trilinos" distributed preconditioner libraries.
1780
1834
rheo_have_trilinos=yes
1781
1835
LDADD_TRILINOS=""
1782
1836
INCLUDES_TRILINOS=""
1837
LDADD_TRILINOS="${rheo_libs_trilinos}"
1783
1838
if test x"${rheo_libdir_trilinos}" != x"yes" -a x"${rheo_libdir_trilinos}" != x""; then
1784
LDADD_TRILINOS="-L${rheo_libdir_trilinos}"
1839
LDADD_TRILINOS="-L${rheo_libdir_trilinos} ${LDADD_TRILINOS}"
1786
LDADD_TRILINOS="${LDADD_TRILINOS} -ltrilinos_ifpack -ltrilinos_amesos -ltrilinos_epetra -ltrilinos_teuchos -ltrilinos_galeri -ltrilinos_triutils"
1787
1841
if test x"${rheo_incdir_trilinos}" = x"yes" -o x"${rheo_incdir_trilinos}" = x""; then
1788
1842
rheo_incdir_trilinos="/usr/include/trilinos"
1884
1938
[AH_TEMPLATE([HAVE_MUMPS], Defines if you have the mumps distributed direct solver libraries)]
1885
1939
[AC_SUBST(INCLUDES_MUMPS)]
1886
1940
[AC_SUBST(LDADD_MUMPS)]
1887
[AC_SUBST(INCLUDES_BLACS)]
1888
[AC_SUBST(LDADD_BLACS)]
1889
[AC_SUBST(INCLUDES_SCALAPACK)]
1890
[AC_SUBST(LDADD_SCALAPACK)]
1891
[AC_MSG_CHECKING(for mumps library)]
1893
1942
INCLUDES_MUMPS=""
1894
1943
# ----------------------------
1900
1949
CPPFLAGS="${CPPFLAGS} ${INCLUDES_MUMPS}"
1901
1950
[AC_CHECK_HEADER(dmumps_c.h, true, rheo_have_mumps=no)]
1902
if test x"${rheo_libdir_mumps}" != x"yes" -a x"${rheo_libdir_mumps}" != x""; then
1903
LDADD_MUMPS="-L${rheo_libdir_mumps}"
1905
rheo_have_mumps_mpi=no
1906
rheo_have_mumps_seq=no
1907
1951
rheo_have_mumps=no
1908
1952
if test x"${rheo_use_distributed}" != x"no"; then
1909
1953
# ----------------------------
1910
1954
# check for mumps mpi lib
1911
1955
# ----------------------------
1913
LDADD_BLACS="-lblacs-openmpi"
1914
INCLUDES_SCALAPACK=""
1915
LDADD_SCALAPACK="-lscalapack-openmpi"
1916
#OLD: ldadd_mumps_mpi_base="-ldmumps -lmumps_common -lpord -lptesmumps"
1917
ldadd_mumps_mpi_base="-ldmumps -lmumps_common -lpord"
1918
ldadd_mumps_mpi="${LDADD_MUMPS} ${ldadd_mumps_mpi_base} ${LDADD_SCALAPACK} ${LDADD_BLACS}"
1919
LDADD_MUMPS_MPI="${LDADD_MUMPS} ${ldadd_mumps_mpi_base} \${LDADD_SCALAPACK} \${LDADD_BLACS}"
1920
1956
[AC_MSG_CHECKING(for libdmumps)]
1957
LDADD_MUMPS="${rheo_libs_mumps}"
1958
if test x"${rheo_libdir_mumps}" != x"yes" -a x"${rheo_libdir_mumps}" != x""; then
1959
LDADD_MUMPS="-L${rheo_libdir_mumps} ${LDADD_MUMPS}"
1921
1961
PREV_LIBS=$LIBS
1922
LIBS="${LIBS} ${ldadd_mumps_mpi} ${LDADD_BLAS} ${LDADD_MPI}"
1962
LIBS="${LIBS} ${LDADD_MUMPS} ${LDADD_SCOTCH} ${LDADD_PARMETIS} ${LDADD_SCALAPACK} ${LDADD_BLAS} ${LDADD_MPI}"
1924
1964
changequote(%%, %%)dnl
1933
1973
changequote([, ])dnl
1934
rheo_have_mumps_mpi=yes,
1935
rheo_have_mumps_mpi=no
1974
rheo_have_mumps=yes,
1937
1977
LIBS=$PREV_LIBS
1938
if test x"$rheo_have_mumps_mpi" = x"yes"; then
1940
LDADD_MUMPS="${LDADD_MUMPS_MPI}"
1941
[AC_MSG_RESULT(${ldadd_mumps_mpi})]
1978
if test x"$rheo_have_mumps" = x"yes"; then
1979
[AC_MSG_RESULT(${LDADD_MUMPS})]
1943
1981
rheo_use_distributed=no
1946
INCLUDES_SCALAPACK=""
1948
1982
[AC_MSG_RESULT(no)]
1949
1983
[AC_MSG_RESULT(** WARNING: the distributed feature is turned off because libmumps/mpi is not available)]
1953
1987
# ----------------------------
1954
1988
# check for mumps seq lib
1955
1989
# ----------------------------
1956
LDADD_MUMPS_SEQ="${LDADD_MUMPS} -ldmumps_seq"
1957
1990
[AC_MSG_CHECKING(for libdmumps_seq)]
1991
LDADD_MUMPS="-ldmumps_seq"
1992
if test x"${rheo_libdir_mumps}" != x"yes" -a x"${rheo_libdir_mumps}" != x""; then
1993
LDADD_MUMPS="-L${rheo_libdir_mumps} ${LDADD_MUMPS}"
1958
1995
PREV_LIBS=$LIBS
1959
LIBS="${LIBS} ${LDADD_MUMPS_SEQ}"
1996
LIBS="${LIBS} ${LDADD_MUMPS}"
1961
1998
changequote(%%, %%)dnl
1970
2007
changequote([, ])dnl
1971
rheo_have_mumps_seq=yes,
1972
rheo_have_mumps_seq=no
2008
rheo_have_mumps=yes,
1974
2011
LIBS=$PREV_LIBS
1975
if test x"$rheo_have_mumps_seq" = x"yes"; then
1977
LDADD_MUMPS="${LDADD_MUMPS_SEQ}"
1978
[AC_MSG_RESULT(${LDADD_MUMPS_SEQ})]
2012
if test x"$rheo_have_mumps" = x"yes"; then
2013
[AC_MSG_RESULT(${LDADD_MUMPS})]
1980
2015
[AC_MSG_RESULT(no)]
2076
2111
rheo_have_cgal=yes
2077
2112
INCLUDES_CGAL=""
2078
2113
INCLUDES_CGAL_INTERN="-frounding-math"; # TODO: GCC ONLY
2079
LDADD_CGAL="-lCGAL_Core -lCGAL -lboost_thread -lgmp"
2080
2114
if test x"${rheo_incdir_cgal}" != x"yes" -a x"${rheo_incdir_cgal}" != x""; then
2081
2115
INCLUDES_CGAL="-I${rheo_incdir_cgal}"
2117
LDADD_CGAL="${rheo_libs_cgal}"
2083
2118
if test x"${rheo_libdir_cgal}" != x"yes" -a x"${rheo_libdir_cgal}" != x""; then
2084
2119
LDADD_CGAL="-L${rheo_libdir_cgal} ${LDADD_CGAL}"