Skip to content

Commit

Permalink
Removed libgap module
Browse files Browse the repository at this point in the history
  • Loading branch information
sebasguts committed Nov 13, 2018
1 parent 62f2751 commit 6031011
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 29 deletions.
12 changes: 0 additions & 12 deletions JuliaInterface/julia/gaptypes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,3 @@ export call_with_catch
end

#########################################################################

module GAP

"""
GapFEE
> Wraps a pointer to a GAP FFE immediate object
> This type is defined in the JuliaInterface C code.
"""


end
9 changes: 5 additions & 4 deletions JuliaInterface/read.g
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@ dirs:= DirectoriesPackageLibrary( "JuliaInterface", "julia" );

JuliaIncludeFile( Filename( dirs, "gaptypes.jl" ) );

_InitializeGAPFFEType();

ImportJuliaModuleIntoGAP( "GAP" );

if not IsBound( JULIAINTERNAL_LOADED_FROM_JULIA ) then
dirs:= DirectoriesPackageLibrary( "JuliaInterface", "../LibGAP.jl/src" );
Julia.Base.include( Julia.Main!.julia_pointer, Filename( dirs, "initialization.jl" ) );
Julia.Base.include( Julia.Main.GAP!.julia_pointer, Filename( dirs, "libgap.jl" ) );
fi;

_InitializeInternalGlobalVariables();

ImportJuliaModuleIntoGAP( "GAP" );

ReadPackage( "JuliaInterface", "gap/arith.gi");
12 changes: 5 additions & 7 deletions JuliaInterface/src/JuliaInterface.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,11 @@ jl_module_t * get_module_from_string(char * name)
// This function needs to be called after the `gaptypes.jl`
// file is loaded into Julia and the GAP module is present.
// Therefore we do not call in InitKernel, but in the `read.g` file.
Obj Func_InitializeGAPFFEType(Obj self)
Obj Func_InitializeInternalGlobalVariables(Obj self)
{
JULIA_GAPFFE_type = (jl_datatype_t *)jl_new_primitivetype(
(jl_value_t *)jl_symbol("GapFFE"), get_module_from_string("GAP"),
jl_any_type, jl_emptysvec, sizeof(Obj) * 8);
jl_set_const(get_module_from_string("GAP"), jl_symbol("GapFFE"),
(jl_value_t *)JULIA_GAPFFE_type);
jl_module_t * gap_module = get_module_from_string("GAP");
JULIA_GAPFFE_type =
(jl_datatype_t *)jl_get_global(gap_module, jl_symbol("GapFFE"));
return NULL;
}

Expand Down Expand Up @@ -659,7 +657,7 @@ static StructGVarFunc GVarFuncs[] = {
GVAR_FUNC(JuliaModule, 1, "name"),
GVAR_FUNC(_ConvertedFromJulia_record_dict, 1, "dict"),
GVAR_FUNC(_NewJuliaCFunc, 2, "ptr,arg_names"),
GVAR_FUNC(_InitializeGAPFFEType, 0, ""),
GVAR_FUNC(_InitializeInternalGlobalVariables, 0, ""),
{ 0 } /* Finish with an empty entry */

};
Expand Down
2 changes: 1 addition & 1 deletion LibGAP.jl/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Then enter:

include("src/initialization.jl")
oscardir = ENV["oscardir"]
libgap.run_it("$oscardir/gap")
GAP.run_it("$oscardir/gap")

You should now see the GAP banner, after which you are ready to use the
rest of LibGAP.jl.
16 changes: 14 additions & 2 deletions LibGAP.jl/src/initialization.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
module libgap
module GAP


"""
GapFEE
> Wraps a pointer to a GAP FFE immediate object
> This type is defined in the JuliaInterface C code.
"""

primitive type GapFFE 64 end

export GapFFE

import Base: length, convert, finalize

Expand Down Expand Up @@ -50,7 +62,7 @@ function initialize( argv::Array{String,1}, env::Array{String,1} )
, Ptr{Cvoid}
, (Ptr{UInt8},)
, "LoadPackage(\"JuliaInterface\");" )
Base.include( Main.GAP, pkgdir * "/libgap.jl")
Base.include( GAP, pkgdir * "/libgap.jl")
end

function finalize( )
Expand Down
6 changes: 3 additions & 3 deletions LibGAP.jl/test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ using Test

include("runtests_dir.jl")

if ! @isdefined(libgap)
if ! @isdefined(GAP)
include(INIT_FILE)
end

if !libgap.gap_is_initialized
libgap.run_it(GAPPATH)
if !GAP.gap_is_initialized
GAP.run_it(GAPPATH)
end

include("basics.jl")
Expand Down

0 comments on commit 6031011

Please sign in to comment.