diff --git a/community/gap/PKGBUILD b/community/gap/PKGBUILD index ab429c112..972889671 100644 --- a/community/gap/PKGBUILD +++ b/community/gap/PKGBUILD @@ -8,7 +8,7 @@ pkgbase=gap pkgname=(gap gap-doc gap-packages) pkgver=4.10.2 -pkgrel=10 +pkgrel=11 pkgdesc="Groups, Algorithms, Programming: a system for computational discrete algebra" arch=(x86_64) url="https://www.gap-system.org/" @@ -16,13 +16,15 @@ license=(GPL) source=("https://www.gap-system.org/pub/gap/gap-${pkgver%.*}/tar.gz/gap-$pkgver.tar.gz" gap.sh libsemigroups-1.0.patch git+https://github.com/gap-packages/NormalizInterface#commit=cd69a42 - normalizinterface-missing-include.patch) + normalizinterface-missing-include.patch + gap-polymake-4.0.patch) sha256sums=('11175bed0234101643d510d4ab94c44db30bd303bfe63d86b9b86ae67cff9e49' '143fb8a79a52c007903cce13407850df309ef803a9b00398d05169355917de46' 'ccd95de4f48d26b73d6df7c1847855f68ee70644d130d32f14213988c3e286e3' 'SKIP' - '2410dfc69f1f4d2f320e91590d55e59c7b557637f9f60b9e609b318cfc21c181') -makedepends=(libxaw givaro mpfi normaliz boost libsemigroups c-xsc zeromq fplll polymake wget chrpath fmt git) + '2410dfc69f1f4d2f320e91590d55e59c7b557637f9f60b9e609b318cfc21c181' + 'e3f6d671c8df9acb6143a7c279391957967cd44f0a00b949323401d5b54ed685') +makedepends=(libxaw givaro mpfi normaliz polymake boost libsemigroups c-xsc zeromq fplll wget chrpath fmt git) prepare() { cd gap-$pkgver @@ -45,6 +47,8 @@ prepare() { cd ../semigroups-* patch -p1 -i "$srcdir"/libsemigroups-1.0.patch # Fix build with libsemigroups 1.0 + cd ../PolymakeInterface-* + patch -p2 -i "$srcdir"/gap-polymake-4.0.patch # Fix build with polymake 4.0 } build() { @@ -114,7 +118,7 @@ package_gap-packages() { replaces=(gap-4.8-packages) optdepends=('normaliz: Normaliz interface package' 'libxaw: xgap package' 'c-xsc: float package' 'mpfi: float package' 'libmpc: float package' 'fplll: float package' 'zeromq: ZeroMQ interface package' 'planarity: digraph package' - 'polymake: Polymake interface package' 'curl: curl interface package' 'libsemigroups: semigroups package') + 'curl: curl interface package' 'libsemigroups: semigroups package' 'polymake: Polymake interface package') pkgdesc="Extra packages for GAP" cd gap-$pkgver diff --git a/community/gap/gap-polymake-4.0.patch b/community/gap/gap-polymake-4.0.patch new file mode 100644 index 000000000..eb2371755 --- /dev/null +++ b/community/gap/gap-polymake-4.0.patch @@ -0,0 +1,450 @@ +diff --git a/PolymakeInterface/src/polymake_cone.cpp b/PolymakeInterface/src/polymake_cone.cpp +index 6c17f49d..637266a0 100644 +--- a/PolymakeInterface/src/polymake_cone.cpp ++++ b/PolymakeInterface/src/polymake_cone.cpp +@@ -110,16 +110,16 @@ Obj REAL_GENERATING_RAYS_OF_CONE( Polymake_Data* data, Obj cone){ + matr2 = -matr2; + Obj RETLI3 = GAP_MATRIX_POLYMAKE_INTEGER_MATRIX( &matr2 ); + +- int len1 = LEN_PLIST( RETLI1 ); +- int len2 = LEN_PLIST( RETLI2 ); ++ Int len1 = LEN_PLIST( RETLI1 ); ++ Int len2 = LEN_PLIST( RETLI2 ); + + Obj RETLI = NEW_PLIST( T_PLIST, len1 + 2*len2 ); + SET_LEN_PLIST( RETLI, len1 + 2*len2 ); + +- for( int i = 1; i <= len1; i++ ) ++ for( Int i = 1; i <= len1; i++ ) + SET_ELM_PLIST( RETLI, i, ELM_PLIST( RETLI1, i ) ); + +- for( int i = 1; i <= len2; i++ ){ ++ for( Int i = 1; i <= len2; i++ ){ + SET_ELM_PLIST( RETLI, len1 + i, ELM_PLIST( RETLI2, i ) ); + SET_ELM_PLIST( RETLI, len1 + len2 + i, ELM_PLIST( RETLI3, i ) ); + } +@@ -168,7 +168,7 @@ Obj REAL_HILBERT_BASIS_OF_CONE( Polymake_Data* data, Obj cone){ + polymake::Array> arr; + try + { +- arr = coneobj->give("HILBERT_BASIS_GENERATORS"); ++ coneobj->give("HILBERT_BASIS_GENERATORS") >> arr; + } + + POLYMAKE_GAP_CATCH +@@ -232,16 +232,16 @@ Obj REAL_DEFINING_INEQUALITIES_OF_CONE( Polymake_Data* data, Obj cone){ + matr2 = -matr2; + Obj RETLI3 = GAP_MATRIX_POLYMAKE_INTEGER_MATRIX( &matr2 ); + +- int len1 = LEN_PLIST( RETLI1 ); +- int len2 = LEN_PLIST( RETLI2 ); ++ Int len1 = LEN_PLIST( RETLI1 ); ++ Int len2 = LEN_PLIST( RETLI2 ); + + Obj RETLI = NEW_PLIST( T_PLIST, len1 + 2*len2 ); + SET_LEN_PLIST( RETLI, len1 + 2*len2 ); + +- for( int i = 1; i <= len1; i++ ) ++ for( Int i = 1; i <= len1; i++ ) + SET_ELM_PLIST( RETLI, i, ELM_PLIST( RETLI1, i ) ); + +- for( int i = 1; i <= len2; i++ ){ ++ for( Int i = 1; i <= len2; i++ ){ + SET_ELM_PLIST( RETLI, len1 + i, ELM_PLIST( RETLI2, i ) ); + SET_ELM_PLIST( RETLI, len1 + len2 + i, ELM_PLIST( RETLI3, i ) ); + } +diff --git a/PolymakeInterface/src/polymake_data.cpp b/PolymakeInterface/src/polymake_data.cpp +index 3fc25241..ea3a4ed7 100644 +--- a/PolymakeInterface/src/polymake_data.cpp ++++ b/PolymakeInterface/src/polymake_data.cpp +@@ -50,7 +50,7 @@ Obj ExternalPolymakeObjectTypeFunc(Obj o) { + void polymake_start( Polymake_Data* data ){ + if( ! data->initialized ){ + data->main_polymake_session = new polymake::Main; +- data->main_polymake_scope = new polymake::perl::Scope(data->main_polymake_session->newScope()); ++ data->main_polymake_scope = new pm::perl::Scope(data->main_polymake_session->newScope()); + data->initialized = true; + } + return; +diff --git a/PolymakeInterface/src/polymake_data.h b/PolymakeInterface/src/polymake_data.h +index b7d678ed..fcc3543c 100644 +--- a/PolymakeInterface/src/polymake_data.h ++++ b/PolymakeInterface/src/polymake_data.h +@@ -30,15 +30,15 @@ extern Obj TheTypeExternalPolymakeTropicalHypersurface; + extern Obj TheTypeExternalPolymakeTropicalPolytope; + extern Obj TheTypeExternalPolymakeMatroid; + +-typedef pair object_pair; +-typedef polymake::perl::Object perlobj; +-typedef map::iterator iterator; ++typedef pair object_pair; ++typedef pm::perl::BigObject perlobj; ++typedef map::iterator iterator; + + struct Polymake_Data { + bool initialized; + polymake::Main *main_polymake_session; +- polymake::perl::Scope *main_polymake_scope; +- map *polymake_objects; ++ pm::perl::Scope *main_polymake_scope; ++ map *polymake_objects; + int new_polymake_object_number; + }; + +diff --git a/PolymakeInterface/src/polymake_fan.cpp b/PolymakeInterface/src/polymake_fan.cpp +index 6ea650c8..43c2e982 100644 +--- a/PolymakeInterface/src/polymake_fan.cpp ++++ b/PolymakeInterface/src/polymake_fan.cpp +@@ -8,14 +8,14 @@ Obj REAL_FAN_BY_CONES( Polymake_Data* data, Obj cones ){ + return NULL; + } + +- int numberofcones = LEN_PLIST( cones ); ++ Int numberofcones = LEN_PLIST( cones ); + Obj akt; + Obj elem; + Obj numb; +- int numberofrays = 0; ++ Int numberofrays = 0; + data->main_polymake_session->set_application("fan"); + +- for(int i=1;i<=numberofcones;i++){ ++ for(Int i=1;i<=numberofcones;i++){ + akt = ELM_PLIST( cones, i ); + #ifdef MORE_TESTS + if( !IS_PLIST( akt ) ){ +@@ -27,15 +27,15 @@ Obj REAL_FAN_BY_CONES( Polymake_Data* data, Obj cones ){ + + } + +- int dimension = LEN_PLIST( ELM_PLIST( ELM_PLIST( cones, 1 ), 1 ) ); +- polymake::Array> incMatr(numberofcones); ++ Int dimension = LEN_PLIST( ELM_PLIST( ELM_PLIST( cones, 1 ), 1 ) ); ++ polymake::Array> incMatr(numberofcones); + polymake::Matrix matr(numberofrays+1,dimension); +- int raycounter = 1; +- for(int i = 1; i <= numberofcones; i++){ ++ Int raycounter = 1; ++ for(Int i = 1; i <= numberofcones; i++){ + akt = ELM_PLIST( cones, i ); +- for( int j = 1; j <= LEN_PLIST( akt ); j++){ ++ for( Int j = 1; j <= LEN_PLIST( akt ); j++){ + elem = ELM_PLIST( akt, j ); +- for( int k = 1; k <= LEN_PLIST( elem ); k++){ ++ for( Int k = 1; k <= LEN_PLIST( elem ); k++){ + numb = ELM_PLIST( elem, k ); + + #ifdef MORE_TESTS +@@ -75,9 +75,9 @@ Obj REAL_FAN_BY_RAYS_AND_CONES( Polymake_Data* data, Obj rays, Obj cones ){ + + POLYMAKE_RATIONAL_MATRIX_GAP_MATRIX( &matr, rays ); + +- int numberofcones = LEN_PLIST( cones ); +- polymake::Array> incMatr(numberofcones); +- for(int i=0;i> incMatr(numberofcones); ++ for(Int i=0;i(INT_INTOBJ( numb ) - 1); ++ incMatr[i] += static_cast(INT_INTOBJ( numb ) - 1); + } + } + +@@ -123,9 +123,9 @@ Obj REAL_FAN_BY_RAYS_AND_CONES_UNSAVE( Polymake_Data* data, Obj rays, Obj cones + polymake::Matrix matr(0,0); + POLYMAKE_RATIONAL_MATRIX_GAP_MATRIX( &matr, rays ); + +- int numberofcones = LEN_PLIST( cones ); ++ Int numberofcones = LEN_PLIST( cones ); + polymake::IncidenceMatrix<> incMatr(numberofcones,matr.rows()); +- for(int i=0;i(matr[i]) )); ++ for(Int i = 0;i(matr[i]) )); + CHANGED_BAG(RETLI); + } + return RETLI; +diff --git a/PolymakeInterface/src/polymake_fktn.cpp b/PolymakeInterface/src/polymake_fktn.cpp +index c8e6ad8b..6ed28e25 100644 +--- a/PolymakeInterface/src/polymake_fktn.cpp ++++ b/PolymakeInterface/src/polymake_fktn.cpp +@@ -120,12 +120,12 @@ Obj REAL_POLYMAKE_SKETCH_WITH_OPTIONS( Polymake_Data* data, Obj cone, Obj filena + #endif + perlobj* coneobj = PERLOBJ_POLYMAKEOBJ( cone ); + data->main_polymake_session->set_application_of(*coneobj); +- polymake::perl::OptionSet sketch_options; ++ pm::perl::OptionSet sketch_options; + if( IS_STRING( filename ) ){ + sketch_options["File"] << CSTR_STRING( filename ); + } + +- polymake::perl::OptionSet visual_options; ++ pm::perl::OptionSet visual_options; + if( IS_PLIST( options ) ){ + for( int i = 1; i <= LEN_PLIST( options ); i++ ){ + Obj current_option = ELM_PLIST( options, i ); +diff --git a/PolymakeInterface/src/polymake_fktn.h b/PolymakeInterface/src/polymake_fktn.h +index cabc6e12..e372c95e 100644 +--- a/PolymakeInterface/src/polymake_fktn.h ++++ b/PolymakeInterface/src/polymake_fktn.h +@@ -23,7 +23,7 @@ using std::pair; + // load the package. + + //static polymake::Main *main_polymake_session; +-//static polymake::perl::Scope *main_polymake_scope; ++//static pm::perl::Scope *main_polymake_scope; + //static map *polymake_objects; + //static int new_polymake_object_number; + +diff --git a/PolymakeInterface/src/polymake_main.cpp b/PolymakeInterface/src/polymake_main.cpp +index d4f45650..a114b932 100644 +--- a/PolymakeInterface/src/polymake_main.cpp ++++ b/PolymakeInterface/src/polymake_main.cpp +@@ -490,7 +490,7 @@ Obj FuncPOLYMAKE_RESET_WORKSPACE( Obj self ){ + + delete akt_data.main_polymake_session; + akt_data.main_polymake_session = new polymake::Main; +- akt_data.main_polymake_scope = new polymake::perl::Scope(akt_data.main_polymake_session->newScope()); ++ akt_data.main_polymake_scope = new pm::perl::Scope(akt_data.main_polymake_session->newScope()); + + return True; + +@@ -827,7 +827,7 @@ static Int InitLibrary ( StructInitInfo *module ) + // // We start with initialising the polymake classes. + // akt_data.initialized = false; + // // akt_data.main_polymake_session = new polymake::Main; +-// // akt_data.main_polymake_scope = new polymake::perl::Scope(akt_data.main_polymake_session->newScope()); ++// // akt_data.main_polymake_scope = new pm::perl::Scope(akt_data.main_polymake_session->newScope()); + // // akt_data.main_polymake_session->set_application("polytope"); + // // akt_data.main_polymake_session->set_custom("$Verbose::scheduler",1); + // //This is pretty slow. +diff --git a/PolymakeInterface/src/polymake_matroid.cpp b/PolymakeInterface/src/polymake_matroid.cpp +index 5a92c09e..98d91896 100644 +--- a/PolymakeInterface/src/polymake_matroid.cpp ++++ b/PolymakeInterface/src/polymake_matroid.cpp +@@ -30,17 +30,17 @@ Obj REAL_CREATE_MATROID_ABSTRACT( Polymake_Data* data, Obj size, Obj elements ){ + return NULL; + } + +- int matroid_size = INT_INTOBJ( size ); ++ Int matroid_size = INT_INTOBJ( size ); + + if( ! IS_PLIST( elements ) ){ + ErrorMayQuit( "second argument is not a plain list", 0, 0); + return NULL; + } + +- int nr_of_basis = LEN_PLIST( elements ); +- polymake::Array> incMatr(nr_of_basis); ++ Int nr_of_basis = LEN_PLIST( elements ); ++ polymake::Array> incMatr(nr_of_basis); + +- for( int current_basis=1;current_basis<=nr_of_basis;current_basis++){ ++ for( Int current_basis=1;current_basis<=nr_of_basis;current_basis++){ + + Obj current_basis_list = ELM_PLIST( elements, current_basis ); + +@@ -49,10 +49,10 @@ Obj REAL_CREATE_MATROID_ABSTRACT( Polymake_Data* data, Obj size, Obj elements ){ + return NULL; + } + +- int current_length = LEN_PLIST( current_basis_list ); ++ Int current_length = LEN_PLIST( current_basis_list ); + +- for( int i=1;i<=current_length;i++){ +- incMatr[current_basis] += static_cast(INT_INTOBJ( ELM_PLIST( current_basis_list, i ) ) - 1); ++ for( Int i=1;i<=current_length;i++){ ++ incMatr[current_basis] += static_cast(INT_INTOBJ( ELM_PLIST( current_basis_list, i ) ) - 1); + } + + } +diff --git a/PolymakeInterface/src/polymake_polytopes.cpp b/PolymakeInterface/src/polymake_polytopes.cpp +index b82f9819..e7553ae5 100644 +--- a/PolymakeInterface/src/polymake_polytopes.cpp ++++ b/PolymakeInterface/src/polymake_polytopes.cpp +@@ -11,7 +11,7 @@ Obj REAL_CREATE_POLYTOPE_BY_POINTS( Polymake_Data* data, Obj polytope ){ + } + #endif + +- int len = LEN_PLIST( polytope ); ++ Int len = LEN_PLIST( polytope ); + Obj akt = ELM_PLIST( polytope, 1 ); + Obj elem; + +@@ -22,7 +22,7 @@ Obj REAL_CREATE_POLYTOPE_BY_POINTS( Polymake_Data* data, Obj polytope ){ + } + #endif + +- int len_elem = LEN_PLIST( akt ); ++ Int len_elem = LEN_PLIST( akt ); + data->main_polymake_session->set_application("polytope"); + + polymake::Matrix matr(len,len_elem+1); +@@ -96,7 +96,7 @@ Obj REAL_VERTICES_OF_POLYTOPE( Polymake_Data* data, Obj polytope){ + LIZeil = NEW_PLIST( T_PLIST, matr.cols()-1); + SET_LEN_PLIST( LIZeil , matr_cols ); + for(int j = 1;j(matr(i,j)))); ++ SET_ELM_PLIST(LIZeil,j,INTOBJ_INT(static_cast(matr(i,j)))); + } + SET_ELM_PLIST(RETLI,k,LIZeil); + CHANGED_BAG(RETLI); +@@ -123,7 +123,7 @@ Obj REAL_LATTICE_POINTS_OF_POLYTOPE( Polymake_Data* data, Obj polytope){ + data->main_polymake_session->set_application_of(*polyobj); + polymake::Array> arr; + try{ +- arr = polyobj->give("LATTICE_POINTS_GENERATORS"); ++ polyobj->give("LATTICE_POINTS_GENERATORS") >> arr; + } + + POLYMAKE_GAP_CATCH +@@ -138,7 +138,7 @@ Obj REAL_LATTICE_POINTS_OF_POLYTOPE( Polymake_Data* data, Obj polytope){ + LIZeil = NEW_PLIST( T_PLIST, matr.cols()-1); + SET_LEN_PLIST( LIZeil , matr_cols ); + for(int j = 1;j(matr(i,j)))); ++ SET_ELM_PLIST(LIZeil,j,INTOBJ_INT(static_cast(matr(i,j)))); + } + SET_ELM_PLIST(RETLI,i+1,LIZeil); + CHANGED_BAG(RETLI); +@@ -242,7 +242,7 @@ Obj REAL_INTERIOR_LATTICE_POINTS( Polymake_Data* data, Obj polytope){ + LIZeil = NEW_PLIST( T_PLIST, matr.cols()-1); + SET_LEN_PLIST( LIZeil , matr_cols ); + for(int j = 1;j(matr(i,j)))); ++ SET_ELM_PLIST(LIZeil,j,INTOBJ_INT(static_cast(matr(i,j)))); + } + SET_ELM_PLIST(RETLI,i+1,LIZeil); + CHANGED_BAG(RETLI); +@@ -327,7 +327,7 @@ Obj REAL_TAIL_CONE_OF_POLYTOPE( Polymake_Data* data, Obj polytope){ + LIZeil = NEW_PLIST( T_PLIST, matr.cols()-1); + SET_LEN_PLIST( LIZeil , matr_cols ); + for(int j = 1;j(matr(i,j)) ) ); ++ SET_ELM_PLIST(LIZeil,j, INTOBJ_INT( static_cast(matr(i,j)) ) ); + } + SET_ELM_PLIST(RETLI,k,LIZeil); + CHANGED_BAG(RETLI); +@@ -413,7 +413,7 @@ Obj REAL_LATTICE_POINTS_GENERATORS( Polymake_Data* data, Obj polytope ){ + data->main_polymake_session->set_application_of(*polyobj); + polymake::Array> array; + try{ +- array = polyobj->give("LATTICE_POINTS_GENERATORS"); ++ polyobj->give("LATTICE_POINTS_GENERATORS") >> array; + } + + POLYMAKE_GAP_CATCH +diff --git a/PolymakeInterface/src/polymake_templates.h b/PolymakeInterface/src/polymake_templates.h +index 5acfb733..82445aa9 100644 +--- a/PolymakeInterface/src/polymake_templates.h ++++ b/PolymakeInterface/src/polymake_templates.h +@@ -18,7 +18,7 @@ using std::pair; + template + void POLYMAKE_RATIONAL_MATRIX_GAP_MATRIX( T* polymake_matrix, Obj gap_matrix ){ + +- int rows = LEN_PLIST( gap_matrix ); ++ Int rows = LEN_PLIST( gap_matrix ); + Obj current = ELM_PLIST( gap_matrix, 1 ); + Obj elem; + +@@ -29,7 +29,7 @@ void POLYMAKE_RATIONAL_MATRIX_GAP_MATRIX( T* polymake_matrix, Obj gap_matrix ){ + } + #endif + +- int columns = LEN_PLIST( current ); ++ Int columns = LEN_PLIST( current ); + + polymake_matrix->resize( rows, columns ); + +@@ -72,7 +72,7 @@ Obj GAP_MATRIX_POLYMAKE_INTEGER_MATRIX( T* polymake_matrix ){ + LIZeil = NEW_PLIST( T_PLIST, polymake_matrix->cols() ); + SET_LEN_PLIST( LIZeil ,matr_cols); + for(int j = 0;jcols();j++){ +- SET_ELM_PLIST(LIZeil,j+1,INTOBJ_INT(static_cast((*polymake_matrix)(i,j)))); ++ SET_ELM_PLIST(LIZeil,j+1,INTOBJ_INT(static_cast((*polymake_matrix)(i,j)))); + } + SET_ELM_PLIST(RETLI,i+1,LIZeil); + } +diff --git a/PolymakeInterface/src/polymake_tropical.cpp b/PolymakeInterface/src/polymake_tropical.cpp +index cf3134d0..3d26fc61 100644 +--- a/PolymakeInterface/src/polymake_tropical.cpp ++++ b/PolymakeInterface/src/polymake_tropical.cpp +@@ -11,7 +11,7 @@ Obj REAL_TROPICAL_HYPERSURFACE_BY_MONOMS_AND_COEFFICIENTS( Polymake_Data* data, + } + #endif + +- int len = LEN_PLIST( monomials ); ++ Int len = LEN_PLIST( monomials ); + Obj akt = ELM_PLIST( monomials, 1 ); + Obj elem; + +@@ -30,13 +30,13 @@ Obj REAL_TROPICAL_HYPERSURFACE_BY_MONOMS_AND_COEFFICIENTS( Polymake_Data* data, + #endif + + +- int len_elem = LEN_PLIST( akt ); ++ Int len_elem = LEN_PLIST( akt ); + data->main_polymake_session->set_application("tropical"); + +- polymake::Matrix matr(len, len_elem); +- polymake::Vector coeff(len); ++ polymake::Matrix matr(len, len_elem); ++ polymake::Vector coeff(len); + +- for(int i=1;i<=len;i++){ ++ for(Int i=1;i<=len;i++){ + akt = ELM_PLIST( monomials, i ); + #ifdef MORE_TESTS + if( !IS_PLIST( akt ) ){ +@@ -49,7 +49,7 @@ Obj REAL_TROPICAL_HYPERSURFACE_BY_MONOMS_AND_COEFFICIENTS( Polymake_Data* data, + } + #endif + +- for(int j = 1; j <= len_elem; j++){ ++ for(Int j = 1; j <= len_elem; j++){ + elem = ELM_PLIST( akt, j); + + #ifdef MORE_TESTS +@@ -94,7 +94,7 @@ Obj REAL_MONOMIALS_OF_HYPERSURFACE( Polymake_Data* data, Obj hypersurf){ + + perlobj* polyobj = PERLOBJ_POLYMAKEOBJ( hypersurf ); + data->main_polymake_session->set_application_of(*polyobj); +- polymake::Matrix matr; ++ polymake::Matrix matr; + try{ + polyobj->give("MONOMIALS") >> matr; + }