Skip to content

Commit

Permalink
Use IsKernelExtensionAvailable and LoadKernelExtension (#125)
Browse files Browse the repository at this point in the history
  • Loading branch information
reiniscirpons authored Aug 26, 2024
1 parent f8ef5f6 commit 48c2c4b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 13 deletions.
1 change: 0 additions & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ jobs:
- master
- stable-4.13
- stable-4.12
- stable-4.11
GAP_PKGS_TO_BUILD: ['profiling']
HPCGAP: ['no']
ABI: ['']
Expand Down
9 changes: 5 additions & 4 deletions PackageInfo.g
Original file line number Diff line number Diff line change
Expand Up @@ -93,16 +93,17 @@ PackageDoc := rec(
),

Dependencies := rec(
GAP := ">=4.11",
GAP := ">=4.12",
NeededOtherPackages := [],
SuggestedOtherPackages := [],
ExternalConditions := []
),

AvailabilityTest := function()
if (not("io" in SHOW_STAT())) and
(Filename(DirectoriesPackagePrograms("io"), "io.so") = fail) then
#Info(InfoWarning, 1, "IO: kernel IO functions not available.");
if not IsKernelExtensionAvailable("io") then
LogPackageLoadingMessage(PACKAGE_WARNING,
["the kernel module is not compiled, ",
"the package cannot be loaded."]);
return fail;
fi;
return true;
Expand Down
10 changes: 2 additions & 8 deletions init.g
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,8 @@
# First look after our C part: #
################################

# load kernel function if it is installed:
if (not IsBound(IO)) and ("io" in SHOW_STAT()) then
# try static module
LoadStaticModule("io");
fi;
if (not IsBound(IO)) and
(Filename(DirectoriesPackagePrograms("io"), "io.so") <> fail) then
LoadDynamicModule(Filename(DirectoriesPackagePrograms("io"), "io.so"));
if not LoadKernelExtension("io") then
Error("failed to load the io package kernel extension");
fi;

ReadPackage("IO", "gap/io.gd");
Expand Down

0 comments on commit 48c2c4b

Please sign in to comment.