commit:     ead845b389330c68232ae12dc83719ea20698105
Author:     Alessandro Barbieri <lssndrbarbieri <AT> gmail <DOT> com>
AuthorDate: Sat Aug  7 23:37:23 2021 +0000
Commit:     Alessandro Barbieri <lssndrbarbieri <AT> gmail <DOT> com>
CommitDate: Sat Aug  7 23:38:57 2021 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=ead845b3

sci-mathematics/the-omega-project: initial import

Signed-off-by: Alessandro Barbieri <lssndrbarbieri <AT> gmail.com>

 sci-mathematics/the-omega-project/Manifest         |   1 +
 ...he-omega-project-include-Exit-h-in-util-h.patch |  10 ++
 ...emove-default-argument-of-friend-function.patch | 142 +++++++++++++++++++++
 ...emove-default-argument-of-friend-function.patch |  80 ++++++++++++
 .../files/the-omega-project-respect-flags.patch    |  45 +++++++
 sci-mathematics/the-omega-project/metadata.xml     |  25 ++++
 .../the-omega-project-2.1_p20131119.ebuild         |  70 ++++++++++
 7 files changed, 373 insertions(+)

diff --git a/sci-mathematics/the-omega-project/Manifest 
b/sci-mathematics/the-omega-project/Manifest
new file mode 100644
index 000000000..348a75343
--- /dev/null
+++ b/sci-mathematics/the-omega-project/Manifest
@@ -0,0 +1 @@
+DIST the-omega-project-2.1_p20131119.tar.gz 2448617 BLAKE2B 
2700354ff1dd23cf4169c1a894feb0b09c9ef064d12eb514faf8bed50b7e8eb2692326e398b57b6ea81d3e89f2181024e6c2f79de6009f1938710d86a16116b4
 SHA512 
c02a96206349ea44545acb685d7d54a2ec8b0553ace6907afc89924a1f33cf86aa00d3a84ed5265e18cc83b07b09c0e354139e72c8d0bd1a7b7314b3e95e0145

diff --git 
a/sci-mathematics/the-omega-project/files/the-omega-project-include-Exit-h-in-util-h.patch
 
b/sci-mathematics/the-omega-project/files/the-omega-project-include-Exit-h-in-util-h.patch
new file mode 100644
index 000000000..0421eacf8
--- /dev/null
+++ 
b/sci-mathematics/the-omega-project/files/the-omega-project-include-Exit-h-in-util-h.patch
@@ -0,0 +1,10 @@
+--- a/basic/include/basic/util.h
++++ b/basic/include/basic/util.h
+@@ -31,6 +31,7 @@
+ 
+ 
+ #include <basic/assert.h>
++#include <basic/Exit.h>
+ 
+ namespace omega {
+ 

diff --git 
a/sci-mathematics/the-omega-project/files/the-omega-project-petit-remove-default-argument-of-friend-function.patch
 
b/sci-mathematics/the-omega-project/files/the-omega-project-petit-remove-default-argument-of-friend-function.patch
new file mode 100644
index 000000000..7b2d693da
--- /dev/null
+++ 
b/sci-mathematics/the-omega-project/files/the-omega-project-petit-remove-default-argument-of-friend-function.patch
@@ -0,0 +1,142 @@
+--- a/petit/include/petit/Zima.h
++++ b/petit/include/petit/Zima.h
+@@ -67,13 +67,13 @@ public:
+ // If already_done != NULL, stop adding constraints when we get there
+ 
+     friend void access_in_bounds(F_And *N, const AccessIteration &AI,
+-                               context_iterator already_done = 0,
+-                               bool assertions = true);
++                               context_iterator already_done,
++                               bool assertions);
+ 
+     friend void context_in_bounds(F_And *N, const AccessIteration &AI,
+                                context_iterator c,
+-                               context_iterator already_done = 0,
+-                               bool assertions = true);
++                               context_iterator already_done,
++                               bool assertions);
+ 
+ //
+ // For A[I] and B[J] to access the same memory location,
+@@ -86,7 +86,7 @@ public:
+ //
+     friend void access_same_memory(F_And *N, const AccessIteration &AI,
+                                  const AccessIteration &BJ);
+-    
++
+     friend void subscripts_equal_to_tuple (F_And *N, const AccessIteration 
&AI,
+                                 const Variable_ID_Tuple *t);
+ 
+--- a/petit/src/add-assert.c
++++ b/petit/src/add-assert.c
+@@ -110,11 +110,11 @@ build_zap_problem(dd_current dd, Relation *r)
+ 
+     context_iterator c = cont_i_for_access(src.access());
+     while (!cont_i_done(c) && !cont_i_cur_is_loop(c)) cont_i_next(c);
+-    if (!cont_i_done(c)) context_in_bounds(le, src, c);
++    if (!cont_i_done(c)) context_in_bounds(le, src, c, 0, true);
+ 
+     c = cont_i_for_access(dest.access());
+     while (!cont_i_done(c) && !cont_i_cur_is_loop(c)) cont_i_next(c);
+-    if (!cont_i_done(c)) context_in_bounds(le, dest, c);
++    if (!cont_i_done(c)) context_in_bounds(le, dest, c, 0, true);
+ 
+     assert(copy(loops_execute).is_upper_bound_satisfiable());
+ 
+--- a/petit/src/browsedd.c
++++ b/petit/src/browsedd.c
+@@ -637,8 +637,8 @@ void write_deps(char *filename , char *inputfile,
+                                       
+                                       F_And *f = it.add_and();
+                                       
+-                                      access_in_bounds(f, a);
+-                                      access_in_bounds(f, b);
++                                      access_in_bounds(f, a, 0, true);
++                                      access_in_bounds(f, b, 0, true);
+                                       it.finalize();
+ 
+                                       it = Intersection(it,
+--- a/petit/src/build_stmt_rel.c
++++ b/petit/src/build_stmt_rel.c
+@@ -197,7 +197,7 @@ static Relation buildBoundsSet(int stmt)
+ 
+  F_And *f = it.add_and();
+ 
+- access_in_bounds(f, a1);
++ access_in_bounds(f, a1, 0, true);
+  it.finalize();
+  it.simplify(1,1); 
+  return it;
+@@ -218,8 +218,8 @@ static Relation getBoundsRelation(int stmt1, int stmt2)
+ 
+ // unify_symbolic_constants(f, a1, a2, 0);
+        
+- access_in_bounds(f, a1);
+- access_in_bounds(f, a2);
++ access_in_bounds(f, a1, 0, true);
++ access_in_bounds(f, a2, 0, true);
+  it.finalize();
+  it.simplify(1,1); 
+  return it;
+--- a/petit/src/ddomega.c
++++ b/petit/src/ddomega.c
+@@ -109,8 +109,8 @@ static Relation memory_dependence_relation(a_access 
access1, a_access access2)
+ 
+     F_And *f = it.add_and();
+ 
+-    access_in_bounds(f, a);
+-    access_in_bounds(f, b);
++    access_in_bounds(f, a, 0, true);
++    access_in_bounds(f, b, 0, true);
+     access_same_memory(f, a, b);
+     it.finalize();
+ 
+@@ -181,7 +181,7 @@ void dd_omega_test(a_access access1, a_access access2,
+         if (access1!=Entry) {
+            assert (access2 == ExitNode);
+          AccessIteration a(access1,simple_rel, Input_Tuple);
+-           access_in_bounds(f,a);
++           access_in_bounds(f,a,0,true);
+            subscripts_equal_to_tuple(f, a, &output_vars);
+            } 
+ 
+@@ -189,7 +189,7 @@ void dd_omega_test(a_access access1, a_access access2,
+         if (access2!=ExitNode) {
+            assert (access1 == Entry);
+            AccessIteration b(access2,simple_rel, Output_Tuple);
+-         access_in_bounds(f, b);
++         access_in_bounds(f, b, 0, true);
+            subscripts_equal_to_tuple(f, b, &input_vars);
+        }
+ 
+--- a/petit/src/hpp.c
++++ b/petit/src/hpp.c
+@@ -139,7 +139,7 @@ Relation get_is(node *n) {
+     Relation R(node_depth(a));
+     AccessIteration ai(a, &R, Input_Tuple);
+     F_And *f = R.add_and();
+-    access_in_bounds(f, ai);
++    access_in_bounds(f, ai, 0, true);
+     R.finalize();
+     return R;
+ }
+--- a/petit/src/kill.c
++++ b/petit/src/kill.c
+@@ -146,7 +146,7 @@ static Relation build_initial_exposed(a_access access1)
+ 
+   F_And *f = it.add_and();
+ 
+-  access_in_bounds(f,a);
++  access_in_bounds(f,a,0,true);
+   it.finalize();
+   return it;
+ 
+@@ -298,7 +298,7 @@ static change do_simple_kill(Relation &value_deps,
+                       already_done = access_inner_shared_context_at_depth(B, 
A, C, lzo);
+                       }
+ 
+-                  access_in_bounds(fkf, bj2, already_done);
++                  access_in_bounds(fkf, bj2, already_done, true);
+                   access_same_memory(fkf, bj2, ck);
+                   connected_by_diff(fkf, bj2, ck, killer_flow);
+                   kf.finalize();

diff --git 
a/sci-mathematics/the-omega-project/files/the-omega-project-remove-default-argument-of-friend-function.patch
 
b/sci-mathematics/the-omega-project/files/the-omega-project-remove-default-argument-of-friend-function.patch
new file mode 100644
index 000000000..1be1018e0
--- /dev/null
+++ 
b/sci-mathematics/the-omega-project/files/the-omega-project-remove-default-argument-of-friend-function.patch
@@ -0,0 +1,80 @@
+From b3db0dd1dc2e4b569e98d91a7909c274a2e3f3ad Mon Sep 17 00:00:00 2001
+From: Quoc-Sang Phan <[email protected]>
+Date: Wed, 30 Sep 2015 14:35:05 -0700
+Subject: [PATCH] remove default argument of friend function on Mac
+
+---
+ omega_lib/include/omega/pres_conj.h |  2 +-
+ omega_lib/src/pres_beaut.c          |  2 +-
+ omega_lib/src/pres_dnf.c            | 10 +++++-----
+ 3 files changed, 7 insertions(+), 7 deletions(-)
+
+--- a/omega_lib/include/omega/pres_conj.h
++++ b/omega_lib/include/omega/pres_conj.h
+@@ -263,7 +263,7 @@ class Conjunct : public F_Declaration {
+   friend int       simplify_conj(Conjunct* conj, int ver_sim, int elim_red, 
int color);
+   friend DNF*      negate_conj(Conjunct* conj);
+   friend Conjunct* merge_conjs(Conjunct* conj1, Conjunct* conj2,
+-                            Merge_Action action, Rel_Body *body = 0);
++                            Merge_Action action, Rel_Body *body);
+   friend void      copy_conj_header(Conjunct* to, Conjunct* fr);
+ 
+ 
+--- a/omega_lib/src/pres_beaut.c
++++ b/omega_lib/src/pres_beaut.c
+@@ -168,7 +168,7 @@ void F_And::beautify()
+               {
+               Conjunct *conj1 = merge_conjs(conj,
+                                            f->really_conjunct(),
+-                                           MERGE_REGULAR);
++                                           MERGE_REGULAR,0);
+               delete f;
+               delete conj;
+               conj = conj1;
+--- a/omega_lib/src/pres_dnf.c
++++ b/omega_lib/src/pres_dnf.c
+@@ -97,7 +97,7 @@ void DNF::rm_redundant_conjs(int effort) {
+            }
+         else {
+               
+-        Conjunct *cgist = merge_conjs(cdel, c, MERGE_GIST);
++        Conjunct *cgist = merge_conjs(cdel, c, MERGE_GIST, 0);
+ 
+         if (!cgist->redSimplifyProblem(effort,0)) {
+           if(pres_debug) {
+@@ -314,7 +314,7 @@ void DNF::clear()
+ DNF* DNF_and_conj(DNF* dnf, Conjunct* conj) {
+   DNF* new_dnf = new DNF;
+   for(DNF_Iterator p(dnf); p.live(); p.next()) {
+-    Conjunct* new_conj = merge_conjs(p.curr(), conj, MERGE_REGULAR);
++    Conjunct* new_conj = merge_conjs(p.curr(), conj, MERGE_REGULAR, 0);
+     new_dnf->add_conjunct(new_conj);
+   }
+   if(new_dnf->length() > 1) {
+@@ -364,7 +364,7 @@ DNF* conj_and_not_dnf(Conjunct *positive_conjunct, DNF 
*neg_conjs, bool weak) {
+       p.curr_set(NULL);
+       continue;
+       }
+-        Conjunct *cgist = merge_conjs(positive_conjunct, neg_conj, 
MERGE_GIST);
++        Conjunct *cgist = merge_conjs(positive_conjunct, neg_conj, 
MERGE_GIST, 0);
+           if(simplify_conj(cgist, false, true, _red) == false) 
+             {
+             delete cgist;
+@@ -389,7 +389,7 @@ DNF* conj_and_not_dnf(Conjunct *positive_conjunct, DNF 
*neg_conjs, bool weak) {
+                     delete cgist;
+                     Conjunct *conj =
+                     merge_conjs(positive_conjunct, 
neg_dnf->single_conjunct(), 
+-                                MERGE_REGULAR);
++                                MERGE_REGULAR, 0);
+                     delete positive_conjunct;
+                     delete neg_dnf;
+                     positive_conjunct = conj;
+@@ -795,7 +795,7 @@ DNF* F_And::DNFize()
+                       }
+                   else 
+                       {
+-                      Conjunct *new_conj = merge_conjs(positive_conjunct, 
conj, MERGE_REGULAR);
++                      Conjunct *new_conj = merge_conjs(positive_conjunct, 
conj, MERGE_REGULAR, 0);
+                       delete conj;
+                       delete positive_conjunct;
+                       positive_conjunct = new_conj;

diff --git 
a/sci-mathematics/the-omega-project/files/the-omega-project-respect-flags.patch 
b/sci-mathematics/the-omega-project/files/the-omega-project-respect-flags.patch
new file mode 100644
index 000000000..cf001299d
--- /dev/null
+++ 
b/sci-mathematics/the-omega-project/files/the-omega-project-respect-flags.patch
@@ -0,0 +1,45 @@
+--- a/Makefile.config
++++ b/Makefile.config
+@@ -21,11 +21,11 @@
+ # Compiler selection.
+ # Remove -g if your compiler doesn't support -O and -g together
+ # OPTIMIZATION_CFLAGS = -O2
+-OPTIMIZATION_CFLAGS = -g -O0
++OPTIMIZATION_CFLAGS = $(CXXFLAGS)
+ 
+ # g++  2.95 (tested w/ gcc version 2.95.2 19991024 (release) on SuSE linux 
6.4)
+-CC = g++
+-COMPILER_CFLAGS=-Wall -fPIC -DSIG_HANDLER_HAS_ONE_ARG=1 
-DSHUT_UP_ABOUT_STATEMENT_WITH_NO_EFFECT_IN_DYNAMIC_ARRAY_CREATION 
-DBATCH_ONLY_PETIT -DDAVEW_THESIS_REDUCTIONS -DSTUDY_KILL_USE 
-DPETIT_KILL_OBVIOUS
++CC = $(CXX)
++COMPILER_CFLAGS=-Wall -fPIC -DSIG_HANDLER_HAS_ONE_ARG=1 
-DSHUT_UP_ABOUT_STATEMENT_WITH_NO_EFFECT_IN_DYNAMIC_ARRAY_CREATION 
-DDAVEW_THESIS_REDUCTIONS -DSTUDY_KILL_USE -DPETIT_KILL_OBVIOUS
+ 
+ # ALSO USE THESE FLAGS FOR DOING TIMING AS IN DAVEW'S THESIS:
+ # -DSPEED -DNDEBUG -Ddont_verify_kills=1 -DDAVEW_THESIS_REDUCTIONS
+@@ -69,7 +69,6 @@
+ OS_INCL_PATH=
+ OS_LIB_PATH=
+ OS_LIBS=
+-RANLIB=ranlib
+ # SYSV style (Solaris 2.x, may work for others -- Solaris doesn't define SYSV)
+ #OS_CFLAGS=-DOMIT_GETRUSAGE -DSYSV -DSVR4 $(X11_LIB_PATH:-L%=-R%)
+ #OS_INCL_PATH=
+@@ -79,10 +78,9 @@
+ # end of OS selection
+ 
+ # Where things should be installed:
+-DESTDIR=/usr/local
+-INCL_DESTDIR=$(DESTDIR)/include/omega
+-LIB_DESTDIR=$(DESTDIR)/lib
+-BIN_DESTDIR=$(DESTDIR)/bin
++INCL_DESTDIR=$(DESTDIR)/usr/include/omega
++LIB_DESTDIR=$(DESTDIR)/usr/lib
++BIN_DESTDIR=$(DESTDIR)/usr/bin
+ 
+ # This is only used if you modify the grammar file.  Use bison if you have it.
+ RUMINANT=bison -y
+@@ -101,5 +99,3 @@
+ RM=/bin/rm
+ CP=/bin/cp
+ MAKEDEPEND=makedepend
+-AR=ar
+-

diff --git a/sci-mathematics/the-omega-project/metadata.xml 
b/sci-mathematics/the-omega-project/metadata.xml
new file mode 100644
index 000000000..218706bbf
--- /dev/null
+++ b/sci-mathematics/the-omega-project/metadata.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+  <maintainer type="person">
+    <email>[email protected]</email>
+    <name>Alessandro Barbieri</name>
+  </maintainer>
+  <longdescription lang="en">
+This is the Omega Project software, including:
+* The Omega library, a set of routines for manipulating linear constraints 
over integer variables, Presburger formulas, and Integer tuple relations and 
sets.
+* The code generation library, a set of routines for generating code to scan 
the points in the union of a number of convex sets.
+* The Omega calculator, a text-based interface to the Omega library
+* Petit, a educational/research tool for analyzing array data dependences
+* The Uniform library, a source to source parallelizing transformation system, 
described in Wayne Kelly's Ph.D. dissertation.
+Many new features have been added, and numerous bugs fixed, by a number of 
groups since the August 2000 version 1.2 
+from the cs.umd.edu web site. A quick check of the omega calculator regression 
tests 
+indicates that there is one difference in the generated code for a time-skewed 
example, 
+but this may just be an equivalent iteration space expressed in a different 
way.
+  </longdescription>
+  <use>
+    <flag name="gui">Build petit with gui</flag>
+    <flag name="htmldoc">Build html documentation</flag>
+    <flag name="petit">Build Petit, a educational/research tool for analyzing 
array data dependences</flag>
+  </use>
+</pkgmetadata>

diff --git 
a/sci-mathematics/the-omega-project/the-omega-project-2.1_p20131119.ebuild 
b/sci-mathematics/the-omega-project/the-omega-project-2.1_p20131119.ebuild
new file mode 100644
index 000000000..74b06ad51
--- /dev/null
+++ b/sci-mathematics/the-omega-project/the-omega-project-2.1_p20131119.ebuild
@@ -0,0 +1,70 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+COMMIT="2e2890cacc1fe6e25f11255aecda063717f71f5b"
+
+inherit flag-o-matic toolchain-funcs
+
+DESCRIPTION="Tools from Pugh et al.'s for constraint-based compiler tools"
+HOMEPAGE="https://github.com/davewathaverford/the-omega-project";
+SRC_URI="https://github.com/davewathaverford/the-omega-project/archive/${COMMIT}.tar.gz
 -> ${P}.tar.gz"
+S="${WORKDIR}/${PN}-${COMMIT}"
+
+LICENSE="BSD-2"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="debug htmldoc gui petit"
+
+DEPEND="
+       petit? (
+               gui? (
+                       x11-libs/motif
+               )
+       )
+"
+RDEPEND="${DEPEND}"
+BDEPEND="htmldoc? ( dev-tex/latex2html )"
+
+DOCS=(
+       omega_lib/doc/interface.dvi
+       omega_calc/doc/calculator.dvi
+       README
+)
+PATCHES=(
+       "${FILESDIR}/${PN}-respect-flags.patch"
+       "${FILESDIR}/${PN}-include-Exit-h-in-util-h.patch"
+       "${FILESDIR}/${PN}-remove-default-argument-of-friend-function.patch"
+       
"${FILESDIR}/${PN}-petit-remove-default-argument-of-friend-function.patch"
+)
+
+src_prepare() {
+       default
+       append-cxxflags '-DSTILL_CHECK_MULT=1'
+       use debug || append-cxxflags '-DNDEBUG'
+       use gui && append-cxxflags '-DBATCH_ONLY_PETIT'
+       tc-export CXX RANLIB
+       sed -e "s|/usr/lib|/usr/$(get_libdir)|g" -i Makefile.config || die
+}
+
+src_compile() {
+       emake depend
+       emake oc
+       use petit && emake petit
+
+       if use htmldoc; then
+               pushd omega_calc/doc || die
+               emake calculator.html
+               popd || die
+               HTML_DOCS+=( omega_calc/doc/calculator.html )
+       fi
+}
+
+src_install() {
+       mkdir -p "${D}/usr/include/omega" || die
+       DESTDIR="${D}" emake install
+       einstalldocs
+       docinto petit
+       use petit && dodoc -r petit/doc petit/*README
+}

Reply via email to