Skip to content

Commit

Permalink
Check if JuliaInterface could be loaded
Browse files Browse the repository at this point in the history
when GAP is loaded into Julia
  • Loading branch information
sebasguts committed Jan 31, 2019
1 parent 9383331 commit 8bc2d54
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion LibGAP.jl/src/initialization.jl
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,14 @@ function initialize( argv::Array{String,1}, env::Array{String,1} )
ccall( Libdl.dlsym(gap_library, :GAP_EvalString)
, Ptr{Cvoid}
, (Ptr{UInt8},)
, "LoadPackage(\"JuliaInterface\");" )
, "_JULIAINTERNAL_JULIAINTERFACE_LOADED := LoadPackage(\"JuliaInterface\");" )
loadpackage_return = ccall( Libdl.dlsym(gap_library, :GAP_EvalString)
, Ptr{Cvoid}
, (Ptr{UInt8},)
, "_JULIAINTERNAL_JULIAINTERFACE_LOADED;" )
if loadpackage_return == Libdl.dlsym(gap_library, :GAP_Fail )
throw(ErrorException( "JuliaInterface could not be loaded" ))
end
end

function finalize( )
Expand Down

0 comments on commit 8bc2d54

Please sign in to comment.