Commit Graph

415 Commits

Author SHA1 Message Date
Roland Kaufmann
e8e3960f47 Detect empty elements in dependency list
These errors are usually an extra trailing semi-colon, which is easy
to put in there for symmetry with the other lines. Give a warning on
this but proceed with the build as usual afterwards.
2013-04-04 10:43:51 +02:00
Roland Kaufmann
adb2dcef32 Remove trailing empty element on dependency list
An extra semi-colon had snuck in here which caused the project to be
dependent on a module called "", which of course failed further down
the line.

This error was previously undetected because we didn't have anything
that depended on opm-upscaling.
2013-04-04 10:33:25 +02:00
Roland Kaufmann
760739bf2d Also look in corresponding build-dir as ourself
If we are building in a sub-dir to the source tree, guess that a
dependent module is also that, and that the directory that is given
is for the suite, not for the project alone.
2013-04-03 10:16:56 +02:00
Roland Kaufmann
0054c55019 Allow packages to be installed directly in suite dir
Let us specify e.g. --with-dune=/usr, so that the _ROOT variable is
set to e.g. /usr/dune-common, but then backtrack to the parent directory
again if we don't find anything there and search directly in suite dir.
2013-04-03 10:16:55 +02:00
Roland Kaufmann
1754474df1 Give better diagnostics in case probe fails
The standard argument handling report which item that failed
(_INCLUDE_DIR, _LIBRARY og HAVE_) but it doesn't provide information
about the root that was used to search for these. Given that we now
automatically search a lot of other places, the _ROOT variables should
be reported before the error is raised.
2013-04-03 10:16:54 +02:00
Roland Kaufmann
9d65dec0ac Provide suite info for those not in name convention 2013-04-03 10:16:54 +02:00
Roland Kaufmann
83fb758b74 Search for module in suite directory if specified
Instead of having to specify each and every project in a suite such as
DUNE or OPM, allow a root directory for the entire suite to be specified
and then assume that each module is located in a sub-directory to this.

Each individual project can still have its path explicitly specified, if
a special build of those are required.

The suite variable itself will be written to cache by being specified
on the command line. Each individual project directory will NOT be
written to cache, because then we cannot get rid of it by specifying a
new suite directory.
2013-04-03 10:16:53 +02:00
Roland Kaufmann
1dd608358c Write cmdline in .pc file without abs paths
When passing libraries to gcc/ld, the search path and library name must
be specified separately. This is already done when writing a libtool .la
and should be done in the pkg-config .pc file too.
2013-03-22 22:27:14 +01:00
Roland Kaufmann
6d72c94d0c Factor out routine that converts lib list to cmdline
This routine is useful in its own rights and should be made available as
a function that others can call too.
2013-03-22 22:27:13 +01:00
Atgeirr Flø Rasmussen
3c7594d4c0 Fix exclusion of TinyXML from doc generation. 2013-03-22 08:35:00 +01:00
Atgeirr Flø Rasmussen
3433596dad Merge pull request #216 from rolk/216_build
Guess sibling build directories based on the name of this one
2013-03-21 04:58:40 -07:00
Roland Kaufmann
a23f09f7c9 Set up installation for target marked as such
Source files can be put on a special list of `utilities' that are
also marked for distribution after they are compiled.
2013-03-21 00:00:50 +01:00
Roland Kaufmann
2be16e8e61 Search in build directories named similarly to ours
Assume that a build that uses an out-of-source subdir, uses modules
with the same last component as ours.
2013-03-20 23:36:45 +01:00
Atgeirr Flø Rasmussen
8c8295cae6 Merge pull request #215 from rolk/215_no_sys
Follow the principle of least surprise when locating modules
2013-03-20 05:55:50 -07:00
Roland Kaufmann
631e377f6a Search siblings before system directories
If there is a sibling directory with the name of the module we are
searching for, it is probably part of the same suite, and is the
version we intend to use, before the system version.

This behaviour can be altered with the option SIBLING_SEARCH.

Note, however, that if the sibling is a source tree, it cannot guess
which subdir the build tree is in. You will then probably end up
with headers from the sibling and libraries from the system!
2013-03-20 12:24:04 +01:00
Roland Kaufmann
2b59d556f0 Use heuristics when finding rather than adjusting path
Commit b6cdc06b introduced heuristics to look in the parent directory
for header files alone, while leaving the path for binary files. This
is much better than adjusting the path because one does not potentially
confuse two build directories this way.
2013-03-20 11:30:44 +01:00
Roland Kaufmann
b709645181 Don't search in system dir if explicit dir given
If we give an explicit directory path it is because we want a special
version to be used instead of the system version; if there is any
problems with that, we should know up-front instead of silently start
using the system version again!
2013-03-20 09:58:33 +01:00
Roland Kaufmann
9406e198cb Use empty string instead of zero to indicate not found
When writing the variable HAVE_SUPERLU to the config.h file, an empty
string will be interpreted as "not defined". Thus, we can use both
if and ifdef preprocessor directives to check for it. If we use zero,
then we must be careful to always use if, never ifdef.
2013-03-20 09:34:33 +01:00
Roland Kaufmann
b6cdc06b7a Don't search system directories when path given
If the user has given a path to the module, then the system paths should
not be searched, as these may contain an old and outdated version. We
don't necessarily want that just because there was a problem with our
own installation!
2013-03-20 09:33:35 +01:00
Roland Kaufmann
2e5e3d2168 Prepend source directory to include path
If the dependencies have files with relative paths that are ambigious
to our own, we want our version to be the first candidate for inclusion.
This is a variant of the reason for why we always include the build
directory first (and still does).
2013-03-20 08:13:40 +01:00
Roland Kaufmann
ed4b62ae4b Indicate failure to find header with blank string
Use empty string instead of zero, so it can be tested with #ifdef as
well as #if in the C++ source code.
2013-03-19 13:28:30 +01:00
Roland Kaufmann
0eb46b567d Indicate failure to find header with blank string
Use empty string instead of zero, so it can be tested with #ifdef as
well as #if in the C++ source code.
2013-03-19 13:06:43 +01:00
Roland Kaufmann
ce16450e43 Bugfix change from function to macro
This change is similar to commit 89be4e14: After find_package_append_to
changed from function to macro to pick up the configuration not only
from the module itself but also from everything it pulled it, the
variable MODULE is overwritten (variable module in lower case is a
parameter, so it is replaced in the source body). Thus, the test in the
end is not whether *this* module was found, but if its last dependency
was! This made the build crash only in some projects but not in others.
2013-03-18 10:32:53 +01:00
Roland Kaufmann
040b7adb4e Search for libraries in dunecontrol's default build dir 2013-03-17 21:03:19 +01:00
Roland Kaufmann
4d7752b980 Don't search for source in build directories 2013-03-17 21:03:09 +01:00
Roland Kaufmann
5401df41b5 Use find modules for libraries with extra processing
Some libraries require more information than what is present in the
xxx-config.cmake file, e.g. the caller must know whether HAVE_TUPLE
is available and probably used when compiling dune-common, and put
this in its own config.h file.

Code to take care of these variables must therefore be in the client
configuration, and this is the same code which is used to handle the
autotools version, namely the find module, so a practical solution
is to just revert to that in both cases.
2013-03-17 21:03:00 +01:00
Roland Kaufmann
9c1da9f5bf Bugfix don't search for module twice! 2013-03-15 13:48:43 +01:00
Roland Kaufmann
bafa781181 Search in dunecontrol build directories for other modules 2013-03-15 12:44:24 +01:00
Roland Kaufmann
88b0740480 Bugfix expand variable definition 2013-03-15 12:23:57 +01:00
Roland Kaufmann
89be4e145a Bugfix change from macro to function
All variables we introduce which is not parameters are in fact global
variables that may be overwritten by recursive invocation!
2013-03-15 11:40:30 +01:00
Roland Kaufmann
edd6b15497 Add MPI dependency for dune-common
mpihelper.hh needs to know HAVE_MPI in the same way as the compiled
library in order to generate a consistent interface.
2013-03-15 11:38:45 +01:00
Roland Kaufmann
f42bf41e15 Use our own find routine recursively
Don't use bare find_package in OpmPackage when we have already written
OpmFind to take out the worst warts.
2013-03-15 10:57:53 +01:00
Roland Kaufmann
ce007fca7d Abstract into common version and parameterize 2013-03-15 10:57:53 +01:00
Roland Kaufmann
3d252ae8f4 Allow variables from indirect dependencies to bubble up
The previous implementation was a function, which although OK from an
implementation standpoint -- the local variables doesn't pollute the
global namespace -- would not allow variables that were set in indirect
dependencies to bubble up to the main module. This is a problem for
modules which are dependent on configuration variables to be present.
2013-03-15 10:45:05 +01:00
Roland Kaufmann
ccbcb6f364 Enable debug tracing when finding modules 2013-03-15 01:24:06 +01:00
Roland Kaufmann
8dcca4cf9b Use camel-case in SuperLU's name
Originally, I added FindSuperLU with uppercase since the variables it
returned had that case. Now the scripts should be patched so that it
searched for uppercase amongst the variables as well, so the module
name can retain its original case (and for compatibility with DUNE)
2013-03-15 01:24:06 +01:00
Roland Kaufmann
97c2fabe8e Search for uppercase variants of the package vars as well
For compatibility with packages that believes that every variable
should be in uppercase, we try this variant when adding relevant
variables to the project.
2013-03-15 01:23:59 +01:00
Bård Skaflestad
fb9e09063c Merge pull request #193 from rolk/193_arch
Don't search in architecture-irrelevant directories
2013-03-13 03:41:29 -07:00
Roland Kaufmann
44a638dce3 Test strings on length before content
A substring can of course not be longer that the full string. Also fixes
problems with CMake-versions that doesn't handle out-of-range parameters
to the SUBSTRING sub-command.
2013-03-13 11:20:28 +01:00
Roland Kaufmann
ac861580d7 Don't search in architecture-irrelevant directories
If we are on a 64-bits machine, there is no point in searching lib32
and conversely. Quite the opposite, it can only end badly if a library
is actually found in the wrong architecture directory.
2013-03-13 10:38:27 +01:00
Roland Kaufmann
38bcff4e12 Allow subdir builds with dunecontrol
dunecontrol will check for a dune.module file to regard the directory
as containing the module. If we put this is a sub-dir of the source,
it will get confused, so we shouldn't. There shouldn't be any
conflicting use-cases, as one cannot have several modules in the sub-
directory of one source (!?).
2013-03-13 01:20:44 +01:00
Roland Kaufmann
54c89146d7 Enable CMake < 2.8.5 clients to report Git version 2013-03-13 01:02:03 +01:00
Roland Kaufmann
58dd4fd7b4 Include standard math runtime library when linking numerics 2013-03-13 00:01:41 +01:00
Roland Kaufmann
1e765a2f29 Don't probe for umfpack with cholmod unless latter is found 2013-03-12 12:22:57 +01:00
Roland Kaufmann
f6d44238b1 Simplify setting of flag that indicates shared object
Instead of having the name of the module set for each flag, use the
available standard option. Mixing shared objects and static libraries
in the same build is not a very realistic scenario anyway.

This enables us to call configure without actually having a particular
module; the script may then be used on a group level.
2013-03-07 21:28:17 +01:00
Bård Skaflestad
144be75cea Merge pull request #182 from rolk/181_opmgrid
Recreate grid selection macros from DUNE
2013-03-07 05:39:24 -08:00
Roland Kaufmann
e507e18eed Check for tuple support 2013-03-07 14:27:41 +01:00
Roland Kaufmann
9280a2d9ff Check for constexpr attribute 2013-03-07 14:25:24 +01:00
Roland Kaufmann
c7db7805d1 Recreate grid selection macros from DUNE
This duplicates functionality from the old autotools implementation
in case any user code needs it. It is not necessary to build the
OPM modules themselves.
2013-03-07 13:55:51 +01:00
Bård Skaflestad
316c691c81 Merge pull request #180 from rolk/180_compver
Diagnose compiler version in configuration output
2013-03-07 04:14:15 -08:00