diff --git a/.gitignore b/.gitignore index 3cc1bedc69f5787645b189114e7635f259f81fba..914048ef49e948f6d03bb34c3968d8d734ee2136 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,5 @@ a.out *.pyc __pycache__/* *.swp +prime +go diff --git a/Dockerfile b/Dockerfile index 8d769798f196c8eec81fd63b857ddfcb03a3212c..52d571556e3d677f6b587ea7c3df6938641bdb42 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,11 @@ ENV LEIN_VERSION=2.5.3 ENV LEIN_ROOT=value WORKDIR /tmp RUN apt-get update && \ - apt-get install -y python \ + apt-get install -y python-dev \ + python-pip \ + build-essential \ + llvm3.7-dev \ + python-numpy \ python3 \ pypy \ lua5.1 \ @@ -18,8 +22,10 @@ RUN apt-get update && \ clojure1.6 \ tcl \ time \ + golang \ wget && \ mkdir /tmp/leiningen && \ + pip install numba && \ wget --quiet https://github.com/technomancy/leiningen/archive/$LEIN_VERSION.tar.gz -O - | \ tar -xz -C /tmp/leiningen/ --strip-components=1 && \ mv /tmp/leiningen/bin/lein-pkg /usr/local/bin/lein && \ @@ -27,7 +33,8 @@ RUN apt-get update && \ wget --quiet \ https://github.com/technomancy/leiningen/releases/download/$LEIN_VERSION/leiningen-$LEIN_VERSION-standalone.zip \ -O /usr/share/java/leiningen-$LEIN_VERSION-standalone.jar && \ - rm -rf rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + apt-get clean && \ + rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* COPY ./ /benchmark WORKDIR /benchmark RUN make diff --git a/LICENSE b/LICENSE.txt similarity index 100% rename from LICENSE rename to LICENSE.txt diff --git a/Makefile b/Makefile index 400d567eec1c7f5cea511d974eb2054fe40a502a..c7af45a4f315acc9fa7c77885d801b074e2cea5f 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,13 @@ .PHONY: all test clean c clojure -ROUNDS = 100000 +ROUNDS ?= 100000 -all: c clojure +.PHONY: all +all: c clojure go +.PHONY: c c: a.out +.PHONY: clojure clojure: target/uberjar target/uberjar: @@ -13,10 +16,14 @@ target/uberjar: a.out: gcc --std=c99 -Wall -lm -O3 prime.c +.PHONY: clean clean: - - rm -fr a.out __pycache__ - cd prime.clj; lein clean + git clean -fdX +go: prime.go + go build -o go prime.go + +.PHONY: all test: all @ time -f "%C : %E seconds" ./a.out $(ROUNDS) > /dev/null @ time -f "%C : %E seconds" java -jar prime.clj/target/uberjar/*-standalone.jar $(ROUNDS) > /dev/null diff --git a/README.rst b/README.rst index 8fd4205a599b09d96e0ce7647c7319ef8a6f5e0e..496b3a580aca6b57ad648edc04ab16e29c7a269a 100644 --- a/README.rst +++ b/README.rst @@ -21,22 +21,25 @@ Added languages Usage ----- Build: + .. code:: shell make Clean: + .. code:: shell make clean Test: + .. code:: shell make test -Also, Docker and Docker Compose are supported (so just run :code: -`docker-compose up`). +Also, Docker and Docker Compose are supported (so just run +:code:`docker-compose up`). History ------- @@ -46,3 +49,9 @@ structure. But I had difficulties expressing what I wanted so I first wrote the program in Python. After I had the program written in both languages I did the obvious thing, I timed them. From there on Barak implemented the program in PHP and we implemented it in C. We hope to have many more languages tested. + +License +------- + +This software is licensed under the BSD 3-clause license (see the +:code:`LICENSE.txt` file). diff --git a/docker-compose.yml b/docker-compose.yml index f44205e272b55f944030dd703c2ceb0c66855331..e2f40e18b12a141172c9b783f9e1e9b6fe4f87e8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,2 +1,6 @@ -testbed: - build: ./ +--- +version: '3' +services: + estbed: + build: + context: ./