Commit Graph

27 Commits

Author SHA1 Message Date
Arne Morten Kvarving
fb75bcd4e2 changed: use std::filesystem instead of boost::filesystem
since we still support g++-7, where filesystem is marked experimental,
we introduce a wrapper header and expose the namespace to use
as Opm::filesystem.

for gcc we unconditionally link with libstdc++fs in the python bindings.
the setup.py stuff links as c code, not c++ code, so it is not
automatically added on any gcc version. this might prove unportable
later.
2020-02-13 12:34:19 +01:00
Joakim Hove
aaee287dac Code generation file update routines are void 2020-01-02 15:27:54 +01:00
Joakim Hove
c3a038c2b6 Refactor code generation to facilitate multiple source files 2020-01-02 15:27:54 +01:00
Joakim Hove
3c90adeea9 Remove unused functionality for directory loading of keywords 2018-08-10 11:28:52 +02:00
Jørgen Kvalsvik
f9639a330b Include header for boost/filesystem/path 2017-06-02 14:04:20 +02:00
Jørgen Kvalsvik
4adda14564 Generate keywords source and test files separately
Simplify the generator logic a bit by only creating one
ParserKeywords.cpp file, and create either source code for the library
or for the test. This is faster to compile serially, but is not possible
to compile in parallel. Still, it's a fair simplification, and clarifes
the makefile quite a bit, and makes dependencies and generation clearer.
2017-06-01 15:29:23 +02:00
Jørgen Kvalsvik
e884b0664c Redesign cmake
Tune the makefile according to new principles, which adds a few bells
and whistles and for clarity.

Synopsis:

* The dependency on opm-common is completely gone. This is reflected in
  travis and appveyor as well. No non-kitware cmake modules are used.
* Directories are flattened, quite a bit - source code is located in the
  lib/ directory if it belongs to opm-parser, and external/ if third
  party.
* The sibling build feature is implemented through cmake's
  export(PACKAGE) rather than implicitly looking through source files.
* Targets explicitly set required public and private include
  directories, compile options and definitions, which cmake will handle
  and propagate
* opm-parser-config.cmake for downstream users is now provided.
* Dependencies are set up using targets. In the future, when cmake 3.x+
  can be used, these should be either targets from newer Find modules,
  or interface libraries.
* Fewer system specific assumptions are coded in, instead we assume
  cmake or users set up system specific details.
* All module wide configuration and looking up libraries is handled in
  the root makefile - all sub directories only set up libraries and
  compile options for the module in question.
* Targets are defined and links handled transitively because cmake now
  is told about them. ${module_LIBRARIES} variables are gone.

This is largely guided by the principles outlined in
https://rix0r.nl/blog/2015/08/13/cmake-guide/

Most source files are just moved - if they have some content change then
it's nothing more than include fixes or similar in order to make them
compile.
2017-06-01 15:29:23 +02:00
Jørgen Kvalsvik
a22196546a ParserItem no longer requires heap alloc
Redesign of ParserItem so that its sum type nature no longer mandates
indirection, but rather a tag check on all operations. Because of this,
ParserRecords can now store ParserItems directly, and iterators are no
longer iterators to pointers, but behave like normal vector iterators.
2016-11-07 12:24:38 +01:00
Jørgen Kvalsvik
37c04328ca Remove shared_ptr typedefs 2016-10-19 20:38:28 +02:00
Jørgen Kvalsvik
f2e509f59f UnitSystem named constructors with automatic storage 2016-10-19 20:38:28 +02:00
Jørgen Kvalsvik
efc10007be Fix warnings in KeywordGenerator 2016-07-13 23:40:09 +02:00
Joakim Hove
14db80e91b Merge pull request #873 from jokva/appveyor
Appveyor support
2016-07-11 22:46:13 +02:00
Jørgen Kvalsvik
0823232aae Windows integration: boost::path for path equality
Use boost path for comparison, in order to get portable path comparison,
which makes the test pass on Windows.
2016-07-11 14:59:02 +02:00
Jørgen Kvalsvik
3696b750cd Remove opm-common dependency
Severs the code dependency on opm-commmon. There was no actual
functional dependency here, with the exception of some enable/disable
warning headers. To properly make opm-parser a stand-alone module the
usage of these headers have been removed and the dependency on
opm-common is gone.
2016-07-08 15:53:40 +02:00
Magne Sjaastad
fafd718789 VS2015: Must name all BOOST_TEST_MODULE to be able to compile 2016-05-25 10:39:19 +02:00
Magne Sjaastad
d51645db72 VS2015 : Use generic_string in generated filenames 2016-05-25 10:39:19 +02:00
Magne Sjaastad
85e3ae61b3 VS2015 : Added missing include to cctype 2016-05-25 10:39:19 +02:00
Jørgen Kvalsvik
8b12fda9c3 Remove unused FloatItem classes
ParserItemFloat and DeckItemFloat is never used within the project.
2016-02-03 12:22:41 +01:00
Jørgen Kvalsvik
4b98943665 Replaces unecessary header includes with fwd decls
Every header is self-contained and includes only what it must to
function, relying on users include what they need in source files,
adopting a pay-what-you-use model (in particular for internal
dependencies).
2016-01-26 13:23:22 +01:00
Jørgen Kvalsvik
f404828d63 Cleans up headers to improve build preformance
This is an effort to improve build performance.  Several includes
scattered across the project are either unused or partially used (i.e.
just used to import a type name, not depending on the actual contents of
the header file).

Replaces a lot of these includes with forward declarations.
2016-01-21 09:22:06 +01:00
Jørgen Kvalsvik
c2eb0ea934 ParserKeywords split into multiple files
In order to reduce parsing load on clients, the generated ParserKeywords
now come in their own sorted-by-first-letter files, so that inclusion of
the entire tree is unnecessary when only a handful of keywords will do.

This also applies to the generated source code (which is pretty heavy to
compile), which now is split into multiple files to enable parallel
builds.
2016-01-19 15:16:53 +01:00
Joakim Hove
51e3aa82cc Update include path 2015-10-06 11:30:43 +02:00
Joakim Hove
fb0daa39f4 Changed std::cout message for keywordloader. 2015-09-11 14:03:28 +02:00
Atgeirr Flø Rasmussen
3845e1c239 Suppress warnings from boost.
Done by using the disable_warnings.h and reenable_warnings.h headers.
In some cases also a little reordering of includes, to put all boost
includes in the warning-suppressed part.
2015-08-10 13:06:50 +02:00
Atgeirr Flø Rasmussen
6b59f78293 Improve updateFile and suppress warnings. 2015-06-22 10:17:19 +02:00
Joakim Hove
c0db611aa8 Added template method Parser::addKeyword<T>() 2015-06-08 11:29:20 +02:00
Joakim Hove
1161e1098c Rewritten code generation:
With this commit the generation of built in keywords is completely
changed. The most important changes include:

  1) We have autogenerated a class for each keyword in the new
     ParserKeywords { ... } namespace.

  2) The autogenerated classes derive from ParserKeyword, and the
     default constructor will build of a fully initialized
     ParserKeyword instance, i.e. the keyword used to parse the EQUIL
     keyword can be instantiated as simple as:

         ParserKeywords::EQUIL kw;

  3) The generated keywords have built in static constants for keyword
     and item names, and item default values. That way it should be
     possible for the compiler to catch trivial errors like trying to
     access the keyword "PoRO"; also the the access to default values
     means that properties can be initialized without actually
     insantiating a DeckKeyword.

  4) Two new classes Generator/KeywordLoader and
     Generator/KeywordGenerator have been created, with the help of
     these classes the keyword generation code is significantly
     simplified.
2015-06-08 11:29:18 +02:00