-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
78 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,56 @@ | ||
############################################################ | ||
# Dockerfile to build Owl docker image | ||
# Based on owlbarn/owl master branch | ||
# By Liang Wang <[email protected]> | ||
############################################################ | ||
|
||
FROM owlbarn/openblas:ubuntu | ||
FROM arm64v8/ubuntu | ||
|
||
FROM ocaml/opam2:ubuntu | ||
USER root | ||
##################### PREREQUISITES ######################## | ||
|
||
#################### INSTALL OPENBLAS ###################### | ||
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 | ||
|
||
WORKDIR /home/opam | ||
COPY --from=0 /home/opam/OpenBLAS OpenBLAS | ||
RUN make -C OpenBLAS/ install | ||
RUN ldconfig /opt/OpenBLAS/lib/ | ||
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 | ||
|
||
##################### PREREQUISITES ######################## | ||
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 ####################### | ||
|
||
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 | ||
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 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 /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 | ||
|
||
############## 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 | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
############################################################ | ||
# Dockerfile to build Owl docker image | ||
# Based on owlbarn/owl master branch | ||
# By Liang Wang <[email protected]> | ||
############################################################ | ||
|
||
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 | ||
|
This file was deleted.
Oops, something went wrong.