Commit Graph

51 Commits

Author SHA1 Message Date
Roland Kaufmann
d15e657cac Search for directory containing build scripts
Currently only the source tree is "searched", but the template could
be expanded to look in another/more locations (or be specified
explicitly on the command-line with a --with-opm-macros= option)
2013-08-15 09:50:26 +02:00
Roland Kaufmann
f44cd35d81 Move configure script to cmake/Scripts/ directory
We want all changes to happen there; retain a small script that
simply forwards the action to the main script in that directory.
2013-06-26 00:05:02 +02:00
Bård Skaflestad
28406d287d Include flag for enabling link-time optimizations
When LTO is disabled by default, we need a flag to re-enable it.
2013-06-14 08:54:32 +02:00
Roland Kaufmann
bfeac75fa9 Disable link-time, whole program optimization
When using LTO, the linker calls back to the compiler to figure out
where a certain symbol is defined. However, in many versions there
is apparently a bug that is triggered if a template in inlined in
both a used library and in the main program, but with different
versions of the compiler. The Boost exception class is particular
prone for this.

Thus, we disable the -lto from the development builds by default;
if anyone wants to test of the behaviour of their own compiler, they
must now explicitly turn on this flag.
2013-06-13 23:19:27 +02:00
Roland Kaufmann
28f5eabcbc Build release library by default
If you just download the source, compile and install, you get the
release library. Users who want to develop the code, must do setup
in their environment.
2013-04-09 11:03:07 +02:00
Roland Kaufmann
0b26514f0f Allow whole program optimization to be switched off 2013-04-05 00:14:26 +02:00
Roland Kaufmann
fcaa85e18b Add more support for configuring MPI
Handles options --enable-mpi and --with-mpi-prefix for compatibility
with other autotools projects which uses these settings to tell the
build system where the local MPI library is.
2013-04-03 10:52:57 +02:00
Roland Kaufmann
81cf91fae9 Teach configure wrapper to know about modules 2013-04-03 10:19:09 +02:00
Roland Kaufmann
6cfa13f136 Allow precompiled headers to be enabled from command-line 2013-03-15 20:06:40 +01:00
Roland Kaufmann
3f3ac283e8 Enable MPI support from DUNE with --enable-parallel 2013-03-15 11:40:30 +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
Atgeirr Flø Rasmussen
66d1f396f8 Merge pull request #178 from rolk/178_openmp
Require explicit enabling of experimental OpenMP support
2013-03-07 00:17:50 -08:00
Roland Kaufmann
252d853147 Disable use of OpenMP by default
If support for OpenMP should be added, it must be specified by
setting an option. If not, then warnings for unknown pragmas are
disabled, so that the code can have #pragma omp witout getting
messages during build.
2013-03-07 00:17:46 +01:00
Roland Kaufmann
269f33535b Bugfix wrong variable used
But since it added the option anyway, this was hard to catch (unless
one was trying to set both options at the same time)
2013-03-07 00:17:45 +01:00
Roland Kaufmann
9bfeb12410 Only make actual directory names canonical
If the directory that is specified does not exist, then keep the path
as entered, which makes for better error messages later.

We cannot print an warning on a non-existent name, because it may be
target directories that are specified, or perhaps logical options
(like --with-mpi=yes)
2013-03-06 22:08:42 +01:00
Roland Kaufmann
38353a891c Allow variables and options in any order
Traditionally, options are put before any other command-line arguments.
However, dunecontrol puts variable assignment before options, like env,
and this confuses getopt.

This variant (based on a suggestion by Andreas Lauser) collects the
variables into an array at the same time as the options are processed.
2013-03-06 22:08:16 +01:00
Roland Kaufmann
3f7e1f5002 Only warn for unknown --enable/--with options
Follow the guidelines in
<http://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/
html_node/Option-Checking.html#Option-Checking>
and print a *warning* if there is an unknown --enable-* or --with-*
option, error otherwise. --disable-option-checking does not turn off the
errors, but silences the warnings.
2013-03-06 22:07:45 +01:00
Roland Kaufmann
7104ac7dae Expand tilde used in command-line arguments
This enables one to specify e.g. --with-opm-core=~/opm/bld/opm-core
2013-03-05 22:12:11 +01:00
Atgeirr Flø Rasmussen
0ac31dd871 Merge pull request #166 from rolk/166_upcase
Use uppercase consistently in configuration variable names
2013-03-05 00:49:33 -08:00
Roland Kaufmann
a09d9fa919 Handle quoted assignment arguments with whitespace
If we are going to set e.g. CXXFLAGS to more than one value, the
quotes must be preserved at the same time as the list is laundered
(for autotools-variables)
2013-03-04 22:48:44 +01:00
Roland Kaufmann
be9b33e687 Use uppercase for the shared-object variable as well 2013-03-04 21:58:36 +01:00
Roland Kaufmann
cdfe3a7b66 Consolidate package location variables
Always use the same form of package location variable, to maintain
consistency.
2013-03-04 21:51:59 +01:00
Roland Kaufmann
4ad50b09e3 Infer project name from dune.module 2013-03-04 09:46:32 +01:00
Roland Kaufmann
dfe6dbbb35 Handle all DUNE and OPM modules the same way
dunecontrol will specify --with-* for each and every module that is
listed as a dependency in dune.module; there is no difference between
them because they all share the same code :-)
2013-03-04 09:46:32 +01:00
Roland Kaufmann
6234ca50fa Use generic name for configure wrapper also 2013-02-22 11:21:58 +01:00
Roland Kaufmann
e7e53cedbf Rearrange options in order of need
Boost is very little likely to be removed from the list of dependencies;
we rather want a continuous block to remove when customizing.
2013-02-22 10:33:22 +01:00
Roland Kaufmann
6e1453a80d Allow --without as an alias to --disable
This gives a symmetry to --with-xxx options
2013-02-22 10:21:18 +01:00
Roland Kaufmann
be26e078d2 Allow CMake program to be specified with env. var.
If you are using a custom CMake, you should be able to set the
environment variable "CMAKE" and have the configure script pick up
the default from there so that you don't have to specify the option
every time.
2013-02-15 13:51:53 +01:00
Roland Kaufmann
ad5d4847c2 Look for CMake 2.8 if available on system
We require at least this version, and if there is a newer, it will
probably break due to lack of backward compatibility anyway.
2013-02-15 13:51:52 +01:00
Roland Kaufmann
cbd78d9cc2 Allow user to specify another version of CMake
On CentOS, cmake28 must be used rather than the standard cmake
2013-02-15 13:51:52 +01:00
Roland Kaufmann
51a8efa228 Disable precompiled headers for buggy compilers 2013-02-11 23:08:29 +01:00
Roland Kaufmann
642a0a71fc Strict option checking unless otherwise specified
Having option checking catches typos. Disabling the checking enable us
to use the same build options for a bunch of packages even though they
may not have the same dependencies.
2013-02-11 23:08:28 +01:00
Roland Kaufmann
13faf2123e Allow to build without deprecation warnings in dunecontrol
dunecontrol should be passed the option
--configure-opts="--enable-fieldvector-size-is-method" if you want to
rebuild it from scratch without bazillion strange deprecation warnings,
this flag allows us to participate in that dance.
2013-02-11 23:06:37 +01:00
Roland Kaufmann
aedada918e Install .debug files in system location if writable
If the installation prefix is set to /usr, then it is assumed that the
user has write access to the entire of that subtree, and that it would
be advantageous to put the .debug files in the /usr/lib/debug directory.
This is the usual case for package installations.

On the other hand, if the prefix is NOT /usr, then it is probably a
local installation; someone trying to install it to a more restricted
area. In that case, the default is to follow the binary, so that GDB
will still pick up the .debug file when loading the shared object.

In any case can this default be overridden, should it turn out that the
configuration script has guessed wrongly for your needs.
2013-02-11 23:06:36 +01:00
Roland Kaufmann
cfb419282e Enable printing of compiler command-lines 2013-02-11 22:38:01 +01:00
Roland Kaufmann
05a4ff30bf Enable opt-out of precompiled headers
Some versions of the compiler are buggy, and will actually crash if
precompiled headers are used. This option enable disabling the feature
and building without by simply setting a command-line option.
2013-02-11 22:38:01 +01:00
Roland Kaufmann
6471b7ef3a Issue information about --prefix and DESTDIR in help
Use --prefix= in ./configure to enter the directory under which the
files should be installed on the target system, use DESTDIR= in
make install to redirect files to another location when building.
2013-02-11 22:38:01 +01:00
Roland Kaufmann
e951358d0b Test for directory existence before getting canonical path 2013-02-11 22:38:00 +01:00
Roland Kaufmann
b2569225cd Allow location of TinyXML to be specified 2013-02-11 22:38:00 +01:00
Roland Kaufmann
989e38a68a Allow umfpack to be used as an alias for SuiteSparse
Most people will associate the use of SuiteSparse with "using UMFPACK"
since that is the component that is actively used.
2013-02-11 22:37:58 +01:00
Roland Kaufmann
ce73423ba4 Enable release mode from wrapper script
By using --disable-debug (--enable-debug is the default), release mode
can be toggled from the wrapper script.

Some IDEs, notably QtCreator requires this flag to be set when running
CMake, in order to enable debugging properly. Thus, it is explicitly
set (and printed) when using ./configure also.
2013-02-11 22:37:58 +01:00
Roland Kaufmann
3bac901afe Quote paths
Otherwise strange things will happen if they contain spaces
2013-02-11 22:37:57 +01:00
Roland Kaufmann
dcba0c32bd Assume that all paths to modules are directories
Old implementation had a problem with the special case that you
specified a directory directly under the root (e.g. /usr); dirname
adds a trailing slash in that case.
2013-02-11 22:37:57 +01:00
Roland Kaufmann
4eb1a07759 Display CMake command-line that is being executed
Since this is a compatibility script it will probably benefit people
seeing which underlaying CMake command is being executed (not at least
for debugging purposes)
2013-02-11 22:37:57 +01:00
Roland Kaufmann
10f8dfa390 Allow DUNE paths to be specified in configure
Path to DUNE libraries are specified with the ROOT prefix, but with the
stem with the same name as the module -- in lowercase (otherwise; does
the hyphen uppercase to underscore?). This deviates somewhat from the
usual CMake convention of using uppercase all over the place.
2013-02-11 22:37:57 +01:00
Roland Kaufmann
8b7990a8ea Remove tabs in shell script
Indentation by tab will cause a file listing for the current directory
before the command is executed, and that what not intended here.
2013-02-11 22:37:57 +01:00
Roland Kaufmann
34702606ca Make building libraries static or shared selectable
Default is still to make a shared object because this is the most
versatile target (it can be included in other shared objects as well
as executables).

Note that due to limitations in CMake, either a shared or a static
library can be built, but not both. (This is due to the fact that on
Windows, an import library has the same name as a static library).
2013-02-11 22:37:56 +01:00
Roland Kaufmann
06b17b9b21 Use full path to packages specified
CMake will change to the source directory when processing the
CMakeLists.txt file which causes relative paths to be based on this
instead of at the build directory which is probably assumed by the
user.
2013-02-11 22:37:56 +01:00
Roland Kaufmann
bce2199661 Allow to disable the inclusion of some libraries
Setting these options will cause these libraries to be dropped, even if
they can be found with automatic probes.
2013-02-11 22:37:56 +01:00
Roland Kaufmann
ed91d5be49 Dependencies' directories can be spec. on cmd. line
Instead of having to run `ccmake` or looking up which variables that
must be set, the configure driver is now enhanced to recognize options
that sets the installation directories for some of the dependencies.
2013-02-11 22:37:56 +01:00