From 13a8d6b335a940a378b9f3c93a16444389a42d6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonardo=20Pi=C3=B1eyro?= Date: Wed, 20 Feb 2019 22:44:25 -0300 Subject: [PATCH] Added Dockerfile definition --- Dockerfile | 49 ++++++++++++++++++++++++++++++++++++++++++++++ docker-compose.yml | 2 ++ 2 files changed, 51 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..4158add --- /dev/null +++ b/Dockerfile @@ -0,0 +1,49 @@ +# +# NOTE: Tried with Haskell 8.2 and 8.0 and ended up with some build errors +# +FROM haskell:8.4 + +RUN mkdir /grenade +COPY . /grenade + +# +# Install system dependencies +# +RUN apt-get update && apt-get install -y \ + build-essential \ + gfortran \ + libatlas-base-dev \ + libgsl0-dev \ + liblapack-dev \ + python \ + wget + +# +# Install Open Blas (with Lapack included) +# This is a depencency for building hmatrix package +# +ENV OPEN_BLAS_VER=0.2.20 +RUN wget http://github.com/xianyi/OpenBLAS/archive/v$OPEN_BLAS_VER.tar.gz +RUN tar -xzvf v$OPEN_BLAS_VER.tar.gz + +WORKDIR /OpenBLAS-$OPEN_BLAS_VER +RUN ls -la +RUN make FC=gfortran +RUN make PREFIX=/usr/local install + +# +# Build and setup grenade +# +WORKDIR /grenade + +RUN stack init +RUN stack setup --install-ghc +RUN stack build + +# Optional GHCI prompt configuration +RUN echo ':set prompt "\ESC[34mλ> \ESC[m"' > ~/.ghci + +# +# Run GHC repl +# +CMD [ "stack", "ghci" ] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..b638e70 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,2 @@ +grenade: + build: .