Commit Graph

140 Commits

Author SHA1 Message Date
Arne Morten Kvarving
9402db2421 fix building python bindings (with lto)
need to set the define for header only library with internal libfmt,
and whatever flags are required by external libfmt
2021-04-09 11:56:25 +02:00
Markus Blatt
62b202e85c Stop pretending that we support CMake 2.8
We actually already require at least CMake 2.8.12 due to the embedded
pybind11 (some tests of it are even at 3.0). Anyway as Ubuntu LTS has
3.10.2 I doubt that anything less is tested by us.
2021-04-07 13:56:03 +02:00
Markus Blatt
6895ee4959 Install CMake files below share/opm with USE_SOURCE_PERMISSIONS.
Otherwise the scripts will not be executable.
Fixes lintian warning
script-not-executable usr/share/opm/cmake/Scripts/cppcheck-test.sh

Gbp-Pq: Name 0007-Install-CMake-files-below-share-opm-with-USE_SOURCE_.patch
2021-04-06 22:56:59 +02:00
Markus Blatt
b24ca0519c Added manpages for all executables.
Debian policy says that each executable should have a man page.
This should remove the lintian warning about missing man pages.
Man pages have been created by the following command:

declare -A short_desc
short_desc['compareECL']='Comparator for Eclipse files'
short_desc['convertECL']='Converter for Eclipse files (binary <-> formatted format)'
short_desc['opmhash']='Hasher for summary keywords in Eclipse files'
short_desc['opmpack']='Validator and printer of deck in Eclipse files without comments'
short_desc['summary']='Printer for summary keys in Eclipse summary files'

for key in "${!short_desc[@]}"; do
       help2man -h "-h" --version-string="2020.04" --no-discard-stderr -n "${short_desc[$key]}" $key >\
       $key.1
done

Gbp-Pq: Name 0005-Added-manpages-for-all-executables.patch
2021-04-06 22:56:59 +02:00
Markus Blatt
1c311150a5 Prevent newline in PYTHON_INCLUDE_DIR.
It breaks the docker pypi build.
2021-03-19 20:18:58 +01:00
Markus Blatt
f8c6fabb2d Use system's pybind11 if available. 2021-03-19 20:18:58 +01:00
Markus Blatt
ee11a57b6c Honor PYTHON_EXECUTABLE even if we use Python3. 2021-03-16 20:32:50 +01:00
Markus Blatt
9bc0536d13 Do not use the imported Python3 library directly.
It just a hassle (need to search for Python3 downstream,
cannot be backwards compatible).
2021-03-16 20:32:50 +01:00
Markus Blatt
1ed6166f1f Determine Python include directory to fix docker pypi builds
Whenever OPM_ENABLE_PYTHON is on we need to set PYTHON_INCLUDE_DIRS
as it is needed to find Python.h (shouldn't we even need to link the
library?).

This could (in theory) be done by using by issuing
find_package(Python3 REQUIRED COMPONENTS Interpreter Development)
or
find_package(PythonLibs REQUIRED).

Unfortunately, both do not work (for yet unknown reasons) when we
build pypi packages in docker (even with setting the PYTHON_EXECUTABLE
or Python3_EXECUTABLE correctly).

Hence we now use python manually to determine these.
2021-03-16 20:32:36 +01:00
Joakim Hove
eb652ac232
Merge pull request #2353 from joakim-hove/remove-unneeded-cmake-include
Remove cmake include of pybind11 CMakeLists.txt
2021-03-15 16:41:24 +01:00
Markus Blatt
b7ce9c0fe2
Merge pull request #2348 from blattms/external-fmtlib-2
Enable usage of fmtlib on the system.
2021-03-15 13:26:23 +01:00
Joakim Hove
2a2ce8c826
Merge pull request #2354 from blattms/python-libs-only-for-embedded
Only search for Python libs if OPM_ENABLE_EMBEDDED_PYTHON is ON.
2021-03-15 12:28:04 +01:00
Markus Blatt
0455c48d2f Only search for Python libs if OPM_ENABLE_EMBEDDED_PYTHON is ON.
Apparently it is not needed in the other cases.
Fixes an issue that arose from #2344 and restores the old behaviour
concerning the libraries.
2021-03-15 10:19:10 +01:00
Joakim Hove
52caefae34 Remove cmake include of pybind11 CMakeLists.txt 2021-03-15 09:27:19 +01:00
Joakim Hove
8d11fc5458
Merge pull request #2344 from blattms/search-for-python3
Explictly search for python3 (CMake >= 3.12.0) and send error if only python2 is found
2021-03-13 16:20:04 +01:00
Markus Blatt
af3c825588 Make sure any python search finds Python3.
FindCWrap issues another find_package(PythonInterpret).
By setting the PYTHON_EXECUTABLE variable we make sure it
will find python3

This also fixes the CMake confusions about multiple linker paths

```
Make Warning at cmake/Modules/OpmSatellites.cmake:320 (add_executable):
  Cannot generate a safe linker search path for target test_ERft because
  files in some directories may conflict with libraries in implicit
  directories:

    link library [libpython3.7m.so] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /usr/lib/python3.7/config-3.7m-x86_64-linux-gnu

  Some of these libraries may not be found correctly.
```
2021-03-12 16:48:26 +01:00
Markus Blatt
9a25b78b98 Cater for missing FindPython3 in CMake version < 3.12.0
For these we need to use the old approach. At least we
now produce an error if only python2 is found.

Needed e.g. for Ubuntu LTS 18.04.
2021-03-12 16:47:27 +01:00
Markus Blatt
504aed72eb Enable usage of fmtlib on the system.
If fmtlib is present on the system we used that one
in the normal mode (not header only). Otherwise we
fallback to the embedded one header only.
2021-03-12 14:47:15 +01:00
Markus Blatt
164f451124 Explictly search for python3 and use that instead PythonInterpret et al.
Otherwise python2 might be found, but OPM needs python3.
2021-03-10 15:57:01 +01:00
Joakim Hove
122f15006c Check OPM_ENABLE_PYTHON and OPM_ENABLE_EMBEDDED_PYTHON 2021-03-10 15:44:45 +01:00
Joakim Hove
84d5dbde0e Make the Builtin class available from Python 2021-03-09 12:22:39 +01:00
Joakim Hove
7894de8030 Remove enforced inline schedule testing 2021-02-19 11:51:26 +01:00
Joakim Hove
c8ba2b30b3 Add runtime Schedule integration test - guarded by #ifdef 2021-01-11 09:56:47 +01:00
Torbjørn Skille
e1334adbf6 Adding new class EInit
- for parsing and loading data from INIT file
 - including functions to support parsing/logading LGR data
2020-12-01 20:14:37 +01:00
Torbjørn Skille
9fa90b2687 Update of EclIO classes.
- Enables reading of output files generated by simulator IX
 - Adding support for EclFile data type C0nn (string with length > 8 characters)
 - Update of program summary, now supporting well names with more that 8 characters
 - Updates of program convertECL, possible to write output files with IX "format"
 - updates of python bindings (EclOutput and EclFile)
2020-11-10 22:02:38 +01:00
Arne Morten Kvarving
fac6695d15 workaround cmake issue
cmake does not properly interpret the SYSTEM marker in lists of
include directories. this causes issues downstream when using
dunecontrol / the in-tree cmake config files.
2020-11-06 10:16:02 +01:00
Arne Morten Kvarving
70d13b7427 changed: mark libfmt headers as system to avoid warnings 2020-09-23 14:05:50 +02:00
Joakim Hove
4e5aed45d7 Embed fmtlib source code 2020-09-18 11:23:30 +02:00
Joakim Hove
3004e14e9a Remove use fmtlib package from build system 2020-09-18 11:19:41 +02:00
Joakim Hove
bafdbc35cc Add dependency to header only fmtlib 2020-09-17 14:57:40 +02:00
Gaute Lindkvist
f7b080b7b6 Fix remaining double use of python/python and opm/opm folders in Python package generation 2020-07-01 03:25:11 -04:00
Gaute Lindkvist
3acc26558b Use file COPY instead of configure for straight copy in CMakeLists.txt 2020-06-25 09:52:43 -04:00
Gaute Lindkvist
27fdb0654d Revert "Support building Python module statically"
This reverts commit d3b4f41acf.
2020-06-25 09:26:12 -04:00
Gaute Lindkvist
5515422d02 Add docker files and scripts for creating cross-distro PyPI packages 2020-06-18 10:32:05 -04:00
Gaute Lindkvist
cbd23e71ef Add generation of a setup-package.sh script for creating PyPI-packages 2020-06-16 13:08:33 +02:00
Gaute Lindkvist
e3bb9a3151 README.md file skeleton for Python package 2020-06-16 13:08:33 +02:00
Gaute Lindkvist
6db3ccf36f Add link flags to Python setup.py 2020-06-16 13:08:33 +02:00
Gaute Lindkvist
f67bce1dd8 Add link directories to Python setup.py 2020-06-16 12:52:34 +02:00
Gaute Lindkvist
d3b4f41acf Support building Python module statically 2020-06-10 14:30:38 +02:00
Joakim Hove
512c2e4c1e Python files should go in $PREFIX/dist-packages on debian 2020-04-29 10:03:08 +02:00
Torbjørn Skille
43f1739dfa improved efficiency when opening summary files.
> loading only arrays that is used (DIMENS, RESTART, KEYWORDS, NUMS and UNITS)
 > smspec file now only loading arrays once (twice before)
2020-04-26 18:24:01 +02:00
Arne Morten Kvarving
c22a4ff980 changed: mark pybind11 headers as system headers
to quell some (shadowing) warnings
2020-04-21 09:00:30 +02:00
Torbjørn Skille
54087e3bd8 Effective LOD for ESmry 2020-04-19 20:59:38 +02:00
Joakim Hove
92e923b567
Merge pull request #1706 from joakim-hove/test-clean-srcdir
Rework testing of Schedule exit status
2020-04-15 21:56:55 +02:00
Joakim Hove
43e2fced7d Simplified testing of exit status 2020-04-15 21:04:26 +02:00
Markus Blatt
8e3ba156a6
Merge pull request #1675 from blattms/refactor-policy-settings
Fix policy warnings
2020-04-15 21:01:35 +02:00
Markus Blatt
742d8943ca Move policy settings to OpmInit and into a macro OpmSetPolicies().
OpmInit.cmake is one of the first includes and most importantly before
the opm-*-prereqs.cmake files are include. The macro is needed to make
the policies set in all CMakefiles. OpmSetPolicies should be called in
the toplevel CMakeLists.txt file.

This fixes a lot of warnings experienced in downstream modules that
got triggered by the opm-*-prereqs.cmake files. At some calls the
policies were at other not.

On the other hand new warnings about soon to be deprecated policies
CMP0026 and CMP0048 appear at least for cmake version 3.13.4.
But that should be fixed in another PR.
2020-04-15 14:17:53 +02:00
Joakim Hove
1c84c4c3f3 Add new keyword EXIT
The keyword EXIT is a opm only keyword which can be used to terminate the whole
simulation as part of the ACTIONX keyword.
2020-04-14 16:32:52 +02:00
Joakim Hove
4b687e3368 Fix bug in CMakeLists.txt - mock simulator tests were not built 2020-03-24 07:23:31 +01:00
Arne Morten Kvarving
8233ae200c
Merge pull request #1515 from akva2/python_debian_packaging
Add debian packaging of python bindings
2020-02-26 12:22:01 +01:00