- removed milestone
signature hash too long on MinGW
I know this might not be supported but when running on MinGW, compiling dolfin expressions with cmake or distutils for that matter fails because the hash is too long. Windows only handles ~256 characters path. The hack below in dolfin.compilemodules.compilemodule.py seems to do the trick but I am wondering if there is a better solution that would minimize hash collisions with shorter hash strings.
# Create unique module name for this application run
if module_name is "":
if sys.platform == 'win32':
hash = hashlib.md5
else:
#breaks on windows because of max path length (Chaffra)
hash = hashlib.sha1
module_name = "dolfin_%s" % \
hash((repr(code) +
dolfin.__version__ +
str(_interface_version) +
additional_declarations +
str(additional_system_headers) +
repr(instant_kwargs)).encode("utf-8")
).hexdigest()
if sys.platform == 'win32':
module_name = module_name[0:17]
Comments (4)
-
-
- changed milestone to 2016.2
- edited description
-
assigned issue to
-
I'm adding a parameter max_signature_length you can use to control this, both to dolfin and ffc.
-
- changed status to resolved
I've added these parameters as workarounds:
parameters["max_signature_length"] = 18 parameters["form_compiler"]["max_signature_length"] = 18
But on my system the paths are currently only ~100 chars, so you need to have some serious path length to the root of the instant/dijitso caches to hit this problem. I'm considering this solution a sufficient workaround and would advice using less deep paths on your system as a better approach.
- Log in to comment
Removing milestone: 1.7 (automated comment)