Includes not considered when computing hash by compile_extension_module
compile_extension_module
does not trigger recompilation when header files are switched. MWE: run this code
code = """
#include <dolfin/common/Array.h>
namespace dolfin
{
void foo()
{
Array<int> a(2);
a[5] = 42;
}
}
"""
from dolfin import *
m = compile_extension_module(code)
m.foo()
with DOLFIN with assertions on and then another DOLFIN with assertions off. Module is not recompiled. Then erase JIT cache and run first with assertions off and then on. Again module is not recompiled and the result is different to previous one.
Comments (11)
-
-
reporter @martinal Yes. I think we also put SWIG and NumPy versions into
INSTANT_CACHE/ERROR_DIR
variables to handle this on our cluster. Not sure whether this is necessary but we had some problems prior to this. -
- changed milestone to 1.6
-
- changed milestone to 1.7
-
- removed milestone
Removing milestone: 1.7 (automated comment)
-
- changed milestone to 2016.2
-
Issue
#705was marked as a duplicate of this issue. -
There's a manually controlled variable
_interface_version
in compilemodule.py, only bumped to 3 so far... This is very error prone.Hashing all dolfin headers on install is one option, but that results in rejitting on almost every update.
Hashing only the headers that are used in the jitted code on demand is more complex to implement (finding headers etc).
Is it possible to get the dolfin build options at runtime? We could at least add those to the signature, that would fix the example code in this issue.
-
- changed milestone to 2017.1
-
- removed milestone
-
There doesn't seem to be a simple fix to this issue. We should at least add the version number to the hash, we can add build options (this will be easy soon because the pybdind11 jit uses pkg-config via the Python pkgconfig package).
I'm comfortable with users of the dev version having to to some manual setting of the cache dir or cleaning.
Shall we close this issue and create a new one on adding build options to the hash?
- Log in to comment
I think this is an example of a need for installation-specific instant cache dirs. There's an issue on that under instant for the py2/3 divide:
https://bitbucket.org/fenics-project/instant/issue/22/create-separate-instant-cache-directory
However the problem is more general: fenics versions do not live safely side by side in the same instant cache dir.