<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Ok, I might have found the problem. It was a small detail in you
mail, Andres, that pointed me in a direction to investigate:</p>
<p><br>
</p>
<p>There should be a file " in the builddir of dune-vtk under
python/dune/data/dune-vtk.cmake.", but I have found mine in a
slightly different directory, in <code>python/vtk/data/dune-vtk.cmake</code>.
First, I though, this might have been a typo, this seems to be the
problem.</p>
<p><br>
</p>
<p>How is this file generated? I don't know exactly, but it might be
somehow in the dune_python_configure_bindings() macro. This macro
was changed some time ago and I had to update the call from the
old function to the new one. There was not indication what the new
arguments mean, in relation to the old macro parameters, so my
solution in dune-vtk/python/CMakeLists.txt was <br>
</p>
<p><br>
</p>
<div
style="color: #cccccc;background-color: #1f1f1f;font-family: 'Droid Sans Mono', 'monospace', monospace;font-weight: normal;font-size: 14px;line-height: 19px;white-space: pre;"><div><span
style="color: #cccccc;">dune_python_configure_bindings(</span></div><div><span
style="color: #cccccc;"> </span><span style="color: #569cd6;">PATH</span><span
style="color: #cccccc;"> </span><span style="color: #ce9178;">"."</span></div><div><span
style="color: #cccccc;"> PACKAGENAME vtk</span></div><div><span
style="color: #cccccc;"> CMAKE_METADATA_FLAGS DUNE_OPTS_FILE</span></div><div><span
style="color: #cccccc;">)</span></div></div>
<p></p>
<p><br>
</p>
<p>I named the package "vtk". This seems to be a problem. I don't
know where this "PACKAGENAME" argument might be used, but it
generates the file in the wrong directory, which is then not found
in the whole machinery. <br>
</p>
<p>Removing this argument made the file dune-vtk.cmake appear in the
correct directory and also the compile_command.json (and the
CMakeLists file that it is generated from) contain the dune-vtk
directory.</p>
<p><br>
</p>
<p>Thanks for the hints and the questions where to start looking.</p>
<p><br>
</p>
<p>Best,<br>
Simon<br>
</p>
<p><br>
</p>
<div class="moz-cite-prefix">Am 03.04.25 um 23:12 schrieb Simon
Praetorius:<br>
</div>
<blockquote type="cite"
cite="mid:16de97e2-76dd-481a-9982-528b38e75dd4@tu-dresden.de">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<p>Hi Andreas,</p>
<p><br>
</p>
<p>thanks for the hints already. I have followed your questions
(see below), but still one step in the middle seems to fail.<br>
</p>
<br>
<blockquote type="cite"
cite="mid:DB9PR01MB90087CCFB9B65B11FC57DA7B9AAE2@DB9PR01MB9008.eurprd01.prod.exchangelabs.com">
<meta http-equiv="Content-Type"
content="text/html; charset=UTF-8">
<style type="text/css" style="display:none;">P {margin-top:0;margin-bottom:0;}</style>
<div class="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="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>
</blockquote>
<p>Yes, dune-vtk is listed there<br>
</p>
<p><br>
</p>
<blockquote type="cite"
cite="mid:DB9PR01MB90087CCFB9B65B11FC57DA7B9AAE2@DB9PR01MB9008.eurprd01.prod.exchangelabs.com">
<div class="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. <br>
</code></span></div>
</blockquote>
<p>The dune-py/CMakeLists.txt does **not** contain the vtk dir or
anything else from dune-vtk (e.g. no HAVE_DUNE_VTK variable)<br>
</p>
<p><br>
</p>
<blockquote type="cite"
cite="mid:DB9PR01MB90087CCFB9B65B11FC57DA7B9AAE2@DB9PR01MB9008.eurprd01.prod.exchangelabs.com">
<div class="elementToProof"
style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);"><span
style="font-family: Calibri, Helvetica, sans-serif;"><code
style="font-family: Calibri, Helvetica, sans-serif;"><br>
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>
</blockquote>
<p>The dune-vtk.cmake file exists and contains the following lines
(and a few more)<br>
</p>
<p><br>
</p>
<div
style="color: #cccccc;background-color: #1f1f1f;font-family: 'Droid Sans Mono', 'monospace', monospace;font-weight: normal;font-size: 14px;line-height: 19px;white-space: pre;"><div><span
style="color: #cccccc;">DEPBUILDDIRS=/opt/sources/dune/dune-vtk/build/gcc14-debug;/opt/sources/dune/dune-common/build/gcc14-debug;/opt/sources/dune/dune-geometry/build/gcc14-debug;/opt/sources/dune/dune-localfunctions/build/gcc14-debug;/opt/sources/dune/dune-uggrid/build/gcc14-debug;/opt/sources/dune/dune-grid/build/gcc14-debug;/opt/sources/dune/dune-istl/build/gcc14-debug;/opt/sources/dune/dune-typetree/build/gcc14-debug;/opt/sources/dune/dune-functions/build/gcc14-debug;/opt/sources/dune/dune-alugrid/build/gcc14-debug;/opt/sources/dune/dune-foamgrid/build/gcc14-debug</span></div><div><span
style="color: #cccccc;">DEPS=dune-vtk dune-common dune-geometry dune-localfunctions dune-uggrid dune-grid dune-istl dune-typetree dune-functions dune-alugrid dune-foamgrid</span></div></div>
<p><br>
</p>
<p>This indicates that the metadata is correct, but somehow
ignored.<br>
</p>
<p><br>
</p>
<blockquote type="cite"
cite="mid:DB9PR01MB90087CCFB9B65B11FC57DA7B9AAE2@DB9PR01MB9008.eurprd01.prod.exchangelabs.com">
<div class="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>
</blockquote>
<p>This file also does not contain the required include
directories of dune-vtk.<br>
</p>
<p><br>
</p>
<blockquote type="cite"
cite="mid:DB9PR01MB90087CCFB9B65B11FC57DA7B9AAE2@DB9PR01MB9008.eurprd01.prod.exchangelabs.com">
<div class="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="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>
</blockquote>
<p>Since the CMakeLists.txt file in the dune-py dir is incomplete,
the generated compile_commands cannot be correct either. So, now
the question is, how is this CMakeLists file generated. How can
I inspect or activate the logging tools? And where to find the
log output? Maybe there is an information that helps.<br>
</p>
<p><br>
</p>
<p><br>
</p>
<blockquote type="cite"
cite="mid:DB9PR01MB90087CCFB9B65B11FC57DA7B9AAE2@DB9PR01MB9008.eurprd01.prod.exchangelabs.com">
<div class="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="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="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="elementToProof"
style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Andreas</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> Dune-devel <a
class="moz-txt-link-rfc2396E"
href="mailto:dune-devel-bounces@lists.dune-project.org"
moz-do-not-send="true"><dune-devel-bounces@lists.dune-project.org></a>
on behalf of Simon Praetorius <a
class="moz-txt-link-rfc2396E"
href="mailto:simon.praetorius@tu-dresden.de"
moz-do-not-send="true"><simon.praetorius@tu-dresden.de></a><br>
<b>Sent:</b> 03 April 2025 20:04<br>
<b>To:</b> <a
class="moz-txt-link-abbreviated moz-txt-link-freetext"
href="mailto:dune-devel@lists.dune-project.org"
moz-do-not-send="true">dune-devel@lists.dune-project.org</a>
<a class="moz-txt-link-rfc2396E"
href="mailto:dune-devel@lists.dune-project.org"
moz-do-not-send="true"><dune-devel@lists.dune-project.org></a><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_mx_EventTile_body x_markdown-body x_translate"></span></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>
</div>
</blockquote>
</blockquote>
</body>
</html>