-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CreatePolymakeObject(); fails the second time when using GAP workspace files #17
Comments
The fact that polymaking creates a temporary directory, references it in However, just re-creating the dir also doesn't sound great to me (though it might be the quickest temporary workaround). An ideal solution would be to revise the whole thing:
The reason we can't just do this final step in isolation is that then we cannot distinguish the case were the user specific a custom location from the case were we asked the operating system for a temporary directory... Though perhaps this could be achieved by simpler means for now, e.g.: have a second variable CallAndInstallPostRestore( function()
if not IsBound(POLYMAKE_DATA_DIR) then
BindGlobal("POLYMAKE_DATA_DIR", DirectoryTemporary());
POLYMAKE_DATA_DIR_IS_TEMP := true;
elif IsBound(POLYMAKE_DATA_DIR_IS_TEMP) and ValueGlobal("POLYMAKE_DATA_DIR_IS_TEMP") = true then
MakeReadWriteGlobal("POLYMAKE_DATA_DIR");
UnbindGlobal("POLYMAKE_DATA_DIR");
BindGlobal("POLYMAKE_DATA_DIR", DirectoryTemporary());
else
# TODO: possibly re-create POLYMAKE_DATA_DIR directory??
fi;
end ); |
I have deleted my unrelated comments about a segmentation fault. |
Background
GAP recommends to use workspace files for ease of use of GAP:
Hence, my gaprc contains following line:
Issue
However, I have encountered an error when using polymaking.
Start gap without workspace file:
Start gap with workspace (I have a shell alias for this called simply
gap
)As far as I understand it:
When polymaking is loaded and
POLYMAKE_DATA_DIR
is not yet set, a temporary directory is created and assigned toPOLYMAKE_DATA_DIR
.When starting gap with the workspace file,
POLYMAKE_DATA_DIR
is restored and points to a no longer existing directory whatpolymake
expects to exist:Possible solutions
SetPolymakeDataDirectory( Directory("persistent_dir") );
in gaprcPOLYMAKE_DATA_DIR
I feel like polymaking should be able to work with temporary directories: temporary files pile up in a persistent directory over time.
However, I am not sure when using a GAP workspace file and I want to be able to continue using polymake objects where I left the last time gap that the files also must be persistent.
If this is the case, can the documentation mention the recommended way when using workspace files?
The text was updated successfully, but these errors were encountered: