Skip to content

Commit 79ec5bc

Browse files
authored
Merge pull request #80 from daavid00/dev
Updating docs to install OPM Flow in macOS
2 parents 30648dc + 582696e commit 79ec5bc

9 files changed

Lines changed: 21 additions & 144 deletions

File tree

.github/workflows/ci_pycopm_ubuntu.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ jobs:
1616
with:
1717
fetch-depth: 0
1818

19-
- name: Set up Python 3.11
19+
- name: Set up Python 3.12
2020
uses: actions/setup-python@v2
2121
with:
22-
python-version: 3.11
22+
python-version: 3.12
2323

2424
- name: Install Flow Simulator
2525
run: |
@@ -45,7 +45,7 @@ jobs:
4545
4646
- name: Check code style and linting
4747
run: |
48-
black --check src/ tests/
48+
black --target-version py312 --check src/ tests/
4949
pylint src/ tests/
5050
mypy --ignore-missing-imports src/ tests/
5151

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ Contributions are more than welcome using the fork and pull request approach
1313
1. Work on your own fork of the main repo
1414
1. In the main repo execute:
1515
1. **pip install -r dev-requirements.txt** (this installs the [_dev-requirements.txt_](https://github.com/cssr-tools/pycopm/blob/main/dev-requirements.txt))
16-
1. **black src/ tests/** (this formats the code)
16+
1. **black --target-version py312 src/ tests/** (this formats the code)
1717
1. **pylint src/ tests/** (this analyses the code, and might rise issues that need to be fixed before the pull request)
1818
1. **mypy --ignore-missing-imports src/ tests/** (this is a static checker, and might rise issues that need to be fixed before the pull request)
1919
1. **pytest --cov=pycopm --cov-report term-missing tests/** (this runs locally the tests, and might rise issues that need to be fixed before the pull request)
2020
1. **pycopm -i examples/decks/HELLO_WORLD.DATA -c 5,5,1 -m all -o output** (this runs the hello world example, which succeeds if the file output/HELLO_WORLD_PYCOPM.EGRID is created)
2121
1. **pushd docs & make html** (this generates the documentation, and might rise issues that need to be fixed before the pull request; if the build succeeds and if the contribution changes the documentation, then copy all content from the docs/_build/html/ folder and replace the files in the [_docs_](https://github.com/cssr-tools/pycopm/tree/main/docs) folder)
22-
* Tip for Linux users: See the [_ci_pycopm_ubuntu.yml_](https://github.com/cssr-tools/pycopm/blob/main/.github/workflows/ci_pycopm_ubuntu.yml) script and the [_Actions_](https://github.com/cssr-tools/pycopm/actions) for installation of pycopm, OPM Flow (binary packages), and dependencies, as well as the execution of the seven previous steps in Ubuntu 24.04 using Python 3.11.
22+
* Tip for Linux users: See the [_ci_pycopm_ubuntu.yml_](https://github.com/cssr-tools/pycopm/blob/main/.github/workflows/ci_pycopm_ubuntu.yml) script and the [_Actions_](https://github.com/cssr-tools/pycopm/actions) for installation of pycopm, OPM Flow (binary packages), and dependencies, as well as the execution of the seven previous steps in Ubuntu 24.04 using Python 3.12.
2323
* Tip for macOS users: See the [_ci_pycopm_macos_.yml_](https://github.com/daavid00/OPM-Flow_macOS/blob/main/.github/workflows/ci_pycopm_macos.yml) script and the [_OPM-Flow_macOS Actions_](https://github.com/cssr-tools/pycopm/actions) for installation of pycopm, OPM Flow (source build), and dependencies, as well as running the tests and the hello world example in macOS 26 using Python3.13. Note that if you do not add the directory containing the OPM Flow executable to your system's PATH environment variable (e.g., export PATH=$PATH:/Users/yourname/pycopm/build/opm-simulators/bin), then you can pass this in the execution of the tests and pycopm using the flags **-f/--flow** (see [_ci_pycopm_macos.yml_](https://github.com/daavid00/OPM-Flow_macOS/blob/main/.github/workflows/ci_pycopm_macos.yml#L76)).
2424
1. Squash your commits into a single commit (see this [_nice tutorial_](https://gist.github.com/lpranam/4ae996b0a4bc37448dc80356efbca7fa) if you are not familiar with this)
2525
1. Push your commit and make a pull request

docs/_sources/contributing.rst.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ Contribute to the software
2222
#. In the main repo execute:
2323

2424
#. **pip install -r dev-requirements.txt** (this installs the `dev-requirements.txt <https://github.com/cssr-tools/pycopm/blob/main/dev-requirements.txt>`_)
25-
#. **black src/ tests/** (this formats the code)
25+
#. **black --target-version py312 src/ tests/** (this formats the code)
2626
#. **pylint src/ tests/** (this analyses the code, and might rise issues that need to be fixed before the pull request)
2727
#. **mypy --ignore-missing-imports src/ tests/** (this is a static checker, and might rise issues that need to be fixed before the pull request)
2828
#. **pytest --cov=pycopm --cov-report term-missing tests/** (this runs locally the tests, and might rise issues that need to be fixed before the pull request)
2929
#. **pycopm -i examples/decks/HELLO_WORLD.DATA -c 5,5,1 -m all -o output** (this runs the hello world example, which succeeds if the file output/HELLO_WORLD_PYCOPM.EGRID is created)
3030
#. **pushd docs & make html** (this generates the documentation, and might rise issues that need to be fixed before the pull request; if the build succeeds and if the contribution changes the documentation, then copy all content from the docs/_build/html/ folder and replace the files in the `docs <https://github.com/cssr-tools/pycopm/tree/main/docs>`_ folder)
3131

3232
.. tip::
33-
See the `ci_pycopm_ubuntu.yml <https://github.com/cssr-tools/pycopm/blob/main/.github/workflows/ci_pycopm_ubuntu.yml>`_ script and the `Actions <https://github.com/cssr-tools/pycopm/actions>`_ for installation of pycopm, OPM Flow (binary packages), and dependencies, as well as the execution of the seven previous steps in Ubuntu 24.04 using Python 3.11.
33+
See the `ci_pycopm_ubuntu.yml <https://github.com/cssr-tools/pycopm/blob/main/.github/workflows/ci_pycopm_ubuntu.yml>`_ script and the `Actions <https://github.com/cssr-tools/pycopm/actions>`_ for installation of pycopm, OPM Flow (binary packages), and dependencies, as well as the execution of the seven previous steps in Ubuntu 24.04 using Python 3.12.
3434
For macOS users, see the `ci_pycopm_macos.yml <https://github.com/daavid00/OPM-Flow_macOS/blob/main/.github/workflows/ci_pycopm_macos.yml>`_ script and the `OPM-Flow_macOS Actions <https://github.com/cssr-tools/pycopm/actions>`_ for installation of pycopm, OPM Flow (source build), and dependencies, as well as running the tests and the hello world example in macOS 26 using Python3.13.
3535
Note that if you do not add the directory containing the OPM Flow executable to your system's PATH environment variable (e.g., export PATH=$PATH:/Users/yourname/pycopm/build/opm-simulators/bin), then you can pass this in the execution of the tests and pycopm using the flags **-f/--flow** (see `this script <https://github.com/daavid00/OPM-Flow_macOS/blob/main/.github/workflows/ci_pycopm_macos.yml#L72>`_).
3636

docs/_sources/installation.rst.txt

Lines changed: 3 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ in the terminal the following lines (which in turn should build flow in the fold
8888
do git clone https://github.com/OPM/opm-$repo.git
8989
mkdir build/opm-$repo
9090
cd build/opm-$repo
91-
cmake -DUSE_MPI=1 -DWITH_NDEBUG=1 -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$CURRENT_DIRECTORY/build/opm-common;$CURRENT_DIRECTORY/build/opm-grid" $CURRENT_DIRECTORY/opm-$repo
91+
cmake -DUSE_MPI=1 -DWITH_NDEBUG=1 -DCMAKE_BUILD_TYPE=Release $CURRENT_DIRECTORY/opm-$repo
9292
if [[ $repo == simulators ]]; then
9393
make -j5 flow
9494
else
@@ -108,7 +108,7 @@ Brew formula for macOS
108108
++++++++++++++++++++++
109109
For macOS, there are no available binary packages, so OPM Flow needs to be built from source. Recently, a formula to build flow using brew has
110110
been added in `https://github.com/cssr-tools/homebrew-opm <https://github.com/cssr-tools/homebrew-opm>`_.
111-
Then, you can try to install flow (v2025.10) by simply typing:
111+
Then, you can try to install flow (v2026.02) by simply typing:
112112

113113
.. code-block:: console
114114
@@ -121,46 +121,4 @@ You can check if the installation of OPM Flow succeded by typing in the terminal
121121

122122
Source build in macOS
123123
+++++++++++++++++++++
124-
If you would like to build the latest OPM Flow from the master branch, then you can first install the prerequisites using brew:
125-
126-
.. code-block:: console
127-
128-
brew install cjson boost openblas suite-sparse python@3.13 cmake
129-
130-
In addition, it is recommended to uprade and update your macOS to the latest available versions (the following steps have
131-
worked for macOS Tahoe 26.2.0 with Apple clang version 17.0.0). After the prerequisites are installed, then building OPM Flow
132-
can be achieved with the following bash lines:
133-
134-
.. code-block:: console
135-
136-
CURRENT_DIRECTORY="$PWD"
137-
138-
for module in common geometry grid istl
139-
do git clone https://gitlab.dune-project.org/core/dune-$module.git
140-
cd dune-$module && git checkout v2.10.0 && cd ..
141-
./dune-common/bin/dunecontrol --only=dune-$module cmake -DCMAKE_DISABLE_FIND_PACKAGE_MPI=1
142-
./dune-common/bin/dunecontrol --only=dune-$module make -j5
143-
done
144-
145-
mkdir build
146-
147-
for repo in common grid simulators
148-
do git clone https://github.com/OPM/opm-$repo.git
149-
mkdir build/opm-$repo && cd build/opm-$repo
150-
cmake -DUSE_MPI=0 -DWITH_NDEBUG=1 -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$CURRENT_DIRECTORY/dune-common/build-cmake;$CURRENT_DIRECTORY/dune-grid/build-cmake;$CURRENT_DIRECTORY/dune-geometry/build-cmake;$CURRENT_DIRECTORY/dune-istl/build-cmake;$CURRENT_DIRECTORY/build/opm-common;$CURRENT_DIRECTORY/build/opm-grid" $CURRENT_DIRECTORY/opm-$repo
151-
if [[ $repo == simulators ]]; then
152-
make -j5 flow
153-
else
154-
make -j5 opm$repo
155-
fi
156-
cd ../..
157-
done
158-
159-
echo "export PATH=\$PATH:$CURRENT_DIRECTORY/build/opm-simulators/bin" >> ~/.zprofile
160-
source ~/.zprofile
161-
162-
This builds OPM Flow, and it exports the path to the flow executable.
163-
164-
.. tip::
165-
See `this repository <https://github.com/daavid00/OPM-Flow_macOS>`_ dedicated to build OPM Flow from source in the latest macOS (GitHub actions), and tested with **pycopm**.
166-
If you still face problems, raise an issue in the GitHub repository, or you could also send an email to the maintainers.
124+
See `this repository <https://github.com/daavid00/OPM-Flow_macOS>`_ dedicated to build OPM Flow from source in the latest macOS (GitHub actions), and tested with **pycopm**

docs/contributing.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ <h2>Contribute to the software<a class="headerlink" href="#contribute-to-the-sof
108108
<blockquote>
109109
<div><ol class="arabic simple">
110110
<li><p><strong>pip install -r dev-requirements.txt</strong> (this installs the <a class="reference external" href="https://github.com/cssr-tools/pycopm/blob/main/dev-requirements.txt">dev-requirements.txt</a>)</p></li>
111-
<li><p><strong>black src/ tests/</strong> (this formats the code)</p></li>
111+
<li><p><strong>black –target-version py312 src/ tests/</strong> (this formats the code)</p></li>
112112
<li><p><strong>pylint src/ tests/</strong> (this analyses the code, and might rise issues that need to be fixed before the pull request)</p></li>
113113
<li><p><strong>mypy –ignore-missing-imports src/ tests/</strong> (this is a static checker, and might rise issues that need to be fixed before the pull request)</p></li>
114114
<li><p><strong>pytest –cov=pycopm –cov-report term-missing tests/</strong> (this runs locally the tests, and might rise issues that need to be fixed before the pull request)</p></li>
@@ -117,7 +117,7 @@ <h2>Contribute to the software<a class="headerlink" href="#contribute-to-the-sof
117117
</ol>
118118
<div class="admonition tip">
119119
<p class="admonition-title">Tip</p>
120-
<p>See the <a class="reference external" href="https://github.com/cssr-tools/pycopm/blob/main/.github/workflows/ci_pycopm_ubuntu.yml">ci_pycopm_ubuntu.yml</a> script and the <a class="reference external" href="https://github.com/cssr-tools/pycopm/actions">Actions</a> for installation of pycopm, OPM Flow (binary packages), and dependencies, as well as the execution of the seven previous steps in Ubuntu 24.04 using Python 3.11.
120+
<p>See the <a class="reference external" href="https://github.com/cssr-tools/pycopm/blob/main/.github/workflows/ci_pycopm_ubuntu.yml">ci_pycopm_ubuntu.yml</a> script and the <a class="reference external" href="https://github.com/cssr-tools/pycopm/actions">Actions</a> for installation of pycopm, OPM Flow (binary packages), and dependencies, as well as the execution of the seven previous steps in Ubuntu 24.04 using Python 3.12.
121121
For macOS users, see the <a class="reference external" href="https://github.com/daavid00/OPM-Flow_macOS/blob/main/.github/workflows/ci_pycopm_macos.yml">ci_pycopm_macos.yml</a> script and the <a class="reference external" href="https://github.com/cssr-tools/pycopm/actions">OPM-Flow_macOS Actions</a> for installation of pycopm, OPM Flow (source build), and dependencies, as well as running the tests and the hello world example in macOS 26 using Python3.13.
122122
Note that if you do not add the directory containing the OPM Flow executable to your system’s PATH environment variable (e.g., export PATH=$PATH:/Users/yourname/pycopm/build/opm-simulators/bin), then you can pass this in the execution of the tests and pycopm using the flags <strong>-f/–flow</strong> (see <a class="reference external" href="https://github.com/daavid00/OPM-Flow_macOS/blob/main/.github/workflows/ci_pycopm_macos.yml#L72">this script</a>).</p>
123123
</div>

docs/installation.html

Lines changed: 3 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ <h3>Source build in Linux/Windows<a class="headerlink" href="#source-build-in-li
165165
<span class="go">do git clone https://github.com/OPM/opm-$repo.git</span>
166166
<span class="go"> mkdir build/opm-$repo</span>
167167
<span class="go"> cd build/opm-$repo</span>
168-
<span class="go"> cmake -DUSE_MPI=1 -DWITH_NDEBUG=1 -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=&quot;$CURRENT_DIRECTORY/build/opm-common;$CURRENT_DIRECTORY/build/opm-grid&quot; $CURRENT_DIRECTORY/opm-$repo</span>
168+
<span class="go"> cmake -DUSE_MPI=1 -DWITH_NDEBUG=1 -DCMAKE_BUILD_TYPE=Release $CURRENT_DIRECTORY/opm-$repo</span>
169169
<span class="go"> if [[ $repo == simulators ]]; then</span>
170170
<span class="go"> make -j5 flow</span>
171171
<span class="go"> else</span>
@@ -184,7 +184,7 @@ <h3>Source build in Linux/Windows<a class="headerlink" href="#source-build-in-li
184184
<span id="macos"></span><h3>Brew formula for macOS<a class="headerlink" href="#brew-formula-for-macos" title="Link to this heading"></a></h3>
185185
<p>For macOS, there are no available binary packages, so OPM Flow needs to be built from source. Recently, a formula to build flow using brew has
186186
been added in <a class="reference external" href="https://github.com/cssr-tools/homebrew-opm">https://github.com/cssr-tools/homebrew-opm</a>.
187-
Then, you can try to install flow (v2025.10) by simply typing:</p>
187+
Then, you can try to install flow (v2026.02) by simply typing:</p>
188188
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">brew install cssr-tools/opm/opm-simulators</span>
189189
</pre></div>
190190
</div>
@@ -196,46 +196,7 @@ <h3>Source build in Linux/Windows<a class="headerlink" href="#source-build-in-li
196196
</section>
197197
<section id="source-build-in-macos">
198198
<h3>Source build in macOS<a class="headerlink" href="#source-build-in-macos" title="Link to this heading"></a></h3>
199-
<p>If you would like to build the latest OPM Flow from the master branch, then you can first install the prerequisites using brew:</p>
200-
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">brew install cjson boost openblas suite-sparse python@3.13 cmake</span>
201-
</pre></div>
202-
</div>
203-
<p>In addition, it is recommended to uprade and update your macOS to the latest available versions (the following steps have
204-
worked for macOS Tahoe 26.2.0 with Apple clang version 17.0.0). After the prerequisites are installed, then building OPM Flow
205-
can be achieved with the following bash lines:</p>
206-
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">CURRENT_DIRECTORY=&quot;$PWD&quot;</span>
207-
208-
<span class="go">for module in common geometry grid istl</span>
209-
<span class="go">do git clone https://gitlab.dune-project.org/core/dune-$module.git</span>
210-
<span class="go"> cd dune-$module &amp;&amp; git checkout v2.10.0 &amp;&amp; cd ..</span>
211-
<span class="go"> ./dune-common/bin/dunecontrol --only=dune-$module cmake -DCMAKE_DISABLE_FIND_PACKAGE_MPI=1</span>
212-
<span class="go"> ./dune-common/bin/dunecontrol --only=dune-$module make -j5</span>
213-
<span class="go">done</span>
214-
215-
<span class="go">mkdir build</span>
216-
217-
<span class="go">for repo in common grid simulators</span>
218-
<span class="go">do git clone https://github.com/OPM/opm-$repo.git</span>
219-
<span class="go"> mkdir build/opm-$repo &amp;&amp; cd build/opm-$repo</span>
220-
<span class="go"> cmake -DUSE_MPI=0 -DWITH_NDEBUG=1 -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=&quot;$CURRENT_DIRECTORY/dune-common/build-cmake;$CURRENT_DIRECTORY/dune-grid/build-cmake;$CURRENT_DIRECTORY/dune-geometry/build-cmake;$CURRENT_DIRECTORY/dune-istl/build-cmake;$CURRENT_DIRECTORY/build/opm-common;$CURRENT_DIRECTORY/build/opm-grid&quot; $CURRENT_DIRECTORY/opm-$repo</span>
221-
<span class="go"> if [[ $repo == simulators ]]; then</span>
222-
<span class="go"> make -j5 flow</span>
223-
<span class="go"> else</span>
224-
<span class="go"> make -j5 opm$repo</span>
225-
<span class="go"> fi</span>
226-
<span class="go"> cd ../..</span>
227-
<span class="go">done</span>
228-
229-
<span class="go">echo &quot;export PATH=\$PATH:$CURRENT_DIRECTORY/build/opm-simulators/bin&quot; &gt;&gt; ~/.zprofile</span>
230-
<span class="go">source ~/.zprofile</span>
231-
</pre></div>
232-
</div>
233-
<p>This builds OPM Flow, and it exports the path to the flow executable.</p>
234-
<div class="admonition tip">
235-
<p class="admonition-title">Tip</p>
236-
<p>See <a class="reference external" href="https://github.com/daavid00/OPM-Flow_macOS">this repository</a> dedicated to build OPM Flow from source in the latest macOS (GitHub actions), and tested with <strong>pycopm</strong>.
237-
If you still face problems, raise an issue in the GitHub repository, or you could also send an email to the maintainers.</p>
238-
</div>
199+
<p>See <a class="reference external" href="https://github.com/daavid00/OPM-Flow_macOS">this repository</a> dedicated to build OPM Flow from source in the latest macOS (GitHub actions), and tested with <strong>pycopm</strong></p>
239200
</section>
240201
</section>
241202
</section>

docs/searchindex.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)