<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Just realized I didn't reply to the devel list. In case this is of general interest for someone later</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
(although Christian' reply covers part of my answer already)</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Andreas</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Dedner, Andreas <A.S.Dedner@warwick.ac.uk><br>
<b>Sent:</b> 03 April 2025 21:24<br>
<b>To:</b> Simon Praetorius <simon.praetorius@tu-dresden.de><br>
<b>Subject:</b> Re: [Dune-devel] JIT compiling of python code uses wrong compile_commands</font>
<div> </div>
</div>
<style type="text/css" style="display:none">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
<div dir="ltr">
<div class="x_elementToProof" style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<code style="font-family:Calibri,Helvetica,sans-serif">Hi Simon.</code></div>
<div class="x_elementToProof" style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div class="x_elementToProof" style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<code style="font-family:Calibri,Helvetica,sans-serif">My first question would be:</code></div>
<div class="x_elementToProof" style="font-size:12pt; color:rgb(0,0,0)"><span style="font-family:Calibri,Helvetica,sans-serif"><code style="font-family:Calibri,Helvetica,sans-serif">what does</code></span><span style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif"><code> build/run-in-dune-venv.py
 pip list | grep dune </code>give you? Most importantly does it list dune-vtk?</span></div>
<div class="x_elementToProof" style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
If that is found by pip then check the `dune-py/CMakeLists.txt` file if the line <code>
set(dune-vtk_DIR PATH) </code><span style="font-family:Calibri,Helvetica,sans-serif"><code style="font-family:Calibri,Helvetica,sans-serif">is there. The path comes from the
</code><code>metadata </code></span>file which should be in the builddir of dune-vtk under
<code>python/dune/data/dune-vtk.cmake</code>.</div>
<div class="x_elementToProof" style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div class="x_elementToProof" style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Only after all that looks correct I would check the <code>compile_commands.json</code> file.</div>
<div class="x_elementToProof" style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
That is generated in python/dune/generator/cmakebuilder.py:547</div>
<div class="x_elementToProof" style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
by compiling a empty cc and extracting the information from the files that cmake generated.</div>
<div class="x_elementToProof" style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
I guess this step depends on internal structures of cmake generated files (i.e. link.txt' and could possibly fail with some newer CMake version.</div>
<div class="x_elementToProof" style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div class="x_elementToProof" style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Best</div>
<div class="x_elementToProof" style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Andreas</div>
<div id="x_appendonsend"></div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Dune-devel <dune-devel-bounces@lists.dune-project.org> on behalf of Simon Praetorius <simon.praetorius@tu-dresden.de><br>
<b>Sent:</b> 03 April 2025 20:04<br>
<b>To:</b> dune-devel@lists.dune-project.org <dune-devel@lists.dune-project.org><br>
<b>Subject:</b> [Dune-devel] JIT compiling of python code uses wrong compile_commands</font>
<div> </div>
</div>
<div>
<p>Hi everyone,</p>
<p>I have posted a question already in the Dune support channel, but maybe here in the mailing list are more python experts:</p>
<p><span class="x_x_mx_EventTile_body x_x_markdown-body x_x_translate"></p>
<p>I am currently trying to run a simple Python example in the dune-vtk module, i.e.
<code>dune/python/test/testvtk.py</code>. I have built everything without a user specified venv, using the default that is created in the build directory. To run the code, I use the script
<code>build/run-in-dune-venv.py</code> in my build directory <code>build/</code>. The problem I have is: The JIT compilation step uses an incomplete list of include directories. In particular, the include dirs from dune-vtk are not there. This can be seen in
 the <code>compile_commands.json</code> file, which is located in the dune-py directory in the dune-common build directory
<code>build/dune-venv/.cache/dune-py</code>.</p>
<p>The error I get is "fatal error: dune/python/vtk/writer.hh: file or directory not found".</p>
<p>Can anyone tell me how this <code>compile_commands.json</code> file is generated? I am trying to figure out why it does not include all the include directories of the modules involved.</p>
<p>Best, Simon<br>
</p>
</span>
<p></p>
</div>
</div>
</body>
</html>