-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
77 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
using Libdl: dlopen, dlclose, dlpath, dlsym, RTLD_DEEPBIND, RTLD_LAZY | ||
using Preferences | ||
|
||
const _PREFERENCE_SLUINT32 = @load_preference("libsuperlu_dist_Int32", nothing) | ||
const _PREFERENCE_SLUINT64 = @load_preference("libsuperlu_dist_Int64", nothing) | ||
|
||
flags = RTLD_DEEPBIND | RTLD_LAZY | ||
if _PREFERENCE_SLUINT32 === nothing && _PREFERENCE_SLUINT64 === nothing | ||
using SuperLU_DIST_jll | ||
elseif _PREFERENCE_SLUINT32 === nothing | ||
libsuperlu_dist_Int64 = _PREFERENCE_SLUINT64 | ||
dlopen(libsuperlu_dist_Int64, flags; throw_error=true) | ||
libsuperlu_dist_Int32 = nothing | ||
elseif _PREFERENCE_SLUINT32 === nothing | ||
libsuperlu_dist_Int32 = _PREFERENCE_SLUINT32 | ||
dlopen(libsuperlu_dist_Int32, flags; throw_error=true) | ||
libsuperlu_dist_Int64 = nothing | ||
else | ||
libsuperlu_dist_Int64 = _PREFERENCE_SLUINT64 | ||
dlopen(libsuperlu_dist_Int64, flags; throw_error=true) | ||
libsuperlu_dist_Int32 = _PREFERENCE_SLUINT32 | ||
dlopen(libsuperlu_dist_Int32, flags; throw_error=true) | ||
end | ||
|
||
function set_libraries!(;libsuperlu_dist_Int32 = nothing, libsuperlu_dist_Int64 = nothing) | ||
if isnothing(libsuperlu_dist_Int32) | ||
@delete_preferences!("libsuperlu_dist_Int32") | ||
else | ||
isfile(libsuperlu_dist_Int32) || throw(ArgumentError("$libsuperlu_dist_Int32 is not a file that exists.")) | ||
@set_preferences!("libsuperlu_dist_Int32" => libsuperlu_dist_Int32) | ||
end | ||
if isnothing(libsuperlu_dist_Int64) | ||
@delete_preferences!("libsuperlu_dist_Int64") | ||
else | ||
isfile(libsuperlu_dist_Int64) || throw(ArgumentError("$libsuperlu_dist_Int64 is not a file that exists.")) | ||
@set_preferences!("libsuperlu_dist_Int64" => libsuperlu_dist_Int64) | ||
end | ||
@info "Please restart Julia and reload SuperLUDIST.jl for the library changes to take effect." | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters