[Dune-devel] Fw: JIT compiling of python code uses wrong compile_commands
Dedner, Andreas
A.S.Dedner at warwick.ac.uk
Thu Apr 3 22:44:30 CEST 2025
Just realized I didn't reply to the devel list. In case this is of general interest for someone later
(although Christian' reply covers part of my answer already)
Andreas
________________________________
From: Dedner, Andreas <A.S.Dedner at warwick.ac.uk>
Sent: 03 April 2025 21:24
To: Simon Praetorius <simon.praetorius at tu-dresden.de>
Subject: Re: [Dune-devel] JIT compiling of python code uses wrong compile_commands
Hi Simon.
My first question would be:
what does build/run-in-dune-venv.py pip list | grep dune give you? Most importantly does it list dune-vtk?
If that is found by pip then check the `dune-py/CMakeLists.txt` file if the line set(dune-vtk_DIR PATH) is there. The path comes from the metadata file which should be in the builddir of dune-vtk under python/dune/data/dune-vtk.cmake.
Only after all that looks correct I would check the compile_commands.json file.
That is generated in python/dune/generator/cmakebuilder.py:547
by compiling a empty cc and extracting the information from the files that cmake generated.
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.
Best
Andreas
________________________________
From: Dune-devel <dune-devel-bounces at lists.dune-project.org> on behalf of Simon Praetorius <simon.praetorius at tu-dresden.de>
Sent: 03 April 2025 20:04
To: dune-devel at lists.dune-project.org <dune-devel at lists.dune-project.org>
Subject: [Dune-devel] JIT compiling of python code uses wrong compile_commands
Hi everyone,
I have posted a question already in the Dune support channel, but maybe here in the mailing list are more python experts:
I am currently trying to run a simple Python example in the dune-vtk module, i.e. dune/python/test/testvtk.py. 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 build/run-in-dune-venv.py in my build directory build/. 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 compile_commands.json file, which is located in the dune-py directory in the dune-common build directory build/dune-venv/.cache/dune-py.
The error I get is "fatal error: dune/python/vtk/writer.hh: file or directory not found".
Can anyone tell me how this compile_commands.json file is generated? I am trying to figure out why it does not include all the include directories of the modules involved.
Best, Simon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.dune-project.org/pipermail/dune-devel/attachments/20250403/7a0508fd/attachment-0001.htm>
More information about the Dune-devel
mailing list