Commit Graph

194 Commits

Author SHA1 Message Date
Arne Morten Kvarving
d9ca8694ae changed: vendor cjson using FetchContent 2023-11-22 10:46:13 +01:00
Arne Morten Kvarving
76d769960e changed: vendor libfmt using FetchContent 2023-11-22 08:21:05 +01:00
Arne Morten Kvarving
e2566b1487 changed: vendor pybind11 using FetchContent 2023-11-16 09:49:34 +01:00
Markus Blatt
cd1831be94
Merge pull request #3509 from blattms/install-co2brinepvt
Also install co2brinepvt as we install the manpage.
2023-06-07 10:29:03 +02:00
Markus Blatt
083451817d [cmake] Make sure that string(REPACE always has 4 arguments.
This was missing proper quoting for the case that dune-common_CXX_FLAGS
is empty.

Error I got was:
```
-- Version 2.10.0 of dune-common from /home/mblatt/src/dune/opm-master/dune-common/opm-parallel
CMake Error at CMakeLists.txt:369 (string):
  string sub-command REPLACE requires at least four arguments.

-- Configuring incomplete, errors occurred!
```
2023-05-30 10:40:55 +02:00
Markus Blatt
dc9b9b719f Also install co2brinepvt as we install the manpage.
This must have been missed when merging opm-material with this module.
2023-05-05 17:27:53 +02:00
Arne Morten Kvarving
adb0701a57 fixed: conditionally use Development.XXX in python find module
the split into Development.Module and Development.Embed was is introduced in cmake 3.18
2023-05-02 08:57:39 +02:00
Arne Morten Kvarving
ba14a9e126 fixed: setuptools are no longer required to build the python bindings
only required if building packages for pypi, which is done separately
from the main buildsystem.
2023-04-27 13:03:08 +02:00
Arne Morten Kvarving
33c416b3e8 changed: only search for Development.Module if not building embedded python
the embedding headers are not available on the manylinux2014 containers
used to build the pypi packages. since this is anyways more correct
fix it this way
2023-04-27 13:03:08 +02:00
Markus Blatt
59ca5b1ba8 Always search for Development component of Python.
It is needed as we will call pybind11_add_module which calls
python3_add_library (in recent pybind11 versions). That
function is only there if the development component is searched for
and found.
2023-04-19 15:26:23 +02:00
Arne Morten Kvarving
509a018ae7 fixed: fix debug printing with quad
std::to_string(__float128) is not defined
we need to instance the evaluation formatter for __float128
2023-03-16 09:07:13 +01:00
Arne Morten Kvarving
27ecbe5c98 fixed: instance CO2Tables for quad if QuadMath was found 2023-03-16 09:07:13 +01:00
Arne Morten Kvarving
a6b2d2438b fixed: building without examples 2023-03-14 15:01:18 +01:00
Markus Blatt
380fd4963e Split Builtin.hpp into multiple compile units for g++-12.
g++-12 needs quite some memory and time to compile it.
We now use several Builtin*.cpp for the imlementations for different
starting letters of eclipse keywords to use less resources for
compiling.
2023-03-08 22:26:34 +01:00
Markus Blatt
b52dc598d3 Refactored ParserInit.cpp to reduce ram needed for compilation 2023-03-08 17:25:35 +01:00
Markus Blatt
ff08945b4f [bugfix] Make sure to use CONFIG mode for subsequent boost searches.
Otherwise boost components found by previous search will be marked as
not found if a new component is not found in the new search.

This happend for #3381 if regex was not found and made cmake believe
that unit_test_framework was not found either. Even though it was in a
previous search.

Now we make sure to CONFIG mode if boost was found before, which fixes
this problem. Also we only link dunecommon to test if they are
actually built (read unit_test_framework was marked as found).

Closes #3881
2023-02-09 22:18:16 +01:00
Markus Blatt
edcd66987a [python] Run unit tests directly and not via setup.py (deprecated).
Thus we get rid of the warning:

WARNING: Testing via this command is deprecated and will be removed in
a future version. Users looking for a generic test entry point
independent of test runner are encouraged to use tox.
2023-01-13 18:15:09 +01:00
Arne Morten Kvarving
5d854d1d6d changed: build opm-common python extension using cmake
only use setup.py to generate wheels. adjust pypi packaging
accordingly
2023-01-12 10:14:38 +01:00
Arne Morten Kvarving
081715d229 changed: put dune-enabled tests in separate list
more explicit, neater code
2022-12-21 09:54:36 +01:00
Bård Skaflestad
fb8cd6f284 Link New Test to Dune Common
Otherwise, we get build failures if the Dune libraries and headers
are outside of the system directories.
2022-12-20 13:14:28 +01:00
Bård Skaflestad
3baeba93c8 Link Additional Targets to Dune Common
While here, also remove a duplicate entry for

    examples/co2brinepvt.cpp
2022-12-09 15:03:21 +01:00
Arne Morten Kvarving
5ed8a439e7 add imported files to build system
and adjust jenkins scripts
2022-12-08 14:03:15 +01:00
Arne Morten Kvarving
4978329b02 disable mocksim tests without HAVE_ECL_INPUT 2022-11-30 12:44:52 +01:00
Arne Morten Kvarving
11fb11d089 fixed: we need fmt even without ENABLE_ECL_INPUT
used in test_OpmInputError_format
2022-11-30 12:44:17 +01:00
Arne Morten Kvarving
8601805d62
Merge pull request #3165 from akva2/add_headers
added: add headers to library definition
2022-10-05 09:52:24 +02:00
Arne Morten Kvarving
57bc9a8f02 added: add headers to library definition
for better IDE integration
2022-10-05 09:18:31 +02:00
Arne Morten Kvarving
ca0246c548 fixed: properly export opm-common_PYTHON_COMMON_DIR
this needs to be different for the in-tree and installed
config files
2022-10-05 08:49:22 +02:00
Arne Morten Kvarving
8e2445b4cc fixed: build python bindings on systems without openmp 2022-09-09 07:39:11 +02:00
Arne Morten Kvarving
0b0f9cab33 remove faulty brace 2022-07-27 18:08:52 +02:00
Håkon Hægland
046736e45d Make Python opm package a namespace package
Convert the Python opm package from a regular package to a namespace
package such that opm-simulators can contribute to the package from a
different filesystem path. In this way, the two packages opm.simulators
and opm.io (for example) can have a different parent filesystem path.
2022-06-10 09:02:19 +02:00
Håkon Hægland
32c3d9bcb0 Add the python script directory to opm-project-config
Uses GNUInstallDIrs' CMAKE_INSTALL_DATAROOTDIR as top directory for
common python scripts. Also adds that location to
opm-project-config.cmake.in such that other opm modules can
easily lookup the common scripts
2022-06-03 09:03:34 +02:00
Håkon Hægland
89b790d72f Install install.py
Install the install.py python script such that it can be used by
opm-simulators when building against an installed opm-common
2022-05-31 12:19:50 +02:00
Håkon Hægland
fa740678e0 Adds a method get_injection_properties()
Adds a method get_injection_properties() to the Python interface to
Opm::Schedule. This method can be used to get information about
Well::WellInjectionProperties for a given report step.

In order to avoid code duplication between opm-simulators and opm-common,
logic in CMakeLists.txt was refactored out into
cmake/Modules/PyInstallPrefix.cmake
2022-05-20 06:27:29 +02:00
Markus Blatt
51b73c1997 Install python bindings as default.
This is for consistency with opm-simulators, which (always)
installs them if they are built.

Closes #2976
2022-04-29 12:13:17 +02:00
Markus Blatt
cd3a6b2ddf Make determining whether to use site-packages more bullet-proof
Seems like sometimes getsitepackages might not even be implemented.
2022-03-22 12:00:55 +01:00
Markus Blatt
bcf1ba0ba9 [python] Use dist-packages if is used for Python's sitepackages
Instead of checking whether this is Debian system we query the
sitepackages path from Python. If it matches dist-packages then
we use dist-packages if we install below /usr, otherwise site-packages
is used.
2022-03-22 11:45:02 +01:00
Markus Blatt
af052ef3ba [cmake] Send error for OPM_ENABLE_PYTHON=ON without setuptools
Compiling will fail at a very late stage and might cause surprises
for novice users. It seems much better to issue an error in CMake with
a meaningful error message. Might prevent some support issues in the
future.
2022-03-15 13:00:24 +01:00
Markus Blatt
c5691477e5
Merge pull request #2948 from blattms/fix-setup.py-mult-lib
[bugfix] Make opm-common_PYTHON_LINKAGE a comma separated list.
2022-02-02 09:44:34 +01:00
Markus Blatt
325e559229 [cmake][bugfix] Test python/embedded python flags before source_hook.
If cmake is run with `-DOPM_ENABLE_EMBEDDED_PYTHON=ON -DOPM_ENABLE_PYTHON=OFF`
a cmake error was produced because the library would depend on
python/cxx/builtin_pybind11.cpp which would not be generated.

We fix this by doing the Python sanity check (deactivate embedded
python if python is disabled) before running source_hook that adds the
dependency.

Closes #2940
2022-01-27 15:21:33 +01:00
Markus Blatt
1daa7d1df4 [bugfix] Make library list used for setup.py a comma separated list.
It is used verbatim in setup.py in the list that specifies the linker
flage. Hence it needs to comma separted instead of using a semicolon
as separator.

We also rename it to SETUP_PY_LINKAGE to indicate where it is used.

Closes #2947
2022-01-27 11:26:56 +01:00
Joakim Hove
aede532b9a Filesystem rename parser/eclipse/ input/eclipse 2022-01-02 14:32:14 +01:00
Torbjørn Skille
ed6bb4161d add program arraylist 2021-12-04 08:41:16 +01:00
Joakim Hove
b6ec75eeb6
Merge pull request #2841 from joakim-hove/register-tests-in-files
Register ecl io tests using the file list in CMakeLists_files.cmake
2021-11-16 13:47:15 +01:00
Håkon Hægland
a4d703b433 Add rpath to libopmcommon.so in the build directory.
Currently, an rpath to the install directory of libopmcommon.so is
generated for libopmcommon_python.so, but a similar rpath is not added to
the libopmcommon.so in the build directory. It is useful to be able to
use the build directory libraries when not compiling with
-DOPM_INSTALL_PYTHON or when developing.

This PR fixes issue #2843.
2021-11-15 13:50:06 +01:00
Markus Blatt
7554a16b4c
Merge pull request #2839 from joakim-hove/rm-sched-debug
Remove stale compile definition SCHEDULE_DEBUG
2021-11-15 12:16:55 +01:00
Joakim Hove
a8d3997c72 Register ecl io tests using the file list in CMakeLists_files.cmake 2021-11-15 10:20:36 +01:00
Joakim Hove
efc2b7c834 Only include builtin_pybind11 when building with embedded python 2021-11-15 09:58:00 +01:00
Joakim Hove
1f8b79105a Remove stale build symbol SCHEDULE_DEBUG 2021-11-15 08:29:03 +01:00
Arne Morten Kvarving
21cdcecb81 fixed: append cjson libraries to python module build when using system cjson 2021-10-29 13:15:47 +02:00
Feda Curic
c2e8eabc2f Use built in FindBoost 2021-10-07 12:11:54 +02:00