diff --git a/CMakeLists.txt b/CMakeLists.txt index 424e3f06cb010ed9090b0ff4a7850dbe81b28a8c..eed3c6494c930b7f7ee30c2407cadbc9b09ea840 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -53,7 +53,9 @@ endif() target_include_directories(_isl PRIVATE ${ISL_INC_DIRS}) -if(NOT USE_SHIPPED_ISL) +if(USE_SHIPPED_ISL) + target_compile_definitions(_isl PRIVATE GIT_HEAD_ID="${ISL_GIT_HEAD_ID}") +else() target_link_directories(_isl PRIVATE ${ISL_LIB_DIRS}) target_link_libraries(_isl PRIVATE ${ISL_LIB_NAMES}) endif() diff --git a/MANIFEST.in b/MANIFEST.in index c417490da24e8d54e6f9ceb816d270314d4585cb..676dbb1892a05289e3a9b96e230686571205ee87 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,3 +1,4 @@ +include isl/*.ac include isl/*.c include isl/*.h include isl/imath/*.c diff --git a/doc/reference.rst b/doc/reference.rst index 095ab0683e6909f4d47c45dc0360c1d4666968a8..6bec390e4f7804abf7cbbf030d4bba1acc2f15ee 100644 --- a/doc/reference.rst +++ b/doc/reference.rst @@ -69,6 +69,13 @@ Called with Argument Type as well as casts contained in the transitive closure of this 'casting graph'. +Version Info +------------ + +.. data:: version + +.. function:: isl_version + Error Reporting --------------- diff --git a/isl-supplementary/gitversion.h b/isl-supplementary/gitversion.h index 68fd9528089cd0fe03d1f034ea5a8b9184e903ab..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 --- a/isl-supplementary/gitversion.h +++ b/isl-supplementary/gitversion.h @@ -1 +0,0 @@ -#define GIT_HEAD_ID "isl-0.00-0-included-with-islpy" diff --git a/islpy/__init__.py b/islpy/__init__.py index 8208543ace313950c06e6bed273ae19c8d52337b..9f8dc9569701bef3352233af179d90915ade35d5 100644 --- a/islpy/__init__.py +++ b/islpy/__init__.py @@ -87,6 +87,8 @@ Error = _isl.Error # {{{ name imports +isl_version = _isl.isl_version + Context = _isl.Context IdList = _isl.IdList ValList = _isl.ValList diff --git a/setup.py b/setup.py index 148b2b65366cd82fb080591649e43c70c0c569a7..c54a796603538db43d90476feee6ebd7cf6bc1ad 100644 --- a/setup.py +++ b/setup.py @@ -221,6 +221,15 @@ def main(): cmake_args.append(f"-DISL_INC_DIRS:LIST={';'.join(isl_inc_dirs)}") cmake_args.append(f"-DISL_SOURCES:list={';'.join(extra_objects)}") + + with open("isl/configure.ac") as inf: + isl_version_line, = [ln for ln in inf + if ln.strip().startswith("versioninfo")] + + _, isl_version = isl_version_line.strip().split("=") + isl_version = isl_version.replace(":", ".") + + cmake_args.append(f"-DISL_GIT_HEAD_ID=isl-{isl_version}-included-with-islpy") else: if conf["ISL_INC_DIR"]: cmake_args.append(f"-DISL_INC_DIRS:LIST=" diff --git a/src/wrapper/wrap_isl.cpp b/src/wrapper/wrap_isl.cpp index a1962d557109bac8210a721e68c0ddeed1816fa3..13e1c2395a00212cf891aaef100bea707611d011 100644 --- a/src/wrapper/wrap_isl.cpp +++ b/src/wrapper/wrap_isl.cpp @@ -219,6 +219,8 @@ NB_MODULE(_isl, m) ADD_MACRO_ATTR(cls_schedule_algorithm, ISL_SCHEDULE_ALGORITHM_, ISL); ADD_MACRO_ATTR(cls_schedule_algorithm, ISL_SCHEDULE_ALGORITHM_, FEAUTRIER); + m.def("isl_version", [] () { return isl_version(); }); + islpy_expose_part1(m); islpy_expose_part2(m); islpy_expose_part3(m); diff --git a/src/wrapper/wrap_isl.hpp b/src/wrapper/wrap_isl.hpp index 4dc51f79db1a5d33f26a5962760cc19ee5cd4510..082560ee912b859e835d36169856ef15a76d0a58 100644 --- a/src/wrapper/wrap_isl.hpp +++ b/src/wrapper/wrap_isl.hpp @@ -23,6 +23,7 @@ #include #include #include +#include #ifdef ISLPY_INCLUDE_BARVINOK #include