Commit Graph

30 Commits

Author SHA1 Message Date
Ivar Ursin Nikolaisen
b448adff16 Make configure.ac compatible with automake 1.12
Since automake 1.12 warnings in the category 'extra-portability' are
enabled with -Wall [1]. In automake 1.11.2 the AM_PROG_AR macro was
added and is required when compiling with extra-compatibility [2].

[1] http://lists.gnu.org/archive/html/automake/2012-04/msg00060.html
[2] http://lists.gnu.org/archive/html/automake/2011-12/msg00055.html
2012-08-23 14:20:41 +02:00
Bård Skaflestad
9f47cf0f54 Explicitly substitute absolute path variables.
Apparently, Automakes prior to 1.10 do not automatically substitute
the absolute path directory variables

   abs_srcdir    abs_top_srcdir
   abs_builddir  abs_top_builddir

that Autoconf computes (since ca. 2003) into the Makefiles.  This
leads to a subtle error when OPM-Core is used in conjunction with
dune-common's DUNE_CHECK_MODULES (or, more appropriately, our own
OPM_CORE_CHECK_MODULES) macro that gets invoked through dunecontrol.

The *_CHECK_MOUDLES macro contains an unconditional statement that
uses 'abs_top_srcdir' to compute the absolute path to the current
module's top source directory.  When abs_top_srcdir is unset, the
root becomes unset too, whence the subsequent existence and validity
checks fail due to incorrect CPPFLAGS and/or LDFLAGS.  It will also
fail to locate the 'dune.module' dependency file.

By explicitly substituting the above variables into the Makefiles,
as was also done in revisions 5819 and 5845 of dune-common's
Subversion repository, we're guarding against this particular
failure mode.

Tested on: CentOS 5.8 (Autoconf 2.59, Automake 1.9.6)
2012-07-12 14:37:23 +02:00
Andreas Lauser
31d0681a66 opm-core: make it a usable in conjunction wit dunecontrol
This allows projects which use the DUNE build system and want to use
OPM-Core to specify a dependency in their dune.module file. (i.e. they
don't have to worry about compiler and linker flags anymore.)

opm-core can still be used without having DUNE installed, though. This
means that for users which do not need/want a dependency on DUNE,
nothing changes.

v2: avoid naming conflict of the AX_BOOST_BASE macro with dune-common
    by renaming it to OPM_BOOST_BASE.
v3: make the library detection work nicely
v4: Use AX_BOOST_BASE M4 macro from opm-core instead from dune-common
    as base for OPM_BOOST_BASE to get rid of a few bugs, reworded
    commit message. Thanks to Bård Skaflestad for the review.
2012-07-02 19:17:25 +02:00
Bård Skaflestad
11d90ddeab Add AC macro to determine how to link Boost.Test
Details:
Test suites based on Boost.Test must know how to include the library
support code into the executables.  If the Boost.Test library is
dynamically linked, then test suites must define the pre-processor
symbol "BOOST_TEST_DYN_LINK".  Otherwise, this symbol must *not* be
defined.

Resolution:
Introduce a new Autoconf macro, OPM_DYNLINK_BOOST_TEST, that defines a
secondary symbol--HAVE_DYNAMIC_BOOST_TEST--if the local computer system
uses dynamic linking.  Test suites (e.g., tests/param_test.cpp) may then
inspect this symbol to determine whether or not to #define
BOOST_TEST_DYN_LINK.

Call the macro from "configure.ac".

Suggested by: Joakim Hove
2012-06-27 16:26:52 +02:00
Bård Skaflestad
c724bb6b3a Add preliminary build glue to include AGMG in the OPM-Core library.
The approach will likely be changed due to the presence of
"subdir-objects" in the AM_INIT_AUTOMAKE call.
2012-06-05 19:44:18 +02:00
Bård Skaflestad
40ef0e9573 Revamp Fortran support in preparation of enabling Notay's AGMG solver.
Specifically:
  - Enable C++, Fortran 77 and Fortran (95+) through Libtool's LT_LANG
    if available and through the traditional AC_PROG_* macros if not.

    This configuration is compatible with the versions of Libtool
    easily available for testing.  For whatever reason--possibly a
    programming error in Libtool proper--invoking the AC_PROG_F*
    macros either directly or through AC_REQUIRE following an LT_INIT
    invocation leads to various ``expanded before required'' warnings.

    Searching the Autotools mailing lists does suggest that the
    interaction of C++, Fortran and Libtool is traditionally somewhat
    unstable but has improved in very recent editions of Autoconf and
    Libtool.

  - Re-factor the LAPACK support out to a custom macro, OPM_LAPACK,
    and invoke it from configure.ac.
2012-06-05 18:40:36 +02:00
Bård Skaflestad
99cd22cb78 Honour inter-library dependencies between cholmod and colamd.
The former depends on the latter, whence the latter must be brought in
before the former.

While here, include checks for additional library components that may
be needed to satisfy all UMFPACK dependencies in more recent editions
of the SuiteSparse package.

Issue noticed by: Joakim Hove
2012-05-23 10:39:21 +02:00
Atgeirr Flø Rasmussen
bc371d4df1 Initial version of automatic checking for dune-istl in build system. 2012-04-13 15:35:19 +02:00
Xavier Raynaud
490f312821 Fixed configure.ac file to take into account tutorials 2012-04-10 17:46:52 +02:00
Bård Skaflestad
ef1fc80c07 Initialise maths support early. 2012-02-10 14:59:40 +01:00
Bård Skaflestad
2566bbc01f Solidify checks for maths-related functions.
Specifically, bring in maths library through AC_SEARCH_LIBS and add
checks for sqrt() and pow() only after we've established which library
might contain these functions.  Similarly, rely on AC_SEARCH_LIBS
adding -lamd to ${LIBS} if needed in which case it is not necessary to
manually bring these libraries in while searching for UMFPACK.

Finally, add check for memset().  Needed by Tarjan implementation.
2012-02-07 00:25:40 +01:00
Atgeirr Flø Rasmussen
f8d5ea02a3 Added some libraries that may be needed with newer versions of UMFPACK. 2012-01-19 13:04:12 +01:00
Atgeirr Flø Rasmussen
bfb1e1f03b AM_PROG_CC_C_O needed because of subdir objects. 2012-01-06 11:22:35 +01:00
Bård Skaflestad
65ee11ea69 Check for ranlib utility and strtod function.
Suggested by: autoscan.
2012-01-03 20:38:31 +01:00
Bård Skaflestad
b48a4d6f27 There is (currently) no need to invoke 'AM_PROG_CC_C_O'.
Specifically, we don't (currently) use per-target compilation or
linking flags, and therefore do not need a portability aid in our
current build process.
2012-01-03 20:31:51 +01:00
Bård Skaflestad
d23f325e9b Prefer to initialise Libtool using the 'LT_INIT' macro.
Fall back to 'AC_PROG_LIBTOOL' if 'LT_INIT' is not available.
2012-01-03 20:24:19 +01:00
Bård Skaflestad
93556dc60d Provide diagnostic message when failing to locate UMFPACK library.
Not all processors support the 'AM_COND_IF' macro (introduced in
Automake 1.11), so only call the macro if it is available in the
processor.
2012-01-03 20:20:16 +01:00
Bård Skaflestad
eb991cefab Restore UMFPACK header check to its original position.
We should check for existence of all headers before inspecting their
contents, e.g., to establish types or particular functions.
2012-01-03 10:02:06 +01:00
Atgeirr Flø Rasmussen
81a72be23b Now detects boost and compiles some tests. 2011-12-19 15:26:26 +01:00
Atgeirr Flø Rasmussen
3ddf930b42 Now works with suitesparse on CentOS 5.7. 2011-12-13 10:26:31 +01:00
Atgeirr Flø Rasmussen
2366dc4445 Now configuration succeeds for CentOS 5.7. 2011-12-12 14:57:09 +01:00
Atgeirr Flø Rasmussen
8f8a925f5a Updated for changed paths. 2011-12-12 11:29:14 +01:00
Atgeirr Flø Rasmussen
3e1360b570 Made configuration work with autoconf 2.62 and automake 1.11.1. 2011-12-09 16:11:30 +01:00
Bård Skaflestad
7c00d2e144 Add preliminary detection of UMFPACK library (and headers). 2011-12-08 16:15:14 +01:00
Bård Skaflestad
66b82865d4 Complete cset ad3d926031e7. 2011-12-08 14:49:09 +01:00
Bård Skaflestad
16780b8312 Remove remnants of previous Autotools build system. 2011-12-08 13:58:10 +01:00
Bård Skaflestad
72f81cf574 Hook 'examples' up to build. 2011-10-05 20:09:29 +02:00
Bård Skaflestad
60bdba1433 Add detection and optional support for UMFPACK and OPMPressure. 2011-10-03 18:16:57 +02:00
Bård Skaflestad
f8f6bba0cd Enable silent build rules if available in Automake.
Automake 1.11 introduced the concept of "silent build rules" wherein the
build commands are reported as

  CC     spu_explicit.lo

rather than something along the lines of

  /bin/bash ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I../../../../../opmtransport/src -I..     -O3 -DNDEBUG -Wall -Wextra -std=c99 -pedantic -march=native -mtune=native -MT spu_explicit.lo -MD -MP -MF .deps/spu_explicit.Tpo -c -o spu_explicit.lo ../../../../../opmtransport/src/spu_explicit.c
  libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../../../../../opmtransport/src -I.. -O3 -DNDEBUG -Wall -Wextra -std=c99 -pedantic -march=native -mtune=native -MT spu_explicit.lo -MD -MP -MF .deps/spu_explicit.Tpo -c ../../../../../opmtransport/src/spu_explicit.c  -fPIC -DPIC -o .libs/spu_explicit.o
  libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../../../../../opmtransport/src -I.. -O3 -DNDEBUG -Wall -Wextra -std=c99 -pedantic -march=native -mtune=native -MT spu_explicit.lo -MD -MP -MF .deps/spu_explicit.Tpo -c ../../../../../opmtransport/src/spu_explicit.c -o spu_explicit.o >/dev/null 2>&1

The former is much easier to read and, consequently, more conducive to
visually noticing diagnostics from the toolset (compiler, linker &c).

On the other hand, only fairly recent editions of Automake have the
"silent rule" capability, so enable silent rules only if available.  In
particular, Automake 1.10.x (the default Automake version in MacOS X
10.6) does not support the capability.  Neither does the default
Automake in CentOS 5.6.

Further details on silent build rules can be found at

  http://sources.redhat.com/automake/automake.html#Options
  http://www.flameeyes.eu/autotools-mythbuster/automake/silent.html

Thanks to Arne Morten Kvarving in Dune Flyspray issue #922
(http://www.dune-project.org/flyspray/index.php?do=details&task_id=922)
for the tip on how to preserve "configure.ac" backwards compatibility
with Automake < 1.11 .
2011-05-27 15:05:02 +02:00
Jostein R. Natvig
ac71f1092f * Move source code to src directory.
* Add autotools build system for opmtransport library.
2010-11-10 10:29:41 +01:00