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: .