diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000000000000000000000000000000000000..082cca8232a4539ad1276d212fd7abc76d7adda2 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,6 @@ +[submodule "isl"] + path = isl + url = git://repo.or.cz/isl.git +[submodule "bpl-subset"] + path = bpl-subset + url = git://github.com/inducer/bpl-subset diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000000000000000000000000000000000000..5c2eabbbf32122a9b19ba3c79a8c68afe5c8a942 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,23 @@ +include isl_list.h +include src/wrapper/*.h +include src/wrapper/*.hpp +include src/wrapper/*.cpp + +include gen_wrapper.py + +include test/*.py +include examples/*.py + +include doc/*.rst +include doc/images/*png +include doc/Makefile +include doc/conf.py + +include distribute_setup.py +include configure.py +include Makefile.in +include aksetup_helper.py +include README_SETUP.txt + +recursive-include bpl-subset/bpl_subset/boost *.h *.hpp *.cpp *.html *.inl *.ipp *.pl *.txt +recursive-include bpl-subset/bpl_subset/libs *.h *.hpp *.cpp *.html *.inl *.ipp *.pl *.txt diff --git a/bpl-subset b/bpl-subset new file mode 160000 index 0000000000000000000000000000000000000000..2fb979efcf2f38df3b37021e7a5d3fb8fb012b4f --- /dev/null +++ b/bpl-subset @@ -0,0 +1 @@ +Subproject commit 2fb979efcf2f38df3b37021e7a5d3fb8fb012b4f diff --git a/doc/misc.rst b/doc/misc.rst index fd6fdb9350cfa0543b505c3c1faef23d127a2f72..d9955cab44ad0b7ced62d9c80d65b1c773455a14 100644 --- a/doc/misc.rst +++ b/doc/misc.rst @@ -9,6 +9,16 @@ You may also clone its git repository:: git clone http://git.tiker.net/trees/islpy.git git clone git://github.com/inducer/islpy +Wiki, FAQ, Installation Instructions +==================================== + +A `wiki page `_ is also available, where install +instructions and an FAQ will grow over time. + +For a mailing list, please consider using the `isl list +`_ until they tell us to get +lost. + Licensing ========= diff --git a/isl b/isl new file mode 160000 index 0000000000000000000000000000000000000000..dcd4093537ca5e7b2c4997cc4c4c71f6429afedd --- /dev/null +++ b/isl @@ -0,0 +1 @@ +Subproject commit dcd4093537ca5e7b2c4997cc4c4c71f6429afedd diff --git a/isl-generated/gitversion.h b/isl-generated/gitversion.h new file mode 100644 index 0000000000000000000000000000000000000000..68fd9528089cd0fe03d1f034ea5a8b9184e903ab --- /dev/null +++ b/isl-generated/gitversion.h @@ -0,0 +1 @@ +#define GIT_HEAD_ID "isl-0.00-0-included-with-islpy" diff --git a/isl-generated/isl/config.h b/isl-generated/isl/config.h new file mode 100644 index 0000000000000000000000000000000000000000..8b137891791fe96927ad78e64b0aad7bded08bdc --- /dev/null +++ b/isl-generated/isl/config.h @@ -0,0 +1 @@ + diff --git a/isl-generated/isl/stdint.h b/isl-generated/isl/stdint.h new file mode 100644 index 0000000000000000000000000000000000000000..9a6118bd8590ca341a8a0addbd21d74e51e51a28 --- /dev/null +++ b/isl-generated/isl/stdint.h @@ -0,0 +1 @@ +#include diff --git a/isl-generated/isl_config.h b/isl-generated/isl_config.h new file mode 100644 index 0000000000000000000000000000000000000000..6750949900ebfdcb8b87fb3a866ece28c7391029 --- /dev/null +++ b/isl-generated/isl_config.h @@ -0,0 +1 @@ +#define HAVE_DECL_MP_GET_MEMORY_FUNCTIONS 1 diff --git a/setup.py b/setup.py index 34d8ae470179761b162f8cc087e1deb23530bc31..2d3cba660735bfc336f3dd628d17edd8e33e5f41 100644 --- a/setup.py +++ b/setup.py @@ -8,6 +8,13 @@ def get_config_schema(): return ConfigSchema(make_boost_base_options() + [ BoostLibraries("python"), + Switch("USE_SHIPPED_BOOST", True, "Use included Boost library"), + Switch("USE_SHIPPED_ISL", True, "Use included copy of isl"), + + IncludeDir("GMP", []), + LibraryDir("GMP", []), + Libraries("GMP", ["gmp"]), + IncludeDir("ISL", []), LibraryDir("ISL", []), Libraries("ISL", ["isl"]), @@ -22,16 +29,55 @@ def get_config_schema(): def main(): - from aksetup_helper import hack_distutils, \ - get_config, setup, Extension + from aksetup_helper import (hack_distutils, \ + get_config, setup, Extension, + set_up_shipped_boost_if_requested) hack_distutils(what_opt="s") conf = get_config(get_config_schema()) + EXTRA_OBJECTS, EXTRA_DEFINES = set_up_shipped_boost_if_requested("islpy", conf) + INCLUDE_DIRS = conf["BOOST_INC_DIR"] + ["src/wrapper"] LIBRARY_DIRS = conf["BOOST_LIB_DIR"] LIBRARIES = conf["BOOST_PYTHON_LIBNAME"] + if conf["USE_SHIPPED_ISL"]: + from glob import glob + ISL_BLACKLIST = ["_templ.c", "mp_get"] + + for fn in glob("isl/*.c"): + blacklisted = False + for bl in ISL_BLACKLIST: + if bl in fn: + blacklisted = True + break + + if "no_piplib" in fn: + pass + elif "piplib" in fn: + blacklisted = True + + inf = open(fn, "rt") + try: + contents = inf.read() + finally: + inf.close() + + if "int main(" not in contents and not blacklisted: + EXTRA_OBJECTS.append(fn) + + conf["ISL_INC_DIR"] = ["isl/include", "isl-generated", "isl"] + else: + LIBRARY_DIRS.extend(conf["ISL_LIB_DIR"]) + LIBRARIES.extend(conf["ISL_LIBNAME"]) + + INCLUDE_DIRS.extend(conf["ISL_INC_DIR"]) + + INCLUDE_DIRS.extend(conf["GMP_INC_DIR"]) + LIBRARY_DIRS.extend(conf["GMP_LIB_DIR"]) + LIBRARIES.extend(conf["GMP_LIBNAME"]) + init_filename = "islpy/version.py" exec(compile(open(init_filename, "r").read(), init_filename, "exec"), conf) @@ -47,10 +93,37 @@ def main(): setup(name="islpy", version=conf["VERSION_TEXT"], description="Wrapper around isl, an integer set library", + long_description=""" + islpy is a Python wrapper around Sven Verdoolaege's `isl + `_, a library for manipulating sets and + relations of integer points bounded by linear constraints. + + Supported operations on sets include + + * intersection, union, set difference, + * emptiness check, + * convex hull, + * (integer) affine hull, + * integer projection, + * computing the lexicographic minimum using parametric integer programming, + * coalescing, and + * parametric vertex enumeration. + + It also includes an ILP solver based on generalized basis reduction, transitive + closures on maps (which may encode infinite graphs), dependence analysis and + bounds on piecewise step-polynomials. + + Islpy comes with comprehensive `documentation `_. + + *Requirements:* Only the `GNU Multiprecision Library `_ + and its Python wrapper `gmpy `_ (Version 1.x) + are required. A version of isl is shipped with islpy, but optionally + a system-wide one may also be used. + """, author="Andreas Kloeckner", author_email="inform@tiker.net", license = "MIT for the wrapper/LGPL for isl", - url="http://pypi.python.org/pypi/islpy", + url="http://documen.tician.de/islpy", classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', @@ -74,16 +147,17 @@ def main(): install_requires=[ "pytest>=2", + "gmpy>=1,<2", # "Mako>=0.3.6", ], ext_modules = [ Extension( "islpy._isl", - ["src/wrapper/wrap_isl.cpp"], - include_dirs=INCLUDE_DIRS + conf["ISL_INC_DIR"], - library_dirs=LIBRARY_DIRS + conf["ISL_LIB_DIR"], - libraries=LIBRARIES + conf["ISL_LIBNAME"], - #define_macros=[('BOOST_PYTHON_NO_PY_SIGNATURES', '1')], + EXTRA_OBJECTS + ["src/wrapper/wrap_isl.cpp"], + include_dirs=INCLUDE_DIRS, + library_dirs=LIBRARY_DIRS, + libraries=LIBRARIES, + define_macros=list(EXTRA_DEFINES.items()), extra_compile_args=conf["CXXFLAGS"], extra_link_args=conf["LDFLAGS"], ),