Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install kllvm when K is installed #2873

Merged
merged 12 commits into from
Sep 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions k-distribution/src/main/assembly/bin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@
<directory>${project.basedir}/../llvm-backend/src/main/native/llvm-backend/cmake</directory>
<outputDirectory>/lib/cmake/kframework</outputDirectory>
</fileSet>
<fileSet>
<directory>${project.basedir}/../llvm-backend/target/build/install/bindings</directory>
<outputDirectory>/bindings</outputDirectory>
</fileSet>
<fileSet>
<directory>${project.basedir}/../haskell-backend/src/main/native/haskell-backend/src/main/kore</directory>
<outputDirectory>/include/kframework/kore</outputDirectory>
Expand Down
1 change: 1 addition & 0 deletions package/arch/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ RUN pacman -Sy --noconfirm archlinux-keyring \
mpfr \
openssh \
python \
python-pip \
stack \
z3 \
zlib
Expand Down
1 change: 1 addition & 0 deletions package/debian/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ RUN apt-get update \
python3 \
python3-dev \
python3-distutils \
python3-pip \
zlib1g-dev

RUN curl -sSL https://get.haskellstack.org/ | sh
Expand Down
2 changes: 1 addition & 1 deletion package/debian/control.focal
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Source: kframework
Section: devel
Priority: optional
Maintainer: Dwight Guth <dwight.guth@runtimeverification.com>
Build-Depends: clang-12 , cmake , debhelper (>=9) , flex , libboost-test-dev , libgmp-dev , libjemalloc-dev , libmpfr-dev , libyaml-dev , maven , openjdk-11-jdk , python3 , python3-dev , python3-distutils , zlib1g-dev
Build-Depends: clang-12 , cmake , debhelper (>=9) , flex , libboost-test-dev , libgmp-dev , libjemalloc-dev , libmpfr-dev , libyaml-dev , maven , openjdk-11-jdk , python3 , python3-dev , python3-distutils , python3-pip , zlib1g-dev
Standards-Version: 3.9.6
Homepage: https://github.com/runtimeverification/k

Expand Down
2 changes: 1 addition & 1 deletion package/debian/control.jammy
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Source: kframework
Section: devel
Priority: optional
Maintainer: Dwight Guth <dwight.guth@runtimeverification.com>
Build-Depends: clang-14 , cmake , debhelper (>=10) , flex , libboost-test-dev , libgmp-dev , libjemalloc-dev , libmpfr-dev , libyaml-dev , maven , openjdk-11-jdk , pkg-config , python3 , python3-dev , python3-distutils , zlib1g-dev
Build-Depends: clang-14 , cmake , debhelper (>=10) , flex , libboost-test-dev , libgmp-dev , libjemalloc-dev , libmpfr-dev , libyaml-dev , maven , openjdk-11-jdk , pkg-config , python3 , python3-dev , python3-distutils , python3-pip , zlib1g-dev
Standards-Version: 3.9.6
Homepage: https://github.com/runtimeverification/k

Expand Down
4 changes: 4 additions & 0 deletions package/debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ export DEB_BUILD_MAINT_OPTIONS=hardening=-stackprotector

DESTDIR=$(shell pwd)/debian/kframework
PREFIX=/usr
PYTHON_VERSION=python3.8
PYTHON_DEB_VERSION=python3
export DESTDIR
export PREFIX

Expand All @@ -26,6 +28,8 @@ override_dh_auto_build:

override_dh_auto_install:
package/package
@mkdir -p $(DESTDIR)$(PREFIX)/lib/$(PYTHON_DEB_VERSION)/dist-packages
ln --symbolic --relative $(DESTDIR)$(PREFIX)/lib/$(PYTHON_VERSION)/site-packages/kllvm $(DESTDIR)$(PREFIX)/lib/$(PYTHON_DEB_VERSION)/dist-packages/kllvm

override_dh_strip:
dh_strip -Xliballoc.a -Xlibarithmetic.a -XlibAST.a -Xlibutil.a -XlibParser.a -Xlibcollect.a -Xlibcollections.a -Xlibjson.a -Xlibstrings.a -Xlibmeta.a -Xlibio.a
Expand Down
4 changes: 4 additions & 0 deletions package/debian/rules.jammy
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ export DEB_BUILD_MAINT_OPTIONS=hardening=-stackprotector optimize=-lto

DESTDIR=$(shell pwd)/debian/kframework
PREFIX=/usr
PYTHON_VERSION=python3.10
PYTHON_DEB_VERSION=python3
export DESTDIR
export PREFIX

Expand All @@ -30,6 +32,8 @@ override_dh_auto_build:

override_dh_auto_install:
package/package
@mkdir -p $(DESTDIR)$(PREFIX)/lib/$(PYTHON_DEB_VERSION)/dist-packages
ln --symbolic --relative $(DESTDIR)$(PREFIX)/lib/$(PYTHON_VERSION)/site-packages/kllvm $(DESTDIR)$(PREFIX)/lib/$(PYTHON_DEB_VERSION)/dist-packages/kllvm

override_dh_strip:
dh_strip -Xliballoc.a -Xlibarithmetic.a -XlibAST.a -Xlibutil.a -XlibParser.a -Xlibcollect.a -Xlibcollections.a -Xlibjson.a -Xlibstrings.a -Xlibmeta.a -Xlibio.a
Expand Down
3 changes: 2 additions & 1 deletion package/docker/Dockerfile.ubuntu-focal
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ RUN apt-get update \
build-essential \
dh-python \
git \
python3
python3 \
python3-pip

RUN git clone 'https://github.com/z3prover/z3' --branch=z3-4.8.15 \
&& cd z3 \
Expand Down
3 changes: 2 additions & 1 deletion package/docker/Dockerfile.ubuntu-jammy
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ RUN apt-get update \
&& apt-get install --yes \
build-essential \
git \
python3
python3 \
python3-pip

RUN git clone 'https://github.com/z3prover/z3' --branch=z3-4.8.15 \
&& cd z3 \
Expand Down
3 changes: 3 additions & 0 deletions package/package
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ cp -R k-distribution/target/release/k/include/* $DESTDIR$PREFIX/include
cp -R k-distribution/target/release/k/lib/* $DESTDIR$PREFIX/lib
cp -R k-distribution/target/release/k/share/* $DESTDIR$PREFIX/share
( cd llvm-backend/target/build && make install )
( cd $DESTDIR$PREFIX/bindings/python &&
pip3 install . --root=$DESTDIR --prefix=$PREFIX)
rm -rf $DESTDIR$PREFIX/bindings
7 changes: 7 additions & 0 deletions src/main/scripts/test-in-container
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,10 @@ cd ~
echo "module TEST imports BOOL endmodule" > test.k
kompile test.k --backend haskell
rm -rf test-kompiled

# Make sure that the KLLVM bindings have been installed properly.
python3 <<HERE
import kllvm
sort_int = kllvm.ast.CompositeSort("SortInt")
assert str(sort_int) == "SortInt{}"
HERE