Skip to content

Commit ac5e748

Browse files
committed
Fall back on using RTLD_DEFAULT if we can't find flint in Padic
If openSharedLibrary fails but we can still find fmpz_init using foreignFunction (which wraps dlsym), then we just set flint to be null and use the new foreignFunction methods that accept null as a first argument.
1 parent 4ad48ec commit ac5e748

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

M2/Macaulay2/packages/Padic.m2

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,10 @@ endpkg = msg -> (
5656
if not ForeignFunctions#"private dictionary"#?"foreignFunction"
5757
then endpkg "foreign function interface is not available"
5858

59-
flint = try openSharedLibrary "flint" else endpkg "flint is not available"
59+
flint = (
60+
try openSharedLibrary "flint"
61+
else try foreignFunction("fmpz_init", void, voidstar) then null
62+
else endpkg "flint is not available")
6063

6164
export {
6265
-- methods

0 commit comments

Comments
 (0)