Skip to content
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

Update kernel module checking #45

Merged
merged 4 commits into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 18 additions & 5 deletions PackageInfo.g
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,24 @@ Dependencies := rec(
),

AvailabilityTest := function()
if not "cvec" in SHOW_STAT() and
Filename(DirectoriesPackagePrograms("cvec"), "cvec.so") = fail then
#Info(InfoWarning, 1, "cvec: kernel cvec functions not available.");
return fail;
fi;
if CompareVersionNumbers(GAPInfo.Version, "4.12") then
if not IsKernelExtensionAvailable("cvec") then
LogPackageLoadingMessage(PACKAGE_WARNING,
["the kernel module is not compiled, ",
"the package cannot be loaded."]);
return fail;
fi;
else
# TODO this clause can be removed once cvec requires GAP>=4.12.1
digraphs_so := Filename(DirectoriesPackagePrograms("digraphs"),
"digraphs.so");
if not "cvec" in SHOW_STAT() and
Filename(DirectoriesPackagePrograms("cvec"), "cvec.so") = fail then
LogPackageLoadingMessage(PACKAGE_WARNING,
["the kernel module is not compiled, ",
"the package cannot be loaded."]);
return fail;
fi;
return true;
end,

Expand Down
22 changes: 15 additions & 7 deletions init.g
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,21 @@
################################

# load kernel function if it is installed:
if (not IsBound(CVEC)) and ("cvec" in SHOW_STAT()) then
# try static module
LoadStaticModule("cvec");
fi;
if (not IsBound(CVEC)) and
(Filename(DirectoriesPackagePrograms("cvec"), "cvec.so") <> fail) then
LoadDynamicModule(Filename(DirectoriesPackagePrograms("cvec"), "cvec.so"));
if CompareVersionNumbers(GAPInfo.Version, "4.12") then
james-d-mitchell marked this conversation as resolved.
Show resolved Hide resolved
if not LoadKernelExtension("cvec") then
Error("failed to load the cvec package kernel extension");
fi;
else
# TODO this clause can be removed once cvec requires GAP>=4.12.1
# load kernel function if it is installed:
if (not IsBound(CVEC)) and ("cvec" in SHOW_STAT()) then
# try static module
LoadStaticModule("cvec");
fi;
if (not IsBound(CVEC)) and
(Filename(DirectoriesPackagePrograms("cvec"), "cvec.so") <> fail) then
LoadDynamicModule(Filename(DirectoriesPackagePrograms("cvec"), "cvec.so"));
fi;
fi;

#
Expand Down
Loading