Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • inducer/islpy
  • isuruf/islpy
  • kaushikcfd/islpy
  • mattwala/islpy
4 results
Show changes
Commits on Source (521)
Showing
with 1001 additions and 206 deletions
# https://editorconfig.org/
# https://github.com/editorconfig/editorconfig-vim
# https://github.com/editorconfig/editorconfig-emacs
root = true
[*]
indent_style = space
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.py]
indent_size = 4
[*.rst]
indent_size = 4
[*.cpp]
indent_size = 2
[*.hpp]
indent_size = 2
# There may be one in doc/
[Makefile]
indent_style = tab
# https://github.com/microsoft/vscode/issues/1679
[*.md]
trim_trailing_whitespace = false
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Environment (please complete the following information):**
- OS: [e.g. Linux]
- Python version: [e.g. 3.10]
**Additional context**
Add any other context about the problem here.
blank_issues_enabled: true
contact_links:
- name: ❓ Question
url: https://github.com/inducer/islpy/discussions/categories/q-a
about: Ask and answer questions about islpy on Discussions
- name: 🔧 Troubleshooting
url: https://github.com/inducer/islpy/discussions/categories/troubleshooting
about: For troubleshooting help, see the Discussions
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.
version: 2
updates:
# Set update schedule for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
# vim: sw=4
name: Gitlab mirror
on:
push:
branches:
- main
jobs:
autopush:
name: Automatic push to gitlab.tiker.net
if: startsWith(github.repository, 'inducer/')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
curl -L -O https://tiker.net/ci-support-v0
. ./ci-support-v0
mirror_github_to_gitlab
env:
GITLAB_AUTOPUSH_KEY: ${{ secrets.GITLAB_AUTOPUSH_KEY }}
# vim: sw=4
name: CI
on:
push:
branches:
- main
pull_request:
schedule:
- cron: '17 3 * * 0'
jobs:
ruff:
name: Ruff
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- name: "Main Script"
run: |
pipx install ruff
ruff check
pytest:
name: Pytest Linux on Py${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.10', '3.x']
steps:
- uses: actions/checkout@v4
-
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: "Main Script"
run: |
EXTRA_INSTALL="numpy"
curl -L -O https://gitlab.tiker.net/inducer/ci-support/raw/main/build-and-test-py-project.sh
. ./build-and-test-py-project.sh
examples:
name: Examples Linux on Py${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.10', '3.x']
steps:
- uses: actions/checkout@v4
-
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: "Main Script"
run: |
EXTRA_INSTALL="matplotlib numpy"
curl -L -O https://tiker.net/ci-support-v0
. ./ci-support-v0
build_py_project_in_venv
run_examples
pytest_mac:
name: Pytest macOS
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
-
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: "Main Script"
run: |
export MACOS_DEPLOYMENT_TARGET=10.14
curl -L -O https://gitlab.tiker.net/inducer/ci-support/raw/main/build-and-test-py-project.sh
. ./build-and-test-py-project.sh
docs:
name: Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
-
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: "Main Script"
run: |
curl -L -O https://tiker.net/ci-support-v0
. ./ci-support-v0
build_py_project_in_venv
# https://github.com/sphinx-doc/sphinx/issues/9200
CI_SUPPORT_SPHINX_VERSION_SPECIFIER="!=4.0.0"
build_docs
downstream_tests:
strategy:
matrix:
downstream_project: [loopy]
name: Tests for downstream project ${{ matrix.downstream_project }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: "Main Script"
env:
DOWNSTREAM_PROJECT: ${{ matrix.downstream_project }}
run: |
curl -L -O https://tiker.net/ci-support-v0
. ./ci-support-v0
git clone "https://github.com/inducer/$DOWNSTREAM_PROJECT.git"
cd "$DOWNSTREAM_PROJECT"
echo "*** $DOWNSTREAM_PROJECT version: $(git rev-parse --short HEAD)"
edit_requirements_txt_for_downstream_in_subdir
sed -i '/islpy/ d' .test-conda-env-py3.yml
export CONDA_ENVIRONMENT=.test-conda-env-py3.yml
# Avoid slow or complicated tests in downstream projects
export PYTEST_ADDOPTS="-k 'not (slowtest or octave or mpi)'"
build_py_project_in_conda_env
test_py_project
barvinok:
name: "Test barvinok build script"
runs-on: ubuntu-latest
env:
GITHUB_HEAD_REPOSITORY: ${{github.event.pull_request.head.repo.full_name}}
steps:
- uses: actions/checkout@v4
-
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: "Main Script"
run: |
python3 -m venv .env
source .env/bin/activate
python -m ensurepip
pip install pcpp pytest numpy
./build-with-barvinok.sh "$HOME/barvinok-build"
(cd test; LD_LIBRARY_PATH="$HOME/barvinok-build/lib" python -m pytest --tb=native -rxsw)
# vim: sw=4
name: Build wheels
on:
push:
branches:
- main
tags:
- v*
pull_request:
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-13, macos-14]
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
persist-credentials: false
- name: Build wheels
uses: pypa/cibuildwheel@v2.23.1
# (here: set these in pyproject.toml to the extent possible)
# env:
# CIBW_SOME_OPTION: value
# CIBW_BUILD_VERBOSITY: 1
# VERBOSE: 1
- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Build sdist
run: |
pipx --version
pipx run build --sdist
- uses: actions/upload-artifact@v4
with:
name: cibw-sdist
path: dist/*.tar.gz
upload_pypi:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
# upload to PyPI on every tag starting with 'v'
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
# alternatively, to publish when a GitHub Release is created, use the following rule:
# if: github.event_name == 'release' && github.event.action == 'published'
environment:
name: pypi
url: https://pypi.org/p/islpy
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
steps:
- uses: actions/download-artifact@v4
with:
pattern: cibw-*
path: dist
merge-multiple: true
- uses: pypa/gh-action-pypi-publish@v1.12.4
# with:
# user: __token__
# password: ${{ secrets.pypi_password }}
# To test: repository_url: https://test.pypi.org/legacy/
upload_testpypi:
if: startsWith(github.ref, 'refs/tags/testv')
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
environment:
name: testpypi
url: https://test.pypi.org/p/islpy
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
pattern: cibw-*
path: dist/
merge-multiple: true
- name: Publish distribution 📦 to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
......@@ -48,8 +48,18 @@ setuptools-*.tar.gz
core
src/wrapper/gen-*
.dirty-git-ok
wrapped-functions.h
_isl_cffi.c
_isl.py
name_list.py
islpy_cffi_build.py
# wheels
arch_tmp
archives
downloads
gmp-*
isl-*
wheelhouse
venv
_skbuild/
libnanobind-static.a
CMakeFiles/
preproc-headers
Python 2.7:
script:
- export PY_EXE=python2.7
- curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/build-and-test-py-project.sh
- ". ./build-and-test-py-project.sh"
Python 3:
script: |
EXTRA_INSTALL="numpy"
curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/main/build-and-test-py-project.sh
. ./build-and-test-py-project.sh
tags:
- python2.7
- python3
except:
- tags
Python 3.4:
script:
- export PY_EXE=python3.4
- curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/build-and-test-py-project.sh
- ". ./build-and-test-py-project.sh"
artifacts:
reports:
junit: test/pytest.xml
Examples:
script: |
EXTRA_INSTALL="matplotlib numpy"
curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/main/ci-support.sh
. ./ci-support.sh
build_py_project_in_venv
run_examples
tags:
- python3.4
- python3
except:
- tags
Python 2.6:
script:
- export PY_EXE=python2.6
- curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/build-and-test-py-project.sh
- ". ./build-and-test-py-project.sh"
Python 3 without small-integer opt:
script: |
curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/main/build-and-test-py-project.sh
./configure.py --no-use-imath-sio
. ./build-and-test-py-project.sh
tags:
- python3
except:
- tags
artifacts:
reports:
junit: test/pytest.xml
Python 3 + Barvinok:
script: |
git clean -fdx
python3 -m venv .env
source .env/bin/activate
python -m ensurepip
pip install pcpp numpy pytest
./build-with-barvinok.sh "$HOME/barvinok-build"
(cd test; LD_LIBRARY_PATH="$HOME/barvinok-build/lib" python -m pytest --tb=native -rxsw)
tags:
- python2.6
- python3
except:
- tags
PyPy:
artifacts:
reports:
junit: test/pytest.xml
PyPy3:
script:
- export PY_EXE=pypy
- curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/build-and-test-py-project.sh
- export PY_EXE=pypy3
- curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/main/build-and-test-py-project.sh
- ". ./build-and-test-py-project.sh"
allow_failure: true
tags:
- pypy
except:
- tags
artifacts:
reports:
junit: test/pytest.xml
Documentation:
script: |
curl -L -O -k https://tiker.net/ci-support-v0
. ci-support-v0
build_py_project_in_venv
build_docs
maybe_upload_docs
tags:
- python3
only:
- main
Ruff:
script:
- pipx install ruff
- ruff check
tags:
- docker-runner
except:
- tags
[submodule "isl"]
path = isl
url = http://repo.or.cz/isl.git
url = https://github.com/inducer/isl.git
cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "Kloeckner"
given-names: "Andreas"
orcid: "https://orcid.org/0000-0003-1228-519X"
- family-names: "Fernando"
given-names: "Isuru"
- family-names: "Yang"
given-names: "Cambridge"
- family-names: "Kulkarni"
given-names: "Kaushik"
# Disabled pending https://github.com/zenodo/zenodo/issues/2343
# - alias: "iasakura"
- family-names: "Almahallawi"
given-names: "Deyaaeldeen"
- family-names: "Gao"
given-names: "Hao"
- family-names: "Stevens"
given-names: "James"
- family-names: "Fikl"
given-names: "Alex"
- family-names: "Wala"
given-names: "Matt"
# Disabled pending https://github.com/zenodo/zenodo/issues/2343
# - alias: "bhuztez"
title: "islpy"
version: 2022.1.2
doi: 10.5281/zenodo.6345184
date-released: 2022-03-10
url: "https://github.com/inducer/islpy"
license: MIT
cmake_minimum_required(VERSION 3.15...3.27)
project(islpy)
find_package(Python 3.8 COMPONENTS Interpreter Development.Module REQUIRED)
# Force Release build by default
if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif()
# Detect the installed nanobind package and import it into CMake
execute_process(
COMMAND "${Python_EXECUTABLE}" -m nanobind --cmake_dir
OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE NB_DIR)
list(APPEND CMAKE_PREFIX_PATH "${NB_DIR}")
find_package(nanobind CONFIG REQUIRED)
nanobind_add_module(
_isl
NB_STATIC # Build static libnanobind (the extension module itself remains a shared library)
NOMINSIZE # Optimize for speed, not for size
LTO # Enable LTO
src/wrapper/wrap_isl.cpp
src/wrapper/wrap_isl_part1.cpp
src/wrapper/wrap_isl_part2.cpp
src/wrapper/wrap_isl_part3.cpp
${ISL_SOURCES}
)
# Work around https://github.com/inducer/islpy/issues/120.
# See https://stackoverflow.com/questions/43554227/extern-inline-func-results-in-undefined-reference-error
# for some context.
set_source_files_properties(${ISL_SOURCES} PROPERTIES COMPILE_DEFINITIONS __OPTIMIZE_SIZE__)
if(USE_IMATH_FOR_MP)
target_compile_definitions(_isl PRIVATE USE_IMATH_FOR_MP=1)
endif()
if(USE_IMATH_SIO)
target_compile_definitions(_isl PRIVATE USE_SMALL_INT_OPT=1)
endif()
if(USE_GMP_FOR_MP)
target_compile_definitions(_isl PRIVATE USE_GMP_FOR_MP=1)
endif()
if(USE_BARVINOK)
target_compile_definitions(_isl PRIVATE ISLPY_INCLUDE_BARVINOK=1)
target_include_directories(_isl PRIVATE ${BARVINOK_INC_DIRS})
target_link_directories(_isl PRIVATE ${BARVINOK_LIB_DIRS})
target_link_libraries(_isl PRIVATE ${BARVINOK_LIB_NAMES})
endif()
target_include_directories(_isl PRIVATE ${ISL_INC_DIRS})
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()
install(TARGETS _isl LIBRARY DESTINATION .)
# vim: sw=2
include isl/*.ac
include isl/*.c
include isl/*.h
include isl/imath/*.c
include isl/imath/*.h
include isl/imath_wrap/*.h
include isl/imath_wrap/*.c
include isl/include/isl/*.h
include isl/include/isl/*.c
include isl/include/isl/deprecated/*.h
include isl-supplementary/isl/*.h
include isl-supplementary/*.h
include isl_declaration_macros_expanded*.h
include build-with-barvinok.sh
include src/wrapper/*.h
include src/wrapper/*.hpp
include src/wrapper/*.cpp
include gen_wrap.py
include py_codegen.py
include test/*.py
include example/*.py
include examples/*.py
include doc/*.rst
include doc/images/*png
......@@ -30,5 +33,11 @@ include configure.py
include Makefile.in
include aksetup_helper.py
include README_SETUP.txt
include CMakeLists.txt
include README.rst
include CITATION.cff
include isl/LICENSE
include isl/imath/LICENSE
recursive-exclude preproc-headers *
.. image:: https://badge.fury.io/py/islpy.png
:target: http://pypi.python.org/pypi/islpy
islpy: Polyhedral Analysis from Python
======================================
.. image:: https://gitlab.tiker.net/inducer/islpy/badges/main/pipeline.svg
:alt: Gitlab Build Status
:target: https://gitlab.tiker.net/inducer/islpy/commits/main
.. image:: https://github.com/inducer/islpy/workflows/CI/badge.svg?branch=main
:alt: Github Build Status
:target: https://github.com/inducer/islpy/actions?query=branch%3Amain+workflow%3ACI
.. image:: https://badge.fury.io/py/islpy.svg
:alt: Python Package Index Release Page
:target: https://pypi.org/project/islpy/
.. image:: https://zenodo.org/badge/2021524.svg
:alt: Zenodo DOI for latest release
:target: https://zenodo.org/badge/latestdoi/2021524
islpy is a Python wrapper around Sven Verdoolaege's `isl
<http://www.kotnet.org/~skimo/isl/>`_, a library for manipulating sets and
<https://libisl.sourceforge.io/>`_, a library for manipulating sets and
relations of integer points bounded by linear constraints.
Supported operations on sets include
......@@ -22,6 +35,12 @@ bounds on piecewise step-polynomials.
Islpy comes with comprehensive `documentation <http://documen.tician.de/islpy>`_.
*Requirements:* islpy needs a C++ compiler to build. GMP, which used to be
a dependency, is no longer required.
*Requirements:* islpy needs a C++ compiler to build. It can optionally make use
of GMP for support of large integers.
One important thing to know about islpy is that it exposes every function in isl
that is visible in the headers, not just what isl's authors consider its
documented, public API (marked by ``__isl_export``). These (technically)
undocumented functions are marked in the islpy documentation. Many of them are useful
and essential for certain operations, but isl's API stability guarantees do not
apply to them. Use them at your own risk.
This diff is collapsed.
#! /bin/bash
set -e
set -x
BUILD_DIR=$(mktemp -d -t islpy-barvinok-build-XXXXXXX)
echo "BUILDING IN $BUILD_DIR"
if test "$1" = ""; then
echo "usage: $0 PREFIX_DIR [GMP_PREFIX_DIR]"
fi
PREFIX="$1"
GMP_PREFIX="${2:-$PREFIX}"
NTL_VER="10.5.0"
BARVINOK_GIT_REV="barvinok-0.41.8"
NPROCS=6
function with_echo()
{
echo "$@"
"$@"
}
if true; then
rm -Rf "$BUILD_DIR"
mkdir "$BUILD_DIR"
cd "$BUILD_DIR"
rm -Rf islpy
if test "$GITHUB_HEAD_REF" != "" && test "$GITHUB_HEAD_REPOSITORY" != ""; then
with_echo git clone --recursive https://github.com/$GITHUB_HEAD_REPOSITORY.git -b "$GITHUB_HEAD_REF"
elif test "$CI_SERVER_NAME" = "GitLab" && test "$CI_COMMIT_REF_NAME" != ""; then
with_echo git clone --recursive https://gitlab.tiker.net/inducer/islpy.git -b "$CI_COMMIT_REF_NAME"
else
with_echo git clone --recursive https://github.com/inducer/islpy.git
fi
curl -L -O --insecure http://shoup.net/ntl/ntl-"$NTL_VER".tar.gz
tar xfz ntl-"$NTL_VER".tar.gz
cd "$BUILD_DIR/ntl-$NTL_VER/src"
./configure NTL_GMP_LIP=on DEF_PREFIX="$PREFIX" GMP_PREFIX="$GMP_PREFIX" TUNE=x86 SHARED=on
make -j$NPROCS
make install
cd "$BUILD_DIR"
rm -Rf barvinok
git clone https://github.com/inducer/barvinok.git
cd barvinok
git checkout $BARVINOK_GIT_REV
numtries=1
while ! ./get_submodules.sh; do
sleep 5
numtries=$((numtries+1))
if test "$numtries" == 5; then
echo "*** getting barvinok submodules failed even after a few tries"
exit 1
fi
done
sh autogen.sh
./configure \
--prefix="$PREFIX" \
--with-ntl-prefix="$PREFIX" \
--with-gmp-prefix="$GMP_PREFIX" \
--enable-shared-barvinok \
--with-pet=no
BARVINOK_ADDITIONAL_MAKE_ARGS=""
if [ "$(uname)" == "Darwin" ]; then
BARVINOK_ADDITIONAL_MAKE_ARGS=CFLAGS="-Wno-error=implicit-function-declaration"
fi
make $BARVINOK_ADDITIONAL_MAKE_ARGS -j$NPROCS
make install
fi
cd "$BUILD_DIR"
cd islpy
./configure.py \
--no-use-shipped-isl \
--no-use-shipped-imath \
--isl-inc-dir=$PREFIX/include \
--isl-lib-dir=$PREFIX/lib \
--use-barvinok
python -m pip install .
# vim: sw=2
#! /usr/bin/env python
#! /usr/bin/env python3
from aksetup_helper import configure_frontend
configure_frontend()
pre {
line-height: 110%;
}
.footer {
background-color: #eee;
}
body > div.container {
margin-top:10px;
}
dd {
margin-left: 40px;
}
tt.descname {
font-size: 100%;
}
code {
color: rgb(51,51,51);
}
h1 {
padding-bottom:7px;
border-bottom: 1px solid #ccc;
}
h2 {
padding-bottom:5px;
border-bottom: 1px solid #ccc;
}
h3 {
padding-bottom:5px;
border-bottom: 1px solid #ccc;
}
.rubric {
font-size: 120%;
padding-bottom:1px;
border-bottom: 1px solid #ccc;
}
.headerlink {
padding-left: 1ex;
padding-right: 1ex;
}
a.headerlink:hover {
text-decoration: none;
}
blockquote p {
font-size: 100%;
font-weight: normal;
line-height: normal;
};
{% extends "!layout.html" %}
{% set bootswatch_css_custom = ['_static/akdoc.css']%}