~ubuntu-branches/ubuntu/saucy/rheolef/saucy-proposed

« back to all changes in this revision

Viewing changes to config/acinclude.m4

  • Committer: Package Import Robot
  • Author(s): Pierre Saramito
  • Date: 2012-04-06 09:12:21 UTC
  • mfrom: (1.1.5)
  • Revision ID: package-import@ubuntu.com-20120406091221-m58me99p1nxqui49
Tags: 6.0-1
* New upstream release 6.0 (major changes):
  - massively distributed and parallel support
  - full FEM characteristic method (Lagrange-Gakerkin method) support
  - enhanced users documentation 
  - source code supports g++-4.7 (closes: #667356)
* debian/control: dependencies for MPI distributed solvers added
* debian/rules: build commands simplified
* debian/librheolef-dev.install: man1/* to man9/* added
* debian/changelog: package description rewritted (closes: #661689)

Show diffs side-by-side

added added

removed removed

Lines of Context:
49
49
dnl #    If so, set the shell variable @code{rheo_have_ginac}
50
50
dnl #    to "yes", defines HAVE_GINAC and
51
51
dnl #    substitues INCLUDES_GINAC and LADD_GINAC
52
 
dnl #    for adding in CFLAGS and LDFLAGS, respectively,
 
52
dnl #    for adding in CFLAGS and LIBS, respectively,
53
53
dnl #    If not, set the shell variable rheo_have_ginac to "no".
54
54
dnl #
55
55
AC_DEFUN([RHEO_CHECK_GINAC],
87
87
dnl #    If so, set the shell variable @code{rheo_have_cln}
88
88
dnl #    to "yes", defines HAVE_CLN and
89
89
dnl #    substitues INCLUDES_CLN and LADD_CLN
90
 
dnl #    for adding in CFLAGS and LDFLAGS, respectively,
 
90
dnl #    for adding in CFLAGS and LIBS, respectively,
91
91
dnl #    If not, set the shell variable no "no".
92
92
dnl #    Includes and libraries path are searched from a
93
93
dnl #    given shell variable @code{rheo_dir_cln}.
168
168
dnl #    If so, set the shell variable "rheo_have_taucs"
169
169
dnl #    to "yes", defines HAVE_TAUCS and
170
170
dnl #    substitues INCLUDES_TAUCS and LADD_TAUCS
171
 
dnl #    for adding in CXXFLAGS and LDFLAGS, respectively,
 
171
dnl #    for adding in CXXFLAGS and LIBS, respectively,
172
172
dnl #    If not, set the shell variable to "no".
173
173
dnl #    Includes and libraries options are
174
174
dnl #    given shell variable $rheo_ldadd_taucs and $rheo_incdir_taucs.
180
180
    [AH_TEMPLATE([HAVE_TAUCS], Defines if you have taucs library)]
181
181
    [AC_SUBST(INCLUDES_TAUCS)]
182
182
    [AC_SUBST(LDADD_TAUCS)]
183
 
    [AC_SUBST(LIBS_TAUCS)]
184
183
 
185
184
    rheo_have_taucs=yes
186
185
    PREV_CPPFLAGS=$CPPFLAGS
187
 
    PREV_LDFLAGS=$LDFLAGS
 
186
    PREV_LIBS=$LIBS
188
187
    INCLUDES_TAUCS=${rheo_incdir_taucs}
189
188
    CPPFLAGS="${CPPFLAGS} ${INCLUDES_TAUCS}"
190
189
    [AC_CHECK_HEADER(taucs.h, true, rheo_have_taucs=no)]
191
190
 
192
191
    if test x"$rheo_have_taucs" = x"yes"; then
193
192
        LDADD_TAUCS=${rheo_ldadd_taucs}
194
 
        LIBS_TAUCS=${rheo_ldadd_taucs}
195
 
        LDFLAGS="${LDFLAGS} ${LDADD_TAUCS}"
 
193
        LIBS="${LIBS} ${LDADD_TAUCS}"
196
194
        [AC_MSG_CHECKING(for libtaucs)]
197
195
        [AC_TRY_COMPILE(
198
196
            changequote(%%, %%)dnl
215
213
    else
216
214
        INCLUDES_TAUCS=""
217
215
        LDADD_TAUCS=""
218
 
        LIBS_TAUCS=""
219
216
    fi
220
217
    CPPFLAGS=$PREV_CPPFLAGS
221
 
    LDFLAGS=$PREV_LDFLAGS
 
218
    LIBS=$PREV_LIBS
222
219
)
223
220
dnl -----------------------------------------------------------------------------
224
221
dnl #
307
304
dnl #    If so, set the shell variable "rheo_have_zlib"
308
305
dnl #    to "yes", defines HAVE_ZLIB and
309
306
dnl #    substitues INCLUDES_ZLIB and LADD_ZLIB
310
 
dnl #    for adding in CXXFLAGS and LDFLAGS, respectively,
 
307
dnl #    for adding in CXXFLAGS and LIBS, respectively,
311
308
dnl #    If not, set the shell variable to "no".
312
309
dnl #    Includes and libraries path are searched from
313
310
dnl #    given shell variable $rheo_dir_zlib/lib and $rheo_incdir_zlib.
329
326
        rheo_incdir_zlib="${rheo_dir_zlib}/include"
330
327
    fi
331
328
    PREV_CPPFLAGS=$CPPFLAGS
332
 
    PREV_LDFLAGS=$LDFLAGS
 
329
    PREV_LIBS=$LIBS
333
330
    if test x"${rheo_incdir_zlib}" != x""; then
334
331
        INCLUDES_ZLIB="-I${rheo_incdir_zlib}"
335
332
        CPPFLAGS="${CPPFLAGS} ${INCLUDES_ZLIB}"
344
341
        else
345
342
            LDADD_ZLIB="-lz"
346
343
        fi
347
 
        LDFLAGS="${LDFLAGS} ${LDADD_ZLIB}"
 
344
        LIBS="${LIBS} ${LDADD_ZLIB}"
348
345
        [AC_MSG_CHECKING(for -lz)]
349
346
        [AC_TRY_COMPILE(
350
347
            changequote(%%, %%)dnl
369
366
        LDADD_ZLIB=""
370
367
    fi
371
368
    CPPFLAGS=$PREV_CPPFLAGS
372
 
    LDFLAGS=$PREV_LDFLAGS
 
369
    LIBS=$PREV_LIBS
373
370
)
374
371
dnl -----------------------------------------------------------------------------
375
372
dnl #
379
376
dnl #    If so, set the shell variable "rheo_have_spooles"
380
377
dnl #    to "yes", defines HAVE_SPOOLES and
381
378
dnl #    substitues INCLUDES_SPOOLES and LADD_SPOOLES
382
 
dnl #    for adding in CXXFLAGS and LDFLAGS, respectively,
 
379
dnl #    for adding in CXXFLAGS and LIBS, respectively,
383
380
dnl #    If not, set the shell variable to "no".
384
381
dnl #    Includes and libraries path are searched from
385
382
dnl #    given shell variable "rheo_libdir_spooles" and "rheo_incdir_spooles".
392
389
    [AH_TEMPLATE([HAVE_SPOOLES], Defines if you have spooles library)]
393
390
    [AC_SUBST(INCLUDES_SPOOLES)]
394
391
    [AC_SUBST(LDADD_SPOOLES)]
395
 
    [AC_SUBST(LIBS_SPOOLES)]
396
392
    # get absolute path name:
397
393
    path_spooles="${prefix} /usr/local/math /usr/local /usr /"
398
394
    if test x"${rheo_libdir_spooles}" != x""; then
413
409
            fi
414
410
            [AC_MSG_RESULT(${rheo_libdir_spooles}/${lib})]
415
411
            LDADD_SPOOLES=${rheo_libdir_spooles}/${lib}
416
 
            LIBS_SPOOLES=${rheo_libdir_spooles}/${lib}
417
412
            rheo_have_spooles=yes
418
413
            break
419
414
          fi
443
438
    if test x"${rheo_have_spooles}" != x"yes"; then
444
439
        INCLUDES_SPOOLES=""
445
440
        LDADD_SPOOLES=""
446
 
        LIBS_SPOOLES=""
447
441
        [AC_MSG_RESULT($rheo_have_spooles)]
448
442
        [AC_MSG_RESULT(** WARNING: recommended spooles library not found)]
449
443
    else
459
453
dnl #    If so, set the shell variable "rheo_have_umfpack"
460
454
dnl #    to "yes", defines HAVE_UMFPACK and
461
455
dnl #    substitues INCLUDES_UMFPACK and LADD_UMFPACK
462
 
dnl #    for adding in CXXFLAGS and LDFLAGS, respectively,
 
456
dnl #    for adding in CXXFLAGS and LIBS, respectively,
463
457
dnl #    If not, set the shell variable to "no".
464
458
dnl #    Includes and libraries path are searched from
465
459
dnl #    given shell variable "rheo_libdir_umfpack" and "rheo_incdir_umfpack".
472
466
    [AH_TEMPLATE([HAVE_UMFPACK], Defines if you have umfpack library)]
473
467
    [AC_SUBST(INCLUDES_UMFPACK)]
474
468
    [AC_SUBST(LDADD_UMFPACK)]
475
 
    [AC_SUBST(LIBS_UMFPACK)]
476
469
   
477
470
    # assume debian style :
478
471
    rheo_have_umfpack=yes
481
474
    lib="-lumfpack -lamd -lblas"
482
475
    [AC_MSG_RESULT($lib)]
483
476
    LDADD_UMFPACK="$lib"
484
 
    LIBS_UMFPACK="${LDADD_UMFPACK}"
485
477
    incdir_list="/usr/include/umfpack /usr/include/ufsparse /usr/include/suitesparse"
486
478
    if test x"${rheo_incdir_umfpack}" != x""; then
487
479
      incdir_list="${rheo_incdir_umfpack} ${incdir_list}"
502
494
    if test x"${rheo_have_umfpack}" != x"yes"; then
503
495
        INCLUDES_UMFPACK=""
504
496
        LDADD_UMFPACK=""
505
 
        LIBS_UMFPACK=""
506
 
        [AC_MSG_RESULT($rheo_have_umfpack)]
 
497
        [AC_MSG_RESULT(${rheo_have_umfpack})]
507
498
        [AC_MSG_RESULT(** WARNING: recommended umfpack library not found)]
508
 
        [AC_MSG_RESULT(${rheo_have_umfpack})]
509
499
    else
510
500
        [AC_DEFINE(HAVE_UMFPACK)]
511
501
    fi
519
509
dnl #    If so, set the shell variable @code{rheo_have_malloc_dbg}
520
510
dnl #    to "yes", defines HAVE_MALLOC_DBG,
521
511
dnl #    add @code{-I}@var{dir_malloc_dbg}@code{/include} to CFLAGS,
522
 
dnl #    add @var{dir_malloc_dbg}@code{/lib/libmalloc_dbg.a} to LDFLAGS.
 
512
dnl #    add @var{dir_malloc_dbg}@code{/lib/libmalloc_dbg.a} to LIBS.
523
513
dnl #    Here, @var{dir_malloc_dbg} is the directory such that
524
514
dnl #    @var{dir_malloc_dbg}@code{/bin} appears in PATH and
525
515
dnl #    the command @var{dir_malloc_dbg}@code{/bin/malloc_dbg} exists.
536
526
        rheo_dir_malloc_dbg=`expr ${rheo_bindir_malloc_dbg} : '\(.*\)/.*' `
537
527
        PREC_CFLAGS="$CFLAGS"
538
528
        CFLAGS="$CFLAGS -I${rheo_dir_malloc_dbg}/include"
539
 
        PREC_LDFLAGS=${LDFLAGS}
 
529
        PREC_LIBS=${LIBS}
540
530
        LIBS_MALLOC_DBG="-L${rheo_dir_malloc_dbg}/lib -lmalloc_dbg"
541
 
        LDFLAGS="${LDFLAGS} ${LIBS_MALLOC_DBG}"
 
531
        LIBS="${LIBS} ${LIBS_MALLOC_DBG}"
542
532
        [AC_TRY_COMPILE(
543
533
            changequote(%%, %%)dnl
544
534
            %%
555
545
        )]
556
546
        if test x"${rheo_have_malloc_dbg}" != x"yes"; then
557
547
            CFLAGS=${PREC_CFLAGS}
558
 
            LDFLAGS=${PREC_LDFLAGS}
 
548
            LIBS=${PREC_LIBS}
559
549
            LIBS_MALLOC_DBG=""
560
550
        else
561
551
            rheo_have_malloc_dbg=yes
1447
1437
                    [CPPFLAGS="${CPPFLAGS} -D__USE_STD_IOSTREAM"]
1448
1438
                    [CXXFLAGS="${CXXFLAGS} -O2 -w -timplicit_local -std ansi"]
1449
1439
                    [CFLAGS="${CFLAGS} -O2 -w"]
1450
 
                    [LDFLAGS="${LDFLAGS} -lm"]
 
1440
                    [LIBS="${LIBS} -lm"]
1451
1441
                    RECOGNIZED_CXX='${top_srcdir}/config/dec_cxx.mk'
1452
1442
                    rheo_cxx=dec
1453
1443
                else
1454
 
                    [AC_MSG_RESULT(     WARNING: unknown C++ compiler)]
 
1444
                    [AC_MSG_RESULT(** WARNING: unknown C++ compiler)]
1455
1445
                fi
1456
1446
            fi
1457
1447
        fi
1459
1449
)
1460
1450
dnl -----------------------------------------------------------------------------
1461
1451
dnl #
 
1452
dnl #    @code{RHEO_GXX2011}
 
1453
dnl #
 
1454
dnl #    Check for the "-std=c++0x" support for g++.
 
1455
dnl #    Requires a recent version of the GNU C++ compiler.
 
1456
dnl -----------------------------------------------------------------------------
 
1457
AC_DEFUN([RHEO_GXX2011],
 
1458
  PREV_CXXFLAGS="$CXXFLAGS"
 
1459
  CXXFLAGS="${CXXFLAGS} -std=c++0x"
 
1460
  [AC_MSG_CHECKING(for 2011 GNU C++ option: g++ -std=c++0x)]
 
1461
  [AC_TRY_COMPILE(
 
1462
            changequote(%%, %%)dnl
 
1463
            %%
 
1464
                int a = 0;
 
1465
            %%,
 
1466
            %%
 
1467
                return a;
 
1468
            %%,
 
1469
            changequote([, ])dnl
 
1470
            rheo_gxx2011=yes,
 
1471
            rheo_gxx2011=no
 
1472
        )]
 
1473
  [AC_MSG_RESULT(${rheo_gxx2011})]
 
1474
  CXXFLAGS="${PREV_CXXFLAGS}"
 
1475
)
 
1476
dnl -----------------------------------------------------------------------------
 
1477
dnl #
1462
1478
dnl #    @code{RHEO_OPTIMIZE_CXX}
1463
1479
dnl #
1464
1480
dnl #    Set some optimization flags associated to the recognized C++ compiler
1546
1562
dnl #    Check for the "mpirun" command, the
1547
1563
dnl #    corresponding header "mpi.h" and library "-lmpi" are available.
1548
1564
dnl #    If so, set the shell variable "rheo_have_mpi"
1549
 
dnl #    to "yes", defines HAVE_MPI and substitues MPIRUN to "mpirun" and
 
1565
dnl #    to "yes", and substitues MPIRUN to "mpirun" and
1550
1566
dnl #    RUN to "mpirun -np 2",
1551
1567
dnl #    INCLUDES_MPI and LDADD_MPI.
1552
1568
dnl #    If not, set the shell variable no "no".
1553
1569
dnl -----------------------------------------------------------------------------
1554
1570
AC_DEFUN([RHEO_CHECK_MPI],
1555
 
    [AH_TEMPLATE([HAVE_MPI], Defines if you have mpi library)]
1556
1571
    [AC_SUBST(MPIRUN)]
1557
1572
    [AC_SUBST(RUN)]
1558
1573
    [AC_SUBST(INCLUDES_MPI)]
1618
1633
        PREV_CPPFLAGS="$CPPFLAGS"
1619
1634
        CPPFLAGS="${CPPFLAGS} ${INCLUDES_MPI} ${INCLUDES_BOOST}"
1620
1635
        [AC_CHECK_HEADERS(mpi.h, [true], [rheo_have_mpi=no])]
1621
 
        [AC_CHECK_HEADERS(boost/mpi.hpp, [true], [rheo_have_boost_mpi=no])]
1622
 
        if test x"${rheo_have_boost_mpi}" != x"no"; then
 
1636
        [AC_CHECK_HEADERS(boost/mpi.hpp, [true], [rheo_have_mpi=no])]
 
1637
        if test x"${rheo_have_mpi}" != x"no"; then
1623
1638
            INCLUDE_BOOST_MPI="${INCLUDES_BOOST}"
1624
1639
            LDADD_BOOST_MPI="${LDADD_BOOST} -lboost_mpi -lboost_serialization"
1625
1640
            [AC_MSG_CHECKING(for boost::mpi)]
1627
1642
        fi
1628
1643
        LIBS="$PREV_LIBS"
1629
1644
        CXXFLAGS="$PREV_CXXFLAGS"
1630
 
        CPPFLAGS="$PREV_CPPFLAGS"
1631
1645
    fi
1632
1646
    if test x"${rheo_have_mpi}" = x"yes"; then
1633
 
        [AC_MSG_CHECKING(if programs compile with mpi)]
 
1647
        [AC_MSG_CHECKING(if programs compile and link with mpi and boost::mpi)]
1634
1648
        /bin/rm -f core; touch core; chmod a-w core
1635
1649
        PREV_LIBS="$LIBS"
1636
 
        LIBS="${LIBS} ${LDADD_MPI}"
 
1650
        LIBS="${LIBS} ${LDADD_MPI} ${LDADD_BOOST_MPI}"
1637
1651
        PREV_CXXFLAGS="$CXXFLAGS"
1638
 
        CXXFLAGS="${CXXFLAGS} ${INCLUDES_MPI}"
1639
 
        [AC_TRY_COMPILE(
 
1652
        CXXFLAGS="${CXXFLAGS} ${INCLUDES_MPI} ${INCLUDES_BOOST_MPI}"
 
1653
        [AC_TRY_LINK(
1640
1654
            changequote(%%, %%)dnl
1641
1655
            %%
1642
1656
                #include <mpi.h>
 
1657
                #include <boost/mpi.hpp>
1643
1658
            %%,
1644
1659
            %%
1645
 
                    MPI_Init(0,0);
1646
 
                    MPI_Finalize();
 
1660
                MPI_Init(0,0);
 
1661
                MPI_Finalize();
 
1662
                boost::mpi::environment e;
1647
1663
            %%,
1648
1664
            changequote([, ])dnl
1649
1665
            rheo_have_mpi=yes,
1654
1670
        LIBS="$PREV_LIBS"
1655
1671
        CXXFLAGS="$PREV_CXXFLAGS"
1656
1672
    fi
1657
 
    if test x"${rheo_have_mpi}" = x"yes"; then
1658
 
        [AC_DEFINE(HAVE_MPI)]
1659
 
    else
1660
 
        # MPIRUN=""
1661
 
        # INCLUDES_MPI=""
1662
 
        # LDADD_MPI=""
1663
 
        # defines it despite, for hand-made debug of config.mk file:
1664
 
        [AC_DEFINE(HAVE_MPI)]
1665
 
        [AC_MSG_ERROR(prheolef requires MPI and boost::mpi)]
 
1673
    if test x"${rheo_have_mpi}" != x"yes"; then
 
1674
        MPIRUN=""
 
1675
        INCLUDES_MPI=""
 
1676
        LDADD_MPI=""
1666
1677
    fi
1667
1678
)
1668
1679
dnl -----------------------------------------------------------------------------
1675
1686
dnl #    Requires the MPI library.
1676
1687
dnl -----------------------------------------------------------------------------
1677
1688
AC_DEFUN([RHEO_CHECK_PARMETIS],
1678
 
    [AH_TEMPLATE([HAVE_PARMETIS], Defines if you have parmetis and metis mesh partitionner libraries)]
 
1689
    [AH_TEMPLATE([HAVE_PARMETIS], Defines if you have parmetis and metis mesh partitioner libraries)]
1679
1690
    [AC_SUBST(INCLUDES_PARMETIS)]
1680
1691
    [AC_SUBST(LDADD_PARMETIS)]
1681
1692
    [AC_MSG_CHECKING(for parmetis library)]
1713
1724
dnl #
1714
1725
dnl #    @code{RHEO_CHECK_SCOTCH}
1715
1726
dnl #
1716
 
dnl #    Check for the "scotch" distributed mesh partitionner libraries.
 
1727
dnl #    Check for the "scotch" distributed mesh partitioner libraries.
1717
1728
dnl #    Defines HAVE_SCOTCH and substitues 
1718
1729
dnl #    INCLUDES_SCOTCH and LDADD_SCOTCH.
1719
1730
dnl #    Requires the MPI library.
1720
1731
dnl -----------------------------------------------------------------------------
1721
1732
AC_DEFUN([RHEO_CHECK_SCOTCH],
1722
 
    [AH_TEMPLATE([HAVE_SCOTCH], Defines if you have the scotch distributed mesh partitionner libraries)]
 
1733
    [AH_TEMPLATE([HAVE_SCOTCH], Defines if you have the scotch distributed mesh partitioner libraries)]
1723
1734
    [AC_SUBST(INCLUDES_SCOTCH)]
1724
1735
    [AC_SUBST(LDADD_SCOTCH)]
1725
1736
    [AC_MSG_CHECKING(for scotch library)]
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"
1791
1802
    else
1792
 
      LDADD_BLAS="-lblas"
 
1803
      LDADD_BLAS="-llapack -lblas"
1793
1804
    fi
1794
1805
    [AC_DEFINE(HAVE_BLAS)]
1795
1806
    [AC_MSG_RESULT(${LDADD_BLAS})]
1796
1807
)
1797
1808
dnl -----------------------------------------------------------------------------
1798
1809
dnl #
 
1810
dnl #    @code{RHEO_CHECK_TRILINOS}
 
1811
dnl #
 
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
 
1822
    LDADD_TRILINOS=""
 
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}"
 
1826
    fi
 
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"
 
1830
    fi
 
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})]
 
1840
    else
 
1841
      LDADD_TRILINOS=""
 
1842
      INCLUDES_TRILINOS=""
 
1843
    fi
 
1844
)
 
1845
dnl -----------------------------------------------------------------------------
 
1846
dnl #
1799
1847
dnl #    @code{RHEO_CHECK_PASTIX}
1800
1848
dnl #
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"
 
1859
    LDADD_PASTIX=""
 
1860
    INCLUDES_PASTIX=""
 
1861
    if test x"${rheo_libdir_pastix}" != x"yes" -a x"${rheo_libdir_pastix}" != x""; then
 
1862
      LDADD_PASTIX="-L${rheo_libdir_pastix}"
1814
1863
    fi
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"
1817
1866
    else
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"
1819
1868
    fi
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"
1822
1871
    fi
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)]
 
1878
    [AC_TRY_COMPILE(
 
1879
            changequote(%%, %%)dnl
 
1880
            %%
 
1881
            extern "C" {
 
1882
             #define COMPLEXFLOAT_   /* workarroud a compile problem here */
 
1883
             #define COMPLEXDOUBLE_
 
1884
             #ifndef HAVE_MPI_H
 
1885
             # include <mpi.h>
 
1886
             #else
 
1887
             # define FORCE_NOMPI
 
1888
             # define MPI_Comm int
 
1889
             #endif // HAVE_MPI_H
 
1890
             #include "pastix.h"
 
1891
             #include "cscd_utils.h"
 
1892
             #undef COMPLEXFLOAT_
 
1893
             #undef COMPLEXDOUBLE_
 
1894
             #undef FORCE_NOMPI
 
1895
            }
 
1896
            %%,
 
1897
            %%
 
1898
              int dummy = 0;
 
1899
            %%,
 
1900
            changequote([, ])dnl
 
1901
            true,
 
1902
            rheo_have_pastix=no
 
1903
        )]
 
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})]
 
1910
    else
 
1911
      LDADD_PASTIX=""
 
1912
      INCLUDES_PASTIX=""
 
1913
    fi
 
1914
)
 
1915
dnl -----------------------------------------------------------------------------
 
1916
dnl #
 
1917
dnl #    @code{RHEO_CHECK_MUMPS}
 
1918
dnl #
 
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)]
 
1933
    LDADD_MUMPS=""
 
1934
    INCLUDES_MUMPS=""
 
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}"
 
1940
    fi
 
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}"
 
1945
    fi
 
1946
    rheo_have_mumps_mpi=no
 
1947
    rheo_have_mumps_seq=no
 
1948
    rheo_have_mumps=no
 
1949
    if test x"${rheo_use_distributed}" != x"no"; then
 
1950
      # ----------------------------
 
1951
      # check for mumps mpi lib
 
1952
      # ----------------------------
 
1953
      INCLUDES_BLACS=""
 
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)]
 
1960
      PREV_LIBS=$LIBS
 
1961
      LIBS="${LIBS} ${ldadd_mumps_mpi} ${LDADD_MPI}"
 
1962
      [AC_TRY_LINK(
 
1963
            changequote(%%, %%)dnl
 
1964
            %%
 
1965
                extern "C" {
 
1966
                  #include <dmumps_c.h>
 
1967
                }
 
1968
            %%,
 
1969
            %%
 
1970
                dmumps_c(0);
 
1971
            %%,
 
1972
            changequote([, ])dnl
 
1973
            rheo_have_mumps_mpi=yes,
 
1974
            rheo_have_mumps_mpi=no
 
1975
      )]
 
1976
      LIBS=$PREV_LIBS
 
1977
      if test x"$rheo_have_mumps_mpi" = x"yes"; then
 
1978
        rheo_have_mumps=yes
 
1979
        LDADD_MUMPS="${LDADD_MUMPS_MPI}"
 
1980
        [AC_MSG_RESULT(${ldadd_mumps_mpi})]
 
1981
      else
 
1982
        rheo_use_distributed=no
 
1983
        INCLUDES_BLACS=""
 
1984
        LDADD_BLACS=""
 
1985
        INCLUDES_SCALAPACK=""
 
1986
        LDADD_SCALAPACK=""
 
1987
        [AC_MSG_RESULT(no)]
 
1988
        [AC_MSG_RESULT(** WARNING: the distributed feature is turned off because libmumps/mpi is not available)]
 
1989
      fi
 
1990
    fi
 
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)]
 
1997
      PREV_LIBS=$LIBS
 
1998
      LIBS="${LIBS} ${LDADD_MUMPS_SEQ}"
 
1999
      [AC_TRY_LINK(
 
2000
            changequote(%%, %%)dnl
 
2001
            %%
 
2002
                extern "C" {
 
2003
                  #include <dmumps_c.h>
 
2004
                }
 
2005
            %%,
 
2006
            %%
 
2007
                dmumps_c(0);
 
2008
            %%,
 
2009
            changequote([, ])dnl
 
2010
            rheo_have_mumps_seq=yes,
 
2011
            rheo_have_mumps_seq=no
 
2012
      )]
 
2013
      LIBS=$PREV_LIBS
 
2014
      if test x"$rheo_have_mumps_seq" = x"yes"; then
 
2015
        rheo_have_mumps=yes
 
2016
        LDADD_MUMPS="${LDADD_MUMPS_SEQ}"
 
2017
        [AC_MSG_RESULT(${LDADD_MUMPS_SEQ})]
 
2018
      else
 
2019
        [AC_MSG_RESULT(no)]
 
2020
      fi
 
2021
    fi
 
2022
    if test x"${rheo_have_mumps}" = x"yes"; then
 
2023
      [AC_DEFINE(HAVE_MUMPS)]
 
2024
    else
 
2025
      INCLUDES_MUMPS=""
 
2026
      LDADD_MUMPS=""
 
2027
    fi
 
2028
    CPPFLAGS="${PREV_CPPFLAGS}"
 
2029
)
 
2030
dnl -----------------------------------------------------------------------------
 
2031
dnl #
 
2032
dnl #    @code{RHEO_CHECK_STD_INITIALIER_LIST}
 
2033
dnl #
 
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)]
 
2044
    [AC_TRY_COMPILE(
 
2045
        changequote(%%, %%)dnl
 
2046
        %%
 
2047
           // model for
 
2048
           // vec u;
 
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>
 
2055
           #include <iostream>
 
2056
           #include <list>
 
2057
           // union of all possible types:
 
2058
           // will be : vec<T> or T
 
2059
           // or, for csr : csr<T>, vec<T> or T
 
2060
           struct X {
 
2061
            int i;
 
2062
            double d;
 
2063
            bool is_int;
 
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;
 
2068
            }
 
2069
           };
 
2070
           template <class T>
 
2071
           struct U {
 
2072
            std::list<T> u;
 
2073
            U () : u() {}
 
2074
            U (const std::initializer_list<T>& liste) : u() {
 
2075
               for(const T* i = liste.begin(); i != liste.end(); ++i) {
 
2076
                   u.push_back(*i);
 
2077
               }
 
2078
            }
 
2079
            friend std::ostream& operator<< (std::ostream& o, const U& v) {
 
2080
               std::cout << "{";
 
2081
               for(typename std::list<T>::const_iterator i = v.u.begin(); i != v.u.end(); ++i) {
 
2082
                   std::cout << *i << " ";
 
2083
               }
 
2084
               return std::cout << "}";
 
2085
             }
 
2086
           };
 
2087
        %%,
 
2088
        %%
 
2089
           U<X> u = {1,2.3,4};
 
2090
           std::cout << "u="<<u<<std::endl;
 
2091
           U<U<X>> a = {{1,2.3},u};
 
2092
           std::cout << "a="<<a<<std::endl;
 
2093
           return 0;
 
2094
        %%,
 
2095
        changequote([, ])dnl
 
2096
        rheo_have_std_initializer_list=yes
 
2097
        [AC_DEFINE(HAVE_STD_INITIALIZER_LIST)],
 
2098
        rheo_have_std_initializer_list=no
 
2099
    )]
 
2100
    [AC_MSG_RESULT($rheo_have_std_initializer_list)]
 
2101
)
 
2102
dnl -----------------------------------------------------------------------------
 
2103
dnl #
 
2104
dnl #    @code{RHEO_CHECK_CGAL}
 
2105
dnl #
 
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)]
 
2115
    rheo_have_cgal=yes
 
2116
    INCLUDES_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}"
 
2121
    fi
 
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}"
 
2124
    fi
 
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})]
 
2133
    fi
 
2134
)
 
2135
dnl -----------------------------------------------------------------------------
 
2136
dnl #
 
2137
dnl #    @code{RHEO_DEBIAN_FIX_LIBTOOL}
 
2138
dnl #
 
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
 
2146
 else
 
2147
   [AC_MSG_ERROR(file debian_fix_libtool.sh not found)]
 
2148
 fi
1826
2149
)
1827
2150
dnl -----------------------------------------------------------------------------
1828
2151
dnl #SEE ALSO: