Skip to main content

Package for reading and writing the result files from the ECLIPSE reservoir simulator

Project description

libecl Build Status

libecl is a package for reading and writing the result files from the Eclipse reservoir simulator. The file types covered are the restart, init, rft, summary and grid files. Both unified and non-unified and formatted and unformatted files are supported.

libecl is mainly developed on Linux and macOS, in addition there is a portability layer which ensures that most of the functionality is available on Windows. The main functionality is written in C/C++, and should typically be linked in in other compiled programs. libecl was initially developed as part of the Ensemble Reservoir Tool, other applications using libecl are the reservoir simulator flow and Resinsight from the OPM project.

Alternative 1: Python only

For small interactive scripts, such as forward models, the recommended way to use libecl is by installing it from PyPI. This method doesn't require setting PYTHONPATH or LD_LIBRARY_PATH environment variables:

$ pip install libecl

Alternative 2: C library only

This is for when you need to link directly with the libecl C library, but don't need the Python bindings. libecl requires a conforming C++11 or later compiler such as GNU GCC, the CMake build system and, optionally, zlib.

$ git clone https://github.com/Equinor/libecl
$ cmake libecl
$ cmake --build libecl --target install

To install libecl in a non-standard location, add -DCMAKE_INSTALL_PATH=/path/to/install to the first cmake command. If you intend to develop and change libecl you should build the tests by passing -DBUILD_TESTS=ON and run the tests with ctest.

Alternative 3: C library with Python bindings

It is also possible to install both the C library and Python bindings using CMake. Note that this alternative is incompatible with libecl installed from PyPI (Alternative 1). As before, we require a conforming C++11 or later compiler, CMake and, optionally, zlib.

$ git clone https://github.com/Equinor/libecl
$ pip install -r libecl/requirements.txt
$ cmake libecl -DENABLE_PYTHON=ON
$ cmake --build libecl --target install

Then, you must tell Python where to find the package[1]:

$ export PYTHONPATH=/path/to/install/lib/python2.7/site-packages:$PYTHONPATH
$ export LD_LIBRARY_PATH=/path/to/install/lib64:$LD_LIBRARY_PATH

Then you can fire up your Python interpreter and try it out:

>>> from ecl.summary import EclSum
>>> import sys

>>> summary = EclSum(sys.argv[1])
>>> fopt = summary.numpy_vector("FOPT")

The installation with Python enabled is described in a YouTube video by Carl Fredrik Berg.

[1]: The exact paths here will depend on your system and Python version. The example given is for a RedHat system with Python version 2.7.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

libecl-2.8.0a2-cp38-cp38-manylinux2010_x86_64.whl (1.8 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.12+ x86-64

libecl-2.8.0a2-cp38-cp38-macosx_10_9_x86_64.whl (1.5 MB view hashes)

Uploaded CPython 3.8 macOS 10.9+ x86-64

libecl-2.8.0a2-cp37-cp37m-manylinux2010_x86_64.whl (1.8 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.12+ x86-64

libecl-2.8.0a2-cp37-cp37m-macosx_10_9_x86_64.whl (1.5 MB view hashes)

Uploaded CPython 3.7m macOS 10.9+ x86-64

libecl-2.8.0a2-cp36-cp36m-manylinux2010_x86_64.whl (1.8 MB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.12+ x86-64

libecl-2.8.0a2-cp36-cp36m-macosx_10_9_x86_64.whl (1.5 MB view hashes)

Uploaded CPython 3.6m macOS 10.9+ x86-64

libecl-2.8.0a2-cp27-cp27mu-manylinux2010_x86_64.whl (1.8 MB view hashes)

Uploaded CPython 2.7mu manylinux: glibc 2.12+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page