Skip to content
Open
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 .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Dockerfile
_build
validation-files/*
output/*
36 changes: 36 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
FROM ubuntu:jammy

ARG DEBIAN_FRONTEND=noninteractive
# Install some basic pre-requisites
RUN apt-get -qq update \
&& apt-get install -q -y \
sudo wget git \
build-essential g++ gcc m4 make pkg-config libgmp3-dev unzip cmake \
opam \
python3 python3-pip \
time \
z3 \
libz3-dev \
&& apt-get clean -q -y \
&& rm -rf /var/lib/apt/lists/*

RUN pip3 install solc-select
RUN solc-select install 0.7.6 \
&& solc-select use 0.7.6 \
&& solc-select install 0.4.26
ENV PATH=$PATH:/root/.solc-select/artifacts/

WORKDIR /build
ADD . ./verismart

WORKDIR /build/verismart
RUN opam init -y --disable-sandboxing \
&& eval $(opam env) \
&& opam update \
&& opam install -y \
conf-m4.1 ocamlfind ocamlbuild num yojson batteries ocamlgraph zarith z3
# Make sure that ocamlbuild and such exists in the path
RUN echo 'eval $(opam env)' >> $HOME/.bashrc

RUN chmod +x build && eval $(opam env) && ./build && ./main.native --help >/dev/null
RUN ln -s $(realpath ./main.native) /usr/local/bin/verismart
14 changes: 14 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash

TARGET=main.native
INCLUDE_DIRS=src/frontend,src/pre,src/pre/interval,src/verify,src/vlang,src/util,src/checker,src/exploit

build:
time ocamlbuild src/$(TARGET) -use-ocamlfind -tag thread -Is $(INCLUDE_DIRS)

clean:
ocamlbuild -clean

rebuild: clean build

.PHONY: clean build rebuild debug
2 changes: 1 addition & 1 deletion _tags
Original file line number Diff line number Diff line change
@@ -1 +1 @@
true: package(batteries), package(str), package(Z3), package(yojson), package(ocamlgraph)
true: package(batteries), package(str), package(z3), package(yojson), package(ocamlgraph)
2 changes: 1 addition & 1 deletion build
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

TARGET=main.native
INCLUDE_DIRS=src/frontend,src/pre,src/pre/interval,src/verify,src/vlang,src/util,src/checker,src/exploit
Expand Down
25 changes: 25 additions & 0 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{ pkgs ? import <nixpkgs> { } }:

pkgs.mkShell {
buildInputs = [
pkgs.ocaml
pkgs.opam

pkgs.ocamlPackages.findlib
pkgs.ocamlPackages.ocamlbuild
pkgs.ocamlPackages.batteries
pkgs.ocamlPackages.ocamlgraph
pkgs.ocamlPackages.num
pkgs.ocamlPackages.yojson
pkgs.ocamlPackages.zarith
pkgs.ocamlPackages.z3

pkgs.z3

pkgs.gnum4
pkgs.gnumake

# pkgs.solc-select
pkgs.solc
];
}