Skip to content

Commit

Permalink
Add dolfin version to JIT hash (#102)
Browse files Browse the repository at this point in the history
This is a backport of DOLFIN old commit 1211d17cbf1d35727a57b01c61127bc904becaf1
where it fixed problems on Bamboo
  • Loading branch information
blechta authored and garth-wells committed Jun 28, 2018
1 parent 399a8e1 commit 3b2fd8a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion python/dolfin/jit/jit.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def compile_class(cpp_data):
if hasattr(v, '_cpp_object') and isinstance(v._cpp_object, cpp.function.GenericFunction):
property_str += '*'

hash_str = str(statements) + str(property_str)
hash_str = str(statements) + str(property_str) + cpp.__version__
module_hash = hashlib.md5(hash_str.encode('utf-8')).hexdigest()
module_name = "dolfin_" + name + "_" + module_hash

Expand Down
5 changes: 3 additions & 2 deletions python/dolfin/jit/pybind11jit.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

from dolfin.cpp.log import log, LogLevel
from . import get_pybind_include

import dolfin.cpp as cpp
from dolfin.jit.jit import dijitso_jit, dolfin_pc


Expand Down Expand Up @@ -66,7 +66,8 @@ def compile_cpp_code(cpp_code):

params['build']['cxxflags'] += tuple(dmacros)

module_hash = hashlib.md5(cpp_code.encode('utf-8')).hexdigest()
hash_str = cpp_code + cpp.__version__
module_hash = hashlib.md5(hash_str.encode('utf-8')).hexdigest()
module_name = "dolfin_cpp_module_" + module_hash

module, signature = dijitso_jit(cpp_code, module_name, params,
Expand Down

0 comments on commit 3b2fd8a

Please sign in to comment.