Skip to content
Closed
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
1 change: 1 addition & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ BinaryProvider = "b99e7846-7c00-51b0-8f62-c81ae34c0232"
GAP = "c863536a-3901-11e9-33e7-d5cd0df7b904"
Singular = "bcd08a7b-43d2-5ff7-b6d4-c458787f915c"
lib4ti2_jll = "1493ae25-0f90-5c0e-a06c-8c5077d6d66f"
cddlib_jll = "f07e07eb-5685-515a-97c8-3014f6152feb"
Graphviz_jll = "3c863552-8265-54e4-a6dc-903eb78fde85"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a"
Expand Down
2 changes: 2 additions & 0 deletions deps/build.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ for pkg in PACKAGES_TO_COMPILE
GAP.Packages.install(pkg)

end

CompileCddInterface()
53 changes: 52 additions & 1 deletion deps/homalg-project.jl
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ global PACKAGES_BASED_ON_CAP = [
"CategoryConstructor",
"CategoriesWithAmbientObjects",
"CatReps",
"CddInterface",
"ComplexesCategories",
"DerivedCategories",
"FinSetsForCAP",
Expand Down Expand Up @@ -175,6 +176,8 @@ end

export RemoveAllPackagesFromHomalgProject



global PACKAGES_TO_COMPILE = [
"Gauss",
#"Browse", ## do not compile browse as it results into GAP raising the error "Error opening terminal: xterm-256color."
Expand All @@ -186,4 +189,52 @@ global PACKAGES_TO_COMPILE = [
"orb",
]

global PACKAGES_DOWNLOADING_EXTERNAL_CODE = ["CddInterface", "NormalizInterface"]
import cddlib_jll

function CompileCddInterface(; print_available = true, test_availability = true)

name = "CddInterface"

gstr = julia_to_gap( name )

if ( test_availability == false ) || ( GAP.Globals.TestPackageAvailability( gstr ) == GAP.Globals.fail )
pkg = GAP.Globals.PackageInfo( gstr )

if GAP.Globals.Length( pkg ) == 0
dirs = gap_to_julia(GAP.Globals.String( GAP.EvalString("List(DirectoriesLibrary(\"pkg\"), d -> Filename(d, \"\"))")))
@warn "unable to find package named \"" * name * "\" in " * dirs
return false
end

pkg = pkg[1]

path = gap_to_julia( pkg.InstallationPath )

@info "Compiling \"" * path * "\""

cd(path)

run(`./autogen.sh`)
run(`./configure --with-gaproot=$(GAP.GAPROOT) --with-cddlib=$(cddlib_jll.artifact_dir)`)

run(`make -k -j$(Sys.CPU_THREADS)`) ## -k = Keep going when some targets can't be made.

if GAP.Globals.TestPackageAvailability( gstr ) == GAP.Globals.fail
@warn "Compiling the package \"" * name * "\" failed."
return false
end

@info "Compiling the package \"" * name * "\" was successful."
return true

end

if print_available == true
@info "Package \"" * name * "\" is already installed."
end

return true

end

export CompileCddInterface
10 changes: 10 additions & 0 deletions test/cddlib.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
@testset "CddInterface" begin
LoadPackage("CddInterface")
C = cdd_PolyhedronByInequalities([ [ 0, 1, 0 ], [ 0, 1, -1 ] ])
rays = Cdd_GeneratingRays( C )
@test rays == cdd_prepare_gap_input(rays)
@test rays == GAP.Globals.List(
julia_to_gap([ [ 0, -1 ], [ 1, 1 ] ]),
julia_to_gap,
)
end
1 change: 1 addition & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ DocMeta.setdocmeta!(HomalgProject, :DocTestSetup, :(using HomalgProject); recurs
include("packages.jl")
include("singular.jl")
include("4ti2.jl")
include("cddlib.jl")
include("digraphs.jl")
include("homalg_project.jl")
include("testmanual.jl")