Gecode 5.0.0

This commit is contained in:
Vitor Santos Costa
2016-12-10 03:09:59 -06:00
parent 45a54e2b04
commit 82ad65a344
17 changed files with 18711 additions and 3424 deletions

View File

@@ -0,0 +1,5 @@
all:
python code-generator.py
clean:
-rm -f *~ *.pyc

20
packages/gecode/dev/code-generator.py Normal file → Executable file
View File

@@ -6,12 +6,12 @@
# the terms of the GNU General Public License as published by the Free Software
# Foundation, either version 3 of the License, or (at your option) any later
# version.
#
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
# details.
#
#
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>.
#==============================================================================
@@ -26,12 +26,12 @@ NOTICE_CC = """// -*- c++ -*-
// under the terms of the GNU Lesser General Public License as published by the
// Free Software Foundation, either version 3 of the License, or (at your
// option) any later version.
//
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// more details.
//
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//=============================================================================
@@ -45,12 +45,12 @@ NOTICE_PROLOG="""%% -*- prolog -*-
%% under the terms of the GNU Lesser General Public License as published by the
%% Free Software Foundation, either version 3 of the License, or (at your
%% option) any later version.
%%
%%
%% This program is distributed in the hope that it will be useful, but WITHOUT
%% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
%% FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
%% more details.
%%
%%
%% You should have received a copy of the GNU Lesser General Public License
%% along with this program. If not, see <http://www.gnu.org/licenses/>.
%%=============================================================================
@@ -120,7 +120,7 @@ class Type(object):
def clone(self):
return type(self)(self)
class Constraint(object):
@@ -165,7 +165,7 @@ class Constraint(object):
def clone(self):
return type(self)(self)
COMMENT = re.compile("""^\\s*//.*$""")
@@ -598,7 +598,7 @@ class YAPEnumProlog(object):
print
class YAPEnumPrologGenerator(object):
def generate(self):
for c in enum_classes():
class C(c,YAPEnumProlog): pass
@@ -677,7 +677,7 @@ def gecode_version():
os.remove(file_hh)
os.remove(file_txt)
else:
version = "4.4.0"
version = "5.0.0"
GECODE_VERSION = version
return version

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,38 @@
GECODEDIR := $(shell g++ $(CPPFLAGS) $(CXXFLAGS) -H -E gecodedir.hh 2>&1 >/dev/null | grep gecode/kernel.hh | awk '{print $$2}' | sed 's|/kernel.hh||')
GECODEDIR=/usr/local/opt/gecode
GECODECONFIG := $(GECODEDIR)/support/config.hpp
GECODEVERSION := $(shell cat $(GECODECONFIG) | egrep '\<GECODE_VERSION\>' | awk '{print $$3}' | sed 's/"//g')
GECODEVERSION="5.0.0"
PROTOTYPES = ../gecode-prototypes-$(GECODEVERSION).hh
ENUMS = ../gecode-enums-$(GECODEVERSION).py
all: $(PROTOTYPES) $(ENUMS)
$(PROTOTYPES): % : xml/namespaceGecode.xml extract-prototypes.xsl
cat notice.hh > $@ || { rm -f $@; exit 1; }
xsltproc extract-prototypes.xsl $< \
| grep EXPORT \
| grep -v Symmetry \
| sed 's/Gecode:://g' \
| sed 's/< /</g' \
| sed 's/ >/>/g' \
| sed 's/ \&/\&/g' \
| sed 's/, /,/g' \
| sed 's/forceinline //g' \
| sed 's/GECODE_INT_EXPORT //g' \
| sed 's/GECODE_FLOAT_EXPORT //g' \
| sed 's/GECODE_SET_EXPORT //g' \
| grep -v '*' | sort >> $@ || { rm -f $@; exit 1; }
$(ENUMS): % : xml/namespaceGecode.xml extract-enums.xsl
cat notice.py > $@ || { rm -f $@; exit 1; }
xsltproc extract-enums.xsl $< >> $@ || { rm -f $@; exit 1; }
xml/namespaceGecode.xml: Doxyfile
doxygen Doxyfile
Doxyfile: Doxyfile.in
cat $< | sed "s#@GECODEDIR@#$(GECODEDIR)#" > $@ || { rm -f $@; exit 1; }
clean:
-rm -rf *~ gecode-prototypes-*.hh gecode-enums-*.py Doxyfile xml

File diff suppressed because it is too large Load Diff