Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
james-d-mitchell committed Aug 26, 2024
1 parent fa9462c commit 7ddd785
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 14 deletions.
21 changes: 16 additions & 5 deletions PackageInfo.g
Original file line number Diff line number Diff line change
Expand Up @@ -399,13 +399,24 @@ Dependencies := rec(

AvailabilityTest := function()
local digraphs_so;
digraphs_so := Filename(DirectoriesPackagePrograms("digraphs"),
"digraphs.so");
if (not "digraphs" in SHOW_STAT()) and digraphs_so = fail then
LogPackageLoadingMessage(PACKAGE_WARNING,

if CompareVersionNumbers(GAPInfo.Version, "4.12") then
if not IsKernelExtensionAvailable("digraphs") then
LogPackageLoadingMessage(PACKAGE_WARNING,
["the kernel module is not compiled, ",
"the package cannot be loaded."]);
return fail;
return fail;
fi;
else
# TODO this clause can be removed once Digraphs requires GAP>=4.12.1
digraphs_so := Filename(DirectoriesPackagePrograms("digraphs"),
"digraphs.so");
if (not "digraphs" in SHOW_STAT()) and digraphs_so = fail then
LogPackageLoadingMessage(PACKAGE_WARNING,
["the kernel module is not compiled, ",
"the package cannot be loaded."]);
return fail;
fi;
fi;
return true;
end,
Expand Down
26 changes: 17 additions & 9 deletions init.g
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,23 @@ if not IsBound(UserHomeExpand) then
BindGlobal("UserHomeExpand", USER_HOME_EXPAND);
fi;

# load kernel function if it is installed:
if not IsBound(DIGRAPH_OUT_NBS) and "digraphs" in SHOW_STAT() then
# try static module
LoadStaticModule("digraphs");
fi;
if not IsBound(DIGRAPH_OUT_NBS) and
Filename(DirectoriesPackagePrograms("digraphs"), "digraphs.so") <> fail then
LoadDynamicModule(Filename(DirectoriesPackagePrograms("digraphs"),
"digraphs.so"));
if CompareVersionNumbers(GAPInfo.Version, "4.12") then
if not LoadKernelExtension("digraphs") then
Error("failed to load the Digraphs package kernel extension");
fi;
else
# TODO this clause can be removed once Digraphs requires GAP>=4.12.1
# load kernel function if it is installed:
if not IsBound(DIGRAPH_OUT_NBS) and "digraphs" in SHOW_STAT() then
# try static module
LoadStaticModule("digraphs");
fi;
if not IsBound(DIGRAPH_OUT_NBS) and
Filename(DirectoriesPackagePrograms("digraphs"),
"digraphs.so") <> fail then
LoadDynamicModule(Filename(DirectoriesPackagePrograms("digraphs"),
"digraphs.so"));
fi;
fi;

BindGlobal("DIGRAPHS_IsGrapeLoaded",
Expand Down

0 comments on commit 7ddd785

Please sign in to comment.