Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed libgap module #151

Merged
merged 1 commit into from
Nov 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;

_JULIAINTERFACE_INTERNAL_INIT();

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_JULIAINTERFACE_INTERNAL_INIT(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(_JULIAINTERFACE_INTERNAL_INIT, 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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The README also needs to be adapted in the same way, i.e., changing libgap.run_it to GAP.run_it

end

include("basics.jl")
Expand Down