Commit Graph

193 Commits

Author SHA1 Message Date
Arne Morten Kvarving
cc4cc85361 fixed: support cmake 3.13
the Python3 find module only sets Python3_VERSION_XXX,
not PYTHON_VERSION_XXX
2021-09-23 08:43:30 +02:00
Torbjørn Skille
c6ff9bba00 cleanup after renaming from LODSMRY -> ESMRY 2021-08-16 09:10:00 +02:00
Markus Blatt
13bf65a73b Install build system documentation to doc and not next to CMake files. 2021-06-15 21:06:55 +02:00
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
Arne Morten Kvarving
6e0a581764 remove unused cmake option 2020-02-26 11:57:37 +01:00
Arne Morten Kvarving
c765b769fa fixed: set LD_LIBRARY_PATH so python tests can find the library
necessary when building shared lib
2020-02-26 11:56:02 +01:00
Bård Skaflestad
df21acfc49
Merge pull request #1492 from akva2/conditional_test_suite
changed: disable building of test suite if Boost::test is not found
2020-02-24 20:30:53 -06:00
Joakim Hove
269802ae48 Add comment about locating shared library while testing Python 2020-02-19 12:33:50 +01:00
Arne Morten Kvarving
f76daabbb4 changed: disable building of test suite if Boost::test is not found 2020-02-19 12:25:32 +01:00
Joakim Hove
6b0073455b Pass RPATH to the python setup.py based build system 2020-02-06 10:15:40 +01:00
Arne Morten Kvarving
8cf1497ccb fixed: use PROJECT_XXX instead of CMAKE_XXX
make it work fine with the 'super-build' CMakeLists.txt
2020-01-13 13:38:47 +01:00
Joakim Hove
3c6a60c4a9 Code genereator will create many source files 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
885093d472 Use DEST_PREFIX when installing python code 2019-11-27 23:46:32 +01:00
Torbjørn Skille
59e0c39558 New program summary based on OPM I/O classes 2019-11-12 13:27:26 +01:00
Joakim Hove
d66852d8de Rewrite EclFile wrapping
- Include the eclipse_io.cpp file in existing extension library - do not create
   a new library.

 - Remove Python class EclFile - just expose the C++ through Pybind1, include
   some monkey-patching of the class to ensure proper Python strings for CHAR
   keywords.

 - Remove string based keyword lookup.

 - Use standard Python methods __len__, __getitem__ and __contains__; get() is
   an equivalent alternative to __getitem__().

 - Add property arrays in addition to getListOfArrays()
2019-11-06 09:59:07 +01:00
Torbjørn Skille
7cacc734e8 python binding for EclFile 2019-11-06 09:59:07 +01:00
Joakim Hove
0b8a42fd1f Fix cmake find pythonlibs 2019-11-06 09:59:07 +01:00
Joakim Hove
0d2f57354a
Merge pull request #1184 from joakim-hove/python-dep
Add Python library to opm-common_LIBRARIES cmake variable
2019-11-04 13:16:32 +01:00
Joakim Hove
a7187abc17 Initial implementation of 3D properties 2019-10-31 11:18:55 +01:00
Joakim Hove
176e7f75ed Add Python library to opm-common_LIBRARIES cmake variable 2019-10-31 07:07:07 +01:00
Arne Morten Kvarving
95a129cbed fixed: let's not copy the files twice 2019-10-29 14:59:08 +01:00
Joakim Hove
9d1b7a83d9 Changes in Python build:
- Use python/install.py to copy from source tree to build tree
- List Cxx source files in CMakeLists_files.cmake
2019-10-28 21:42:57 +01:00
Joakim Hove
d382c57145 Add small python script to determine extension suffix 2019-10-28 20:30:39 +01:00
Joakim Hove
162d0e0902 Minor change to python enable script 2019-10-25 08:54:40 +02:00
Arne Morten Kvarving
93ac533373 changed: put the generated ParserKeywords.cpp first in list
this improves build throughput on jenkins since building this
large file will overlap more with other build tasks.
2019-10-17 11:40:48 +02:00
Joakim Hove
e815194e21
Merge pull request #1112 from stefoss23/remove_common_state
Remove common state
2019-10-17 06:58:25 +02:00
Arne Morten Kvarving
247b5685cc remove libecl from buildsystem, jenkins and packaging 2019-10-16 20:03:08 -05:00
Steinar Foss
0e5c14568e removed common_state. 2019-10-16 13:59:00 +02:00
Joakim Hove
5269f52291
Merge pull request #1075 from joakim-hove/python-install
Add Python copy/install hack
2019-10-14 18:46:48 +02:00
Joakim Hove
7dc77d1ca3 Install PYTHON Modules when running jenkins 2019-10-14 15:53:31 +02:00
Joakim Hove
59b73a0667 Change the python installation code
- Main cmake based python installation is based on small script install.py and
  not setup.py
- Python installation is guarded by cmake switch OPM_INSTALL_PYTHON
- Configure convenience shell script setup-install.sh for setup.py based
  installation.
- Remove PYTHONPATH hacks from setup.py
2019-10-14 13:13:09 +02:00
Steinar Foss
c0bd19c59e python: added class UnitSystem. 2019-10-11 22:02:54 +02:00
Joakim Hove
204ea1a1a2 Use ${PYTHON_EXECUTABLE} instead of 'python' in CMakeLists.txt 2019-10-04 20:14:27 +02:00
Joakim Hove
69ddffc966 Expose C++ objects to Python runtime 2019-09-23 21:31:45 +02:00
Joakim Hove
230c4494ed Add Python wrapping for OpmLog 2019-09-23 14:35:25 +02:00
Steinar Foss
dd4cce4e9a python: removed group_tree. 2019-09-21 11:52:44 +02:00
Joakim Hove
d2ff536cf3 Renamed python/cxx/common -> python/cxx/export 2019-09-13 09:40:13 +02:00
Arne Morten Kvarving
16d38c3245 fix python link for dependents 2019-09-09 11:16:58 +02:00
Arne Morten Kvarving
97ad4baa99 quell warnings 2019-09-09 11:16:58 +02:00
Joakim Hove
ab2ea1acf3 Add basic manager class fro Python interpreter 2019-09-09 10:58:26 +02:00
Joakim Hove
7984d2a0f4 Expose the Parser class properly to Python 2019-09-05 08:44:47 +02:00
Joakim Hove
723113b3b9 Add small shell script templates to simplify Python development 2019-09-05 08:44:47 +02:00
Steinar Foss
554ceb87dd setup.py will install python packages.
setup.py install to CMAKE_INSTALL_PREFIX.

cmake will create python install dir.
2019-08-15 17:00:43 +02:00
Steinar Foss
c94ed2f643 renaming python/cxx/sunbeam*.* -> common *.* 2019-08-15 11:19:18 +02:00
Steinar Foss
e25416c236 renamed python pkg sunbeam -> opm.
setup.py: test_suite -> tests_suite .

libsunbeam -> libopmcommon_python.

sunbeam -> opm: test_connection ok.

test_deck ok.

test_group_tree ok.

test_grupnet ok.

test_parse_deck.py ok.

test_parse.py ok.

python all tests ok.
2019-08-15 11:02:09 +02:00
Arne Morten Kvarving
ca42ca5968 changed: use a custom output to avoid rebuilds
currently, the python bindings are built on every make invocation,
including the 'make install' command.

this improves on this situation by tracking whether or not the target
needs to be rebuilt through a custom output and dependencies.

the list of dependencies is not very pretty, but necessary when
linking two build systems like this.
2019-08-13 15:56:45 +02:00
Arne Morten Kvarving
86b1a93b0e fixed: clean python bindings with 'make clean' 2019-08-13 15:56:45 +02:00
Steinar Foss
c208a59597 Sunbeam will be compiled with setuptools.
setup.py moved to python/python.

moved python tests to python/python.

added __init__.py under python/tests.

added 'test_' before all python test names.

test_ prefix added to tests.

setup.py and python tests moved back to python base.

setuptools executes from root python.

python: tests run from root python w/ setup.py.

python tests: temp reduced to test_deck only.

python setup.py: manually linked opmcommon.

setup.py: linked ecl.

setup.py linked boost_filesystem.

setup.py: linked boost_regex.

python all tests run.

removec usr/local from setup.py ext_module.

cmake make copies entire python dir to build.

setup.py can execute from build.

setup.py executes from build/python.

python tests run under setup.py.

setup.py library_dirs and include-dirs set by cmake command.

removed cmake files from sunbeam.

sunbeam: added code for install.

setup.py: removed 'import ecl'.

python/src -> python->src_sunbeam.

setup.py: discontinued use of glob, all files listed instead.

build-opm_module.sh: added prefix_path to opm.

build-opm-module.sh: changed spell error for EXTRA_MODULE_FLAGS[opm-common].

setup.py: infer include directories from cmake target

CMakeLists.txt: under python: align install statement.

CMakeLists build python: removed find_package.

src_sunbeam -> cxx.

setup.py: test_suite as string.

setup.py: tests_suite -> test_suite.

setup.py: added exception if 'build_ext' not used.

temporarily moved files to python/sunbeam.
2019-08-09 10:40:33 +02:00
Joakim Hove
7c856f681d Use new classes Group2 and GTNode 2019-08-06 22:59:16 +02:00
Joakim Hove
dc4aa882be Integration testing of Group2 in Schedule constructor 2019-07-30 09:36:57 +02:00