diff --git a/Dockerfile b/Dockerfile index 2bedaad54..84426d7c9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 diff --git a/docker/Dockerfile.alpine b/docker/Dockerfile.alpine deleted file mode 100644 index 7b914cdc1..000000000 --- a/docker/Dockerfile.alpine +++ /dev/null @@ -1,30 +0,0 @@ -############################################################ -# Dockerfile to build Owl docker image -# Based on owlbarn/owl master branch -# By Liang Wang -############################################################ - -FROM ocaml/opam2:alpine -USER opam - -##################### PREREQUISITES ######################## - -RUN sudo apk update -RUN sudo apk add m4 wget unzip aspcud openblas-dev zlib-dev -RUN cd /home/opam/opam-repository && git pull --quiet origin master -RUN opam update -q - -#################### SET UP ENV VARS ####################### - -RUN echo "#require \"owl-top\";; open Owl;;" >> /home/opam/.ocamlinit \ - && echo 'eval $(opam env)' >> /home/opam/.bashrc - -#################### INSTALL OWL ####################### - -ENV OWLPATH /home/opam/owl -RUN opam install owl owl-top utop -y - -############## SET UP DEFAULT CONTAINER VARS ############## - -WORKDIR $OWLPATH -ENTRYPOINT /bin/bash diff --git a/docker/Dockerfile.archlinux b/docker/Dockerfile.archlinux new file mode 100644 index 000000000..95aecb96f --- /dev/null +++ b/docker/Dockerfile.archlinux @@ -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 \ No newline at end of file diff --git a/docker/Dockerfile.centos b/docker/Dockerfile.centos deleted file mode 100644 index 71a3771f6..000000000 --- a/docker/Dockerfile.centos +++ /dev/null @@ -1,28 +0,0 @@ -############################################################ -# Dockerfile to build Owl docker image -# Based on owlbarn/owl master branch -# By Liang Wang -############################################################ - -FROM ocaml/opam2:centos-7 -USER opam - -##################### PREREQUISITES ######################## - -RUN sudo yum update -y -RUN sudo yum -y install git wget unzip m4 pkg-config gcc-gfortran epel-release -RUN sudo yum -y install openblas-devel zlib-devel -RUN cd /home/opam/opam-repository && git pull --quiet origin master -RUN opam update -q - -################## INSTALL OWL LIBRARY ##################### - -ENV OWLPATH /home/opam/owl -RUN opam install owl owl-top utop -y - -############## SET UP DEFAULT CONTAINER VARS ############## - -RUN echo "#require \"owl-top\";; open Owl;;" >> /home/opam/.ocamlinit -RUN echo 'eval $(opam env)' >> /home/opam/.bashrc -WORKDIR $OWLPATH -ENTRYPOINT /bin/bash diff --git a/docker/Dockerfile.debian b/docker/Dockerfile.debian index a01b585b1..59ec28846 100644 --- a/docker/Dockerfile.debian +++ b/docker/Dockerfile.debian @@ -4,27 +4,33 @@ # By Liang Wang ############################################################ -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 diff --git a/docker/Dockerfile.fedora b/docker/Dockerfile.fedora index 72ea29fd6..be519d79b 100644 --- a/docker/Dockerfile.fedora +++ b/docker/Dockerfile.fedora @@ -4,25 +4,30 @@ # By Liang Wang ############################################################ -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 \ No newline at end of file diff --git a/docker/Dockerfile.openblas b/docker/Dockerfile.openblas index 3eb929080..4ad9e57c4 100644 --- a/docker/Dockerfile.openblas +++ b/docker/Dockerfile.openblas @@ -4,38 +4,41 @@ # By Liang Wang ############################################################ -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 diff --git a/docker/Dockerfile.opensuse b/docker/Dockerfile.opensuse deleted file mode 100644 index cc8aeb52d..000000000 --- a/docker/Dockerfile.opensuse +++ /dev/null @@ -1,28 +0,0 @@ -############################################################ -# Dockerfile to build Owl docker image -# Based on owlbarn/owl master branch -# By Liang Wang -############################################################ - -FROM ocaml/opam2:opensuse-42.3 -USER opam - -##################### PREREQUISITES ######################## - -RUN sudo zypper -n update -RUN sudo zypper -n in git wget unzip m4 pkg-config gcc-fortran -RUN sudo zypper ref && sudo zypper -n in openblas-devel && sudo update-alternatives --config libblas.so.3 -RUN cd /home/opam/opam-repository && git pull --quiet origin master -RUN opam update -q - -################## INSTALL OWL LIBRARY ##################### - -ENV OWLPATH /home/opam/owl -RUN opam install owl owl-top utop -y - -############## SET UP DEFAULT CONTAINER VARS ############## - -RUN echo "#require \"owl-top\";; open Owl;;" >> /home/opam/.ocamlinit -RUN echo 'eval $(opam env)' >> /home/opam/.bashrc -WORKDIR $OWLPATH -ENTRYPOINT /bin/bash diff --git a/docker/Dockerfile.ubuntu b/docker/Dockerfile.ubuntu deleted file mode 100644 index 3eb929080..000000000 --- a/docker/Dockerfile.ubuntu +++ /dev/null @@ -1,41 +0,0 @@ -############################################################ -# Dockerfile to build Owl docker image -# Based on owlbarn/owl master branch -# By Liang Wang -############################################################ - -FROM owlbarn/openblas:ubuntu - -FROM ocaml/opam2:ubuntu -USER root - -#################### INSTALL OPENBLAS ###################### - -WORKDIR /home/opam -COPY --from=0 /home/opam/OpenBLAS OpenBLAS -RUN make -C OpenBLAS/ install -RUN 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 - -#################### 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 - -############## SET UP DEFAULT CONTAINER VARS ############## - -RUN echo "#require \"owl-top\";; open Owl;;" >> /home/opam/.ocamlinit \ - && echo 'eval $(opam env)' >> /home/opam/.bashrc - -WORKDIR $OWLPATH -ENTRYPOINT /bin/bash - diff --git a/docker/Dockerfile.ubuntu.arm b/docker/Dockerfile.ubuntu.arm index 1fde821c6..2e258cec4 100644 --- a/docker/Dockerfile.ubuntu.arm +++ b/docker/Dockerfile.ubuntu.arm @@ -4,32 +4,34 @@ # By Liang Wang ############################################################ -FROM armv7/armhf-ubuntu:16.04 -MAINTAINER Roger Stark - ##################### PREREQUISITES ######################## +# NOTE: this dockerfile is untested yet!!! +FROM arm64v8/ubuntu + RUN apt-get update -RUN apt-get -y install git build-essential ocaml wget unzip aspcud m4 pkg-config -RUN apt-get -y install libshp-dev -RUN apt-get -y install libopenblas-dev liblapacke-dev +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 VER=2.0.3 -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 opam init && eval $(opam config env) +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 ####################### +#################### Setup Env ####################### ENV OWLPATH /root/owl -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" -RUN opam install owl -y +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 + +#################### INSTALL OWL ####################### + +RUN cd /root && git clone https://github.com/owlbarn/owl.git + +RUN cd $OWLPATH \ + && eval `opam config env ` \ + && make && make install ############## SET UP DEFAULT CONTAINER VARS ############## @@ -38,4 +40,4 @@ RUN echo "#require \"owl-top\";; open Owl;;" >> /root/.ocamlinit \ && bash -c "source /root/.bashrc" WORKDIR $OWLPATH -ENTRYPOINT /bin/bash +ENTRYPOINT /bin/bash \ No newline at end of file diff --git a/docker/openblas.ubuntu b/docker/openblas.ubuntu deleted file mode 100644 index 0c0311b7a..000000000 --- a/docker/openblas.ubuntu +++ /dev/null @@ -1,17 +0,0 @@ -############################################################ -# Dockerfile to build OpenBLAS image -# Based on owlbarn/owl master branch -# By Liang Wang -############################################################ - -FROM ocaml/opam2:ubuntu -USER opam - -##################### PREREQUISITES ######################## - -RUN sudo apt-get update -RUN sudo apt-get install -y git gfortran apt-utils - -WORKDIR /home/opam -RUN git clone https://github.com/xianyi/OpenBLAS.git -RUN make -C /home/opam/OpenBLAS/