Skip to content

Commit

Permalink
update dockerfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
jzstark committed Nov 6, 2024
1 parent 4442cef commit 66ee624
Show file tree
Hide file tree
Showing 11 changed files with 110 additions and 226 deletions.
32 changes: 7 additions & 25 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,45 +3,27 @@
# Based on owlbarn/owl master branch
############################################################

FROM arm64v8/ubuntu
FROM ubuntu

##################### PREREQUISITES ########################

RUN apt-get update
RUN apt-get -y install git build-essential ocaml wget unzip aspcud m4 pkg-config bubblewrap
RUN apt-get -y install libshp-dev libopenblas-dev liblapacke-dev

ENV VER=2.1.5
RUN wget https://github.com/ocaml/opam/releases/download/$VER/opam-full-$VER.tar.gz \
&& tar -xvf opam-full-$VER.tar.gz \
&& cd opam-full-$VER \
&& ./configure && make lib-ext && make && make install
RUN apt-get -y install aspcud libshp-dev libopenblas-dev liblapacke-dev build-essential wget
RUN apt-get -y install opam pkg-config zlib1g-dev

ENV OCAML_VER=5.1.0
RUN yes | opam init --disable-sandboxing --comp $OCAML_VER && eval $(opam config env)

RUN apt-get install zlib1g-dev
RUN opam install -y dune ocaml-compiler-libs ctypes alcotest utop conf-openblas dune-configurator stdio npy

#################### Setup Env #######################
#################### INSTALL OWL #######################

ENV OWLPATH /root/owl
ENV PATH /root/.opam/${OCAML_VER}/bin:/usr/local/sbin/:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH
ENV CAML_LD_LIBRARY_PATH /root/.opam/${OCAML_VER}/lib/stublibs

ENV OWL_CFLAGS "-g -O3 -Ofast -march=native -funroll-loops -ffast-math -DSFMT_MEXP=19937 -fno-strict-aliasing -Wno-tautological-constant-out-of-range-compare"
ENV EIGENCPP_OPTFLAGS "-Ofast -march=native -funroll-loops -ffast-math"
ENV EIGEN_FLAGS "-O3 -Ofast -march=native -funroll-loops -ffast-math"

#################### INSTALL OWL #######################
# ENV PATH /root/.opam/${OCAML_VER}/bin:/usr/local/sbin/:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH
# ENV CAML_LD_LIBRARY_PATH /root/.opam/${OCAML_VER}/lib/stublibs
#ENV OWL_CFLAGS "-g -O3 -Ofast -march=native -funroll-loops -ffast-math -DSFMT_MEXP=19937 -fno-strict-aliasing -Wno-tautological-constant-out-of-range-compare"

RUN cd /root && git clone https://github.com/owlbarn/owl.git

# HACK: remove unrecognised sse compiler option on arm; add libraries for linking
RUN sed -i -- 's/linux_elf/linux_eabihf/g' $OWLPATH/src/owl/config/configure.ml \
&& sed -i -- 's/-mfpmath=sse//g' $OWLPATH/src/owl/config/configure.ml \
&& sed -i -- 's/-msse2//g' $OWLPATH/src/owl/config/configure.ml

RUN cd $OWLPATH \
&& eval `opam config env ` \
&& make && make install
Expand Down
30 changes: 0 additions & 30 deletions docker/Dockerfile.alpine

This file was deleted.

30 changes: 30 additions & 0 deletions docker/Dockerfile.archlinux
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
FROM ocaml/opam:archlinux-ocaml-5.1

##################### PREREQUISITES ########################

RUN sudo pacman -S --noconfirm base-devel wget zlib shapelib
RUN sudo pacman -S --noconfirm lapack cblas lapacke openblas
RUN opam install -y dune ocaml-compiler-libs ctypes alcotest utop conf-openblas dune-configurator stdio npy

#################### Setup Env #######################

ENV OWLPATH /home/opam/owl
ENV PATH /home/opam/.opam/${OCAML_VER}/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH
ENV CAML_LD_LIBRARY_PATH /root/.opam/${OCAML_VER}/lib/stublibs

#################### INSTALL OWL #######################

RUN cd /home/opam && git clone https://github.com/owlbarn/owl.git

RUN cd $OWLPATH \
&& eval $(opam env) \
&& make && make install

############## SET UP DEFAULT CONTAINER VARS ##############

RUN echo "#require \"owl-top\";; open Owl;;" >> /home/opam/.ocamlinit \
&& opam env >> /home/opam/.bashrc \
&& bash -c "source /home/opam/.bashrc"

WORKDIR $OWLPATH
ENTRYPOINT /bin/bash
28 changes: 0 additions & 28 deletions docker/Dockerfile.centos

This file was deleted.

30 changes: 18 additions & 12 deletions docker/Dockerfile.debian
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,33 @@
# By Liang Wang <[email protected]>
############################################################

FROM ocaml/opam2:debian-stable
USER opam
FROM debian
USER root

##################### PREREQUISITES ########################

RUN sudo apt-get -y update
RUN sudo apt-get -y install m4 wget unzip aspcud libshp-dev gfortran
RUN sudo apt-get -y install pkg-config git camlp4-extra
RUN sudo apt-get -y install libopenblas-dev liblapacke-dev
RUN cd /home/opam/opam-repository && git pull --quiet origin master
RUN opam update -q
RUN apt-get update
RUN apt-get -y install aspcud libshp-dev libopenblas-dev liblapacke-dev build-essential wget
RUN apt-get -y install opam pkg-config zlib1g-dev

ENV OCAML_VER=5.1.0
RUN yes | opam init --disable-sandboxing --comp $OCAML_VER && eval $(opam config env)
RUN opam install -y dune ocaml-compiler-libs ctypes alcotest utop conf-openblas dune-configurator stdio npy

#################### INSTALL OWL #######################

ENV OWLPATH /home/opam/owl
RUN opam install owl owl-top utop -y
RUN cd /root && git clone https://github.com/owlbarn/owl.git

ENV OWLPATH /root/owl
RUN cd $OWLPATH \
&& eval `opam config env ` \
&& make && make install

############## SET UP DEFAULT CONTAINER VARS ##############

RUN echo "#require \"owl-top\";; open Owl;;" >> /home/opam/.ocamlinit \
&& echo 'eval $(opam env)' >> /home/opam/.bashrc
RUN echo "#require \"owl-top\";; open Owl;;" >> /root/.ocamlinit \
&& opam config env >> /root/.bashrc \
&& bash -c "source /root/.bashrc"

WORKDIR $OWLPATH
ENTRYPOINT /bin/bash
25 changes: 15 additions & 10 deletions docker/Dockerfile.fedora
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,30 @@
# By Liang Wang <[email protected]>
############################################################

FROM ocaml/opam2:fedora-29
USER opam
FROM ocaml/opam:fedora-ocaml-5.1

##################### PREREQUISITES ########################

RUN sudo yum update -y
RUN sudo yum -y install git wget unzip m4 pkg-config gcc-gfortran
RUN sudo dnf -y install openblas-devel
RUN cd /home/opam/opam-repository && git pull --quiet origin master
RUN opam update -q
RUN sudo dnf5 -y install zlib-ng-compat-devel
RUN sudo dnf5 -y install openblas-devel
RUN opam install -y dune ocaml-compiler-libs ctypes alcotest utop conf-openblas dune-configurator stdio npy

################## INSTALL OWL LIBRARY #####################
#################### INSTALL OWL #######################

ENV OWLPATH /home/opam/owl
RUN opam install owl owl-top utop -y
RUN cd /home/opam && git clone https://github.com/owlbarn/owl.git

RUN cd $OWLPATH \
&& eval $(opam env) \
&& make && make install

############## SET UP DEFAULT CONTAINER VARS ##############

RUN echo "#require \"owl-top\";; open Owl;;" >> /home/opam/.ocamlinit
RUN echo 'eval $(opam env)' >> /home/opam/.bashrc
RUN echo "#require \"owl-top\";; open Owl;;" >> /home/opam/.ocamlinit \
&& opam env >> /home/opam/.bashrc \
&& bash -c "source /home/opam/.bashrc"

WORKDIR $OWLPATH
ENTRYPOINT /bin/bash
ENTRYPOINT /bin/bash
37 changes: 20 additions & 17 deletions docker/Dockerfile.openblas
Original file line number Diff line number Diff line change
Expand Up @@ -4,38 +4,41 @@
# By Liang Wang <[email protected]>
############################################################

FROM owlbarn/openblas:ubuntu

FROM ocaml/opam2:ubuntu
USER root
FROM ocaml/opam:ubuntu-20.04-ocaml-5.1
USER opam

#################### INSTALL OPENBLAS ######################

WORKDIR /home/opam
COPY --from=0 /home/opam/OpenBLAS OpenBLAS
RUN make -C OpenBLAS/ install
RUN ldconfig /opt/OpenBLAS/lib/

RUN sudo apt-get update
RUN sudo apt-get install -y git gfortran apt-utils
RUN git clone https://github.com/xianyi/OpenBLAS.git
RUN make -C OpenBLAS/
RUN sudo make -C OpenBLAS/ install
RUN sudo ldconfig /opt/OpenBLAS/lib/

##################### PREREQUISITES ########################

ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update -y
RUN apt-get install -y m4 wget unzip aspcud libshp-dev gfortran pkg-config git
RUN cd /home/opam/opam-repository && git pull --quiet origin master
RUN opam update -q
RUN sudo apt update -y
RUN sudo apt install -y aspcud libshp-dev build-essential wget pkg-config zlib1g-dev
RUN opam install -y dune ocaml-compiler-libs ctypes alcotest utop dune-configurator stdio npy

#################### INSTALL OWL #######################

ENV OWLPATH /home/opam/owl
ENV OWL_DISABLE_LAPACKE_LINKING_FLAG 1
ENV OWL_COMPILE_CFLAGS "-I/opt/OpenBLAS/include -I/home/opam/OpenBLAS/lapack-netlib/LAPACKE/include/ -L/opt/OpenBLAS/lib"
RUN CFLAGS=${OWL_COMPILE_CFLAGS} opam install owl owl-top utop -y

RUN cd /home/opam && git clone https://github.com/owlbarn/owl.git
RUN cd $OWLPATH \
&& eval `opam config env` \
&& make && make install

############## SET UP DEFAULT CONTAINER VARS ##############

RUN echo "#require \"owl-top\";; open Owl;;" >> /home/opam/.ocamlinit \
&& echo 'eval $(opam env)' >> /home/opam/.bashrc
&& echo 'eval $(opam env)' >> /home/opam/.bashrc \
&& bash -c "source /home/opam/.bashrc"

WORKDIR $OWLPATH
WORKDIR /home/opam
ENTRYPOINT /bin/bash

28 changes: 0 additions & 28 deletions docker/Dockerfile.opensuse

This file was deleted.

41 changes: 0 additions & 41 deletions docker/Dockerfile.ubuntu

This file was deleted.

Loading

0 comments on commit 66ee624

Please sign in to comment.