Commit Graph

278 Commits

Author SHA1 Message Date
Bård Skaflestad
a26b981f45 Don't Require Floating Point from_chars() Function
This commit broadens the scope of commit 2ad332e0b (PR #922) to
apply to all compilers/libraries, not just Clang/libc++, which do
not have support for floating-point types in std::from_chars().
While hopefully a transient situation, this enables building the
parameter system with GCC versions prior to GCC 11.  We expect to
require version 11 in the not too distant future, though.  At that
point we should revert this commit.

We use a configure-time feature test of the compiler (CMake command
'try_compile') to detect whether or not the compiler supports
floating-point overloads of std::from_chars() and emit the result to
config.h as the new preprocessor symbol

    HAVE_FLOATING_POINT_FROM_CHARS

We use std::strtod() as the fall-back alternative for floating point
conversion if this symbol is defined to false (zero).
2024-09-03 10:49:49 +02:00
Joakim Hove
605397beae Removed cmake/ directory 2015-05-15 14:30:52 +02:00
Atgeirr Flø Rasmussen
88d72be556 Update Eigen requirements.
Manually imported from opm-autodiff.
2015-04-10 15:25:34 +02:00
Andreas Lauser
a9d0306fe8 reduce the default optimization level from -O3 to -O2
-O3 is sometimes declared "unsafe"
(cf. https://wiki.gentoo.org/wiki/GCC_optimization ) and it seems like
it bit us in https://github.com/OPM/opm-material/issues/23 if GCC 4.8
was used. so let's play safe and use -O2 for now...
2015-04-10 15:09:23 +02:00
Jørgen Kvalsvik
28c2c463cb Cleans up PETSc detection
Now building will no longer fail if PETSc isn't available, and it correctly
degrades if it cannot find an available MPI. It should now behave similarly as
other optionals, such as SuperLU.
2015-04-10 15:09:22 +02:00
Andreas Lauser
e2180effce FindCXX11Features.cmake: check for the c++-2011 "final" specifier 2015-04-10 15:09:21 +02:00
Andreas Lauser
e0dd62a226 only generate debugging symbols for the build types "Debug" and "RelWithDebInfo" 2015-04-10 15:09:21 +02:00
Andreas Lauser
89129aaaf6 build system: do not separate the debugging symbols by default
the reason is that the tools for profiling and for coverage analysis
(i.e., gprof and gcov) have trouble with this and crash. if you want
this to be enabled for whatever reason, use the cmake flag
-DSTRIP_DEBUGGING_SYMBOLS=ON or pass configure the
--enable-strip-debug option.
2015-04-10 15:09:20 +02:00
Andreas Lauser
2bb5159a97 FindAlugrid.cmake: do not try to include the whole grid
first this makes the test very slow, second (and more importantly) it
makes the test fail on dune master as the header relies on the
presence of the DUNE_GRID_VERSION* macros which are not present at the
configure stage of the build...
2015-04-10 15:09:19 +02:00
Robert K
9c4161bbdb add cmake module for ZOLTAN
also, link it to alugrid if it has been detected.
2015-04-10 15:09:19 +02:00
Robert K
fbb78323e8 fix metis check for gentoo installed METIS version. 2015-04-10 15:09:18 +02:00
Andreas Lauser
50ec899a3d eWoms: silence an annoying bogous deprecation warning on Dune 2.4 2015-04-10 15:09:17 +02:00
Andreas Lauser
fa04799855 remove the obsolete 'm4' subdirectory
as far as I can see, it provided M4 macros for autotools based
projects which wanted to use OPM. I have severe doubts that this was
used by anyone because it most likely does not even work. (e.g. the M4
macros does not seem to specify the ERT and opm-parser prerequisites.)

Note that I'm not 100% sure of the above, so if I'm wrong, state so
loudly and I'll close the PR...
2015-04-10 15:09:16 +02:00
Jørgen Kvalsvik
5630710986 Simplifcations in FindPetsc logic
Removes a lot of the conditionals in the makefile. As reflected in the
comments, find_* won't run if the target variable is already set, and appending
empty list elements changes nothing. In order to make reading the file easier
these conditionals have mostly been removed.
2015-04-10 15:09:15 +02:00
Jørgen Kvalsvik
4a2adec53a PETSC_ROOT now sets NO_DEFAULT_PATH
Allows a specific PETSC_ROOT to override and replace default search paths. Now,
if PETSC_ROOT is passed and the find_library calls cannot find the libraries,
the makefile will only search in user provided directories.
2015-04-10 15:09:15 +02:00
Jørgen Kvalsvik
a76363a7f7 FindPetsc uses system-provided MPI if available
When building with USE_MPI=ON the FindPetsc now uses the system provided
MPI if available. Falls back to looking for the PETSc provided unimpi for
sequential builds.
2015-04-10 15:09:14 +02:00
Jørgen Kvalsvk
92af07ae85 FindPets searches default paths w/ general namings
Removed the NO_DEFAULT_PATH flag as this really isn't working for most systems
(where PETSc will be installed from a repository and in /usr or /). Path suffix
parameters extended to accept more version-less configs too, to be compatible
with a default PETSc (debian style) install.
2015-04-10 15:09:13 +02:00
Jørgen Kvalsvk
33914bcceb Removes broken conditional check.
The FindPetsc module would check for a PETSC_ROOT and not attempt to look for
mpi and the petsc header if this was not set, which it in most cases won't be.
If the variable is set then the conditional include is redundant, as it will
search the explicitly passed paths first anyways.
2015-04-10 15:09:13 +02:00
Jørgen Kvalsvk
2de1568a33 Fixes status message when PETSc couldn't be found. 2015-04-10 15:09:12 +02:00
Liu Ming
975d161359 add HAVE_PETSC for config.h 2015-04-10 15:09:11 +02:00
Liu Ming
a8387f67dc Fix duplication errors. 2015-04-10 15:09:10 +02:00
Liu Ming
c7cd3c80b5 Let opm-core find Petsc if PETSC_ROOT is specified. 2015-04-10 15:06:08 +02:00
Liu Ming
38d3f29e2a cmake Module for finding Petsc. 2015-04-10 15:06:07 +02:00
Andreas Lauser
87afe12cda Finddune-grid.cmake: always enable the experimental grid extensions
this is now done by a config.h macro. The reason is that quite a bit
of code depends on boundary IDs which are only available as an
"experimental" grid extension in recent Dune releases...
2015-04-10 15:06:06 +02:00
Arne Morten Kvarving
a9deb4b367 fix opm-parser find rule
deals with the fallout of opm-parser #365 and #366
2014-12-08 15:26:48 +01:00
Arne Morten Kvarving
5dca993b69 add check-commits target 2014-12-08 15:26:18 +01:00
Andreas Lauser
6e52a7bc3b set CMake policies CMP0026 and CMP0048 to OLD
this is required for CMake 3.0 to stop it complaining that we access
the LOCATION target property and set the *_VERSION_* variables ourselves.
2014-12-08 15:24:49 +01:00
Andreas Lauser
c3304ed1a1 FindQuadmath: add -fext-numeric-literals if the compiler supports it
this is required for GCC >= 4.8 to support the 'Q' suffix for floating
point literals (which are used in the quadmath.h header)

In order to prevent compilers which eat the flag but do not support it
from complaining constantly, it is tested for with "-Werror" enabled...
2014-12-08 15:24:48 +01:00
Andreas Lauser
57879ab6c9 make the regex test more thorough
it seems like the std::regex delivered up to gcc 4.8 has problems with
constructs such as ".+". (at least if they appear at the end of a
regex...)
2014-12-08 15:24:47 +01:00
Andreas Lauser
926685cc2c ERT: link to the threads library of the OS
this is required to make the opm-core build succeed if ERT was build
with -DBUILD_SHARED_LIBS=OFF . (without it, I get errors like

    /home/and/src/ert/devel/libert_util/src/thread_pool_posix.c:328: error: undefined reference to 'pthread_create'
2014-12-08 15:24:46 +01:00
Andreas Lauser
cd8e4ad6a3 ewoms: make it possible to use the dune-alugrid module instead of the ALUGrid manager in dune-grid 2014-12-08 15:24:45 +01:00
Andreas Lauser
37ab6ef8a0 add support for the new DUNE-ALUGrid module
this is basically the dune-grid grid manager for ALUGrid properly
out-sourced into an own module. (it does not require an external
library anymore, so it simplifies the build quite a bit.) Also, the
DUNE-ALUGrid module has quite a few new features and performance
improvements compared to the old code from dune-grid. For details, see

http://users.dune-project.org/projects/dune-alugrid
2014-12-08 15:24:44 +01:00
Andreas Lauser
444e2be623 Build system: mark ERT as REQUIRED
de facto, this does not change anything because opm-parser is required
and it has a hard dependency on ERT. It is good style to declare all
prerequisites explicitly in each module, though. Thanks to [at]bska
for the catch.
2014-12-08 15:24:43 +01:00
Arne Morten Kvarving
a4fcc0a99f fixed: ERT depends on libdl
this issue was triggered with static libs for ERT
2014-12-08 15:24:38 +01:00
Andreas Lauser
05a607c7c9 use extended regular expressions in the test for std::regex
for some compilers (e.g., GCC < 4.9) the default is buggy and
opm-parser thus uses extended expressions...

thanks to [at]bska for digging this up!
2014-12-08 15:23:51 +01:00
Andreas Lauser
4a7dea3747 FindCXX11Features: check for a usable std::regex
and add a config.h variable in the opm-parser test.
2014-12-08 15:23:28 +01:00
Andreas Lauser
8119580a8d Find-ewoms.cmake: update prerequisites 2014-12-08 15:23:07 +01:00
Andreas Lauser
dff4e8f51c add the boost::regex library as a prerequisite
this is required for regex-matching keywords. Once GCC 4.9 is the
minimum compiler version to be supported, this can be dropped in favor
of std::regex ...
2014-12-08 15:23:06 +01:00
Andreas Lauser
526af686d8 Findopm-parser.cmake: Fix it up, next try
thanks to Arne Morten Kvarving, Bård Skaflestad and Roland Kaufmann
for the discussion.
2014-12-08 15:22:56 +01:00
Arne Morten Kvarving
316c0b5ad0 fixed: dune-cornerpoint (now) needs the dune-common version information 2014-12-08 15:21:49 +01:00
Joakim Hove
c6445dbe8f FindERT.cmake: Look for libecl_well library 2014-12-08 13:05:26 +01:00
Arne Morten Kvarving
68cbe6d0e9 fix opm-parser find rule
deals with the fallout of opm-parser #365 and #366
2014-11-18 13:33:33 +01:00
Atgeirr Flø Rasmussen
fa5d725bc3 Remove header generation, add define for warning suppression.
Thanks to @akva2 for original patch.
2014-09-20 10:39:34 +02:00
Andreas Lauser
9169bee053 use extended regular expressions in the test for std::regex
for some compilers (e.g., GCC < 4.9) the default is buggy and
opm-parser thus uses extended expressions...

thanks to [at]bska for digging this up!
2014-07-08 13:24:34 +02:00
Andreas Lauser
4e298bb4f9 FindCXX11Features: check for a usable std::regex
and add a config.h variable in the opm-parser test.
2014-07-07 17:58:07 +02:00
Andreas Lauser
af60949051 add the boost::regex library as a prerequisite
this is required for regex-matching keywords. Once GCC 4.9 is the
minimum compiler version to be supported, this can be dropped in favor
of std::regex ...
2014-07-02 11:25:57 +02:00
Andreas Lauser
5cdece9e3e Findopm-parser.cmake: Fix it up, next try
thanks to Arne Morten Kvarving, Bård Skaflestad and Roland Kaufmann
for the discussion.
2014-07-02 11:24:14 +02:00
Arne Morten Kvarving
132657e478 added: hook for conditionally compiled files
backport from opm-upscaling PR#100
2014-06-16 15:53:01 +02:00
Bård Skaflestad
c5bbf19fce Disable search for Boost in parser detection
This changeset disables the effect of commit 778e87d.  There appears
to be an unforeseen interaction between the calls to

    Find_Package (Boost)

that are implied by module 'opm-parser-prereqs.cmake' and the one
that's directly invoked in 'Findopm-parser.cmake'.  Until the
situation can be fully analysed and a complete solution implemented,
this is a temporary measure to restore the build of opm-core and
downstream OPM modules.
2014-06-16 15:50:21 +02:00
Andreas Lauser
778e87d710 Findopm-parser.cmake: invoke FindBoost unconditionally
even if boost was found previously, it might still miss a few
libraries. thanks to @akva2 for catching this.
2014-06-16 15:50:02 +02:00