From fe990ecfe927b59c219b98bf1b178b4a03e8c8a5 Mon Sep 17 00:00:00 2001 From: Kalin Kiesling Date: Thu, 2 Apr 2020 08:35:05 -0500 Subject: [PATCH 1/4] images w/ moab and pymoab w/ python 2 and 3 --- pymoab-py2-18.04 | 57 ++++++++++++++++++++++++++++++++++++++++++++ pymoab-py3-18.04 | 62 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 119 insertions(+) create mode 100644 pymoab-py2-18.04 create mode 100644 pymoab-py3-18.04 diff --git a/pymoab-py2-18.04 b/pymoab-py2-18.04 new file mode 100644 index 0000000..5075f47 --- /dev/null +++ b/pymoab-py2-18.04 @@ -0,0 +1,57 @@ +FROM ubuntu:18.04 + +# set timezone +ENV HOME /root +ENV TZ=America/Chicago +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone + +ENV HOME /root + +RUN apt-get -y --force-yes update +RUN apt-get install -y --force-yes \ + software-properties-common \ + build-essential \ + git \ + cmake \ + gfortran \ + libblas-dev \ + python-pip \ + liblapack-dev \ + libhdf5-dev \ + autoconf \ + libtool + +# need to put libhdf5.so on LD_LIBRARY_PATH +ENV LD_LIBRARY_PATH /usr/lib/x86_64-linux-gnu +ENV LIBRARY_PATH /usr/lib/x86_64-linux-gnu + +# upgrade pip and install python dependencies +ENV PATH $HOME/.local/bin:$PATH +RUN python -m pip install --upgrade pip +RUN pip install numpy scipy cython tables matplotlib setuptools future pytest + +# make starting directory +RUN cd $HOME \ + && mkdir opt + +# build MOAB +RUN cd $HOME/opt \ + && mkdir moab \ + && cd moab \ + && git clone https://bitbucket.org/fathomteam/moab \ + && cd moab \ + && git checkout -b Version5.1.0 origin/Version5.1.0 \ + && autoreconf -fi \ + && cd .. \ + && mkdir build \ + && cd build \ + && ../moab/configure --enable-shared --enable-optimize --enable-pymoab --disable-debug --with-hdf5=/usr/lib/x86_64-linux-gnu/hdf5/serial --prefix=$HOME/opt/moab \ + && make \ + && make install \ + && cd .. \ + && rm -rf build moab + +# set environment variables +ENV PATH $HOME/opt/moab/bin/:$PATH +ENV LD_LIBRARY_PATH $HOME/opt/moab/lib:$LD_LIBRARY_PATH +ENV PYTHONPATH $HOME/opt/moab/lib/python2.7/site-packages/:$PYTHONPATH diff --git a/pymoab-py3-18.04 b/pymoab-py3-18.04 new file mode 100644 index 0000000..39f8311 --- /dev/null +++ b/pymoab-py3-18.04 @@ -0,0 +1,62 @@ +FROM ubuntu:18.04 + +# set timezone +ENV HOME /root +ENV TZ=America/Chicago +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone + +ENV HOME /root + +RUN apt-get -y --force-yes update +RUN apt-get install -y --force-yes \ + software-properties-common \ + build-essential \ + git \ + cmake \ + gfortran \ + libblas-dev \ + python3-pip \ + liblapack-dev \ + libhdf5-dev \ + autoconf \ + libtool + +# need to put libhdf5.so on LD_LIBRARY_PATH +ENV LD_LIBRARY_PATH /usr/lib/x86_64-linux-gnu +ENV LIBRARY_PATH /usr/lib/x86_64-linux-gnu + +# upgrade pip and install python dependencies +ENV PATH $HOME/.local/bin:$PATH + + +RUN python3 -m pip install --upgrade pip +RUN pip install numpy scipy cython tables matplotlib setuptools future pytest + +RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 10; \ + update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 10; + +# make starting directory +RUN cd $HOME \ + && mkdir opt + +# build MOAB +RUN cd $HOME/opt \ + && mkdir moab \ + && cd moab \ + && git clone https://bitbucket.org/fathomteam/moab \ + && cd moab \ + && git checkout -b Version5.1.0 origin/Version5.1.0 \ + && autoreconf -fi \ + && cd .. \ + && mkdir build \ + && cd build \ + && ../moab/configure --enable-shared --enable-optimize --enable-pymoab --disable-debug --with-hdf5=/usr/lib/x86_64-linux-gnu/hdf5/serial --prefix=$HOME/opt/moab \ + && make \ + && make install \ + && cd .. \ + && rm -rf build moab + +# set environment variables +ENV PATH $HOME/opt/moab/bin/:$PATH +ENV LD_LIBRARY_PATH $HOME/opt/moab/lib:$LD_LIBRARY_PATH +ENV PYTHONPATH $HOME/opt/moab/lib/python3.6/site-packages/:$PYTHONPATH From a75355b3211454e9101a9b253fee0e2f20c00ced Mon Sep 17 00:00:00 2001 From: Kalin Kiesling Date: Wed, 8 Apr 2020 10:55:58 -0500 Subject: [PATCH 2/4] moved python3 setting; switched moab to cmake --- pymoab-py3-18.04 | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/pymoab-py3-18.04 b/pymoab-py3-18.04 index 39f8311..88bafd9 100644 --- a/pymoab-py3-18.04 +++ b/pymoab-py3-18.04 @@ -24,16 +24,16 @@ RUN apt-get install -y --force-yes \ # need to put libhdf5.so on LD_LIBRARY_PATH ENV LD_LIBRARY_PATH /usr/lib/x86_64-linux-gnu ENV LIBRARY_PATH /usr/lib/x86_64-linux-gnu - -# upgrade pip and install python dependencies ENV PATH $HOME/.local/bin:$PATH +# switch to python 3 +RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 10; \ + update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 10; -RUN python3 -m pip install --upgrade pip +# upgrade pip and install python dependencies +RUN python -m pip install --upgrade pip RUN pip install numpy scipy cython tables matplotlib setuptools future pytest -RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 10; \ - update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 10; # make starting directory RUN cd $HOME \ @@ -43,16 +43,15 @@ RUN cd $HOME \ RUN cd $HOME/opt \ && mkdir moab \ && cd moab \ - && git clone https://bitbucket.org/fathomteam/moab \ - && cd moab \ - && git checkout -b Version5.1.0 origin/Version5.1.0 \ - && autoreconf -fi \ - && cd .. \ + && git clone --depth 1 -b Version5.1.0 --single-branch https://bitbucket.org/fathomteam/moab \ && mkdir build \ && cd build \ - && ../moab/configure --enable-shared --enable-optimize --enable-pymoab --disable-debug --with-hdf5=/usr/lib/x86_64-linux-gnu/hdf5/serial --prefix=$HOME/opt/moab \ - && make \ - && make install \ + && cmake ../moab -DCMAKE_C_FLAGS="-fPIC -DPIC" -DCMAKE_CXX_FLAGS="-fPIC -DPIC" -DBUILD_SHARED_LIBS=ON \ + -DCMAKE_SHARED_LINKER_FLAGS="-Wl,--no-undefined" -DENABLE_MPI=OFF \ + -DENABLE_HDF5=ON -DHDF5_ROOT=/usr/lib/x86_64-linux-gnu/hdf5/serial \ + -DENABLE_NETCDF=OFF -DENABLE_METIS=OFF -DENABLE_IMESH=OFF -DENABLE_FBIGEOM=OFF \ + -DENABLE_PYMOAB=ON -DPREFIX=$HOME/opt/moab \ + && make all -j 8 \ && cd .. \ && rm -rf build moab From 85b4ccd25b2c0bd5e66652c3003d28d3804b038d Mon Sep 17 00:00:00 2001 From: Kalin Kiesling Date: Wed, 8 Apr 2020 10:58:32 -0500 Subject: [PATCH 3/4] switched moab to cmake build --- pymoab-py2-18.04 | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/pymoab-py2-18.04 b/pymoab-py2-18.04 index 5075f47..cc59ade 100644 --- a/pymoab-py2-18.04 +++ b/pymoab-py2-18.04 @@ -38,16 +38,15 @@ RUN cd $HOME \ RUN cd $HOME/opt \ && mkdir moab \ && cd moab \ - && git clone https://bitbucket.org/fathomteam/moab \ - && cd moab \ - && git checkout -b Version5.1.0 origin/Version5.1.0 \ - && autoreconf -fi \ - && cd .. \ + && git clone --depth 1 -b Version5.1.0 --single-branch https://bitbucket.org/fathomteam/moab \ && mkdir build \ && cd build \ - && ../moab/configure --enable-shared --enable-optimize --enable-pymoab --disable-debug --with-hdf5=/usr/lib/x86_64-linux-gnu/hdf5/serial --prefix=$HOME/opt/moab \ - && make \ - && make install \ + && cmake ../moab -DCMAKE_C_FLAGS="-fPIC -DPIC" -DCMAKE_CXX_FLAGS="-fPIC -DPIC" -DBUILD_SHARED_LIBS=ON \ + -DCMAKE_SHARED_LINKER_FLAGS="-Wl,--no-undefined" -DENABLE_MPI=OFF \ + -DENABLE_HDF5=ON -DHDF5_ROOT=/usr/lib/x86_64-linux-gnu/hdf5/serial \ + -DENABLE_NETCDF=OFF -DENABLE_METIS=OFF -DENABLE_IMESH=OFF -DENABLE_FBIGEOM=OFF \ + -DENABLE_PYMOAB=ON -DPREFIX=$HOME/opt/moab \ + && make all -j 8 \ && cd .. \ && rm -rf build moab From 66acc6f859d85803a92732c987bcaffd30ed3b33 Mon Sep 17 00:00:00 2001 From: Kalin Kiesling Date: Wed, 8 Apr 2020 19:32:08 -0500 Subject: [PATCH 4/4] combined run lines --- pymoab-py2-18.04 | 30 +++++++++++++++--------------- pymoab-py3-18.04 | 30 +++++++++++++++--------------- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/pymoab-py2-18.04 b/pymoab-py2-18.04 index cc59ade..90bd494 100644 --- a/pymoab-py2-18.04 +++ b/pymoab-py2-18.04 @@ -7,19 +7,19 @@ RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone ENV HOME /root -RUN apt-get -y --force-yes update -RUN apt-get install -y --force-yes \ - software-properties-common \ - build-essential \ - git \ - cmake \ - gfortran \ - libblas-dev \ - python-pip \ - liblapack-dev \ - libhdf5-dev \ - autoconf \ - libtool +RUN apt-get -y --force-yes update \ + && apt-get install -y --force-yes \ + software-properties-common \ + build-essential \ + git \ + cmake \ + gfortran \ + libblas-dev \ + python-pip \ + liblapack-dev \ + libhdf5-dev \ + autoconf \ + libtool # need to put libhdf5.so on LD_LIBRARY_PATH ENV LD_LIBRARY_PATH /usr/lib/x86_64-linux-gnu @@ -27,8 +27,8 @@ ENV LIBRARY_PATH /usr/lib/x86_64-linux-gnu # upgrade pip and install python dependencies ENV PATH $HOME/.local/bin:$PATH -RUN python -m pip install --upgrade pip -RUN pip install numpy scipy cython tables matplotlib setuptools future pytest +RUN python -m pip install --upgrade pip \ + && pip install numpy scipy cython tables matplotlib setuptools future pytest # make starting directory RUN cd $HOME \ diff --git a/pymoab-py3-18.04 b/pymoab-py3-18.04 index 88bafd9..366eda9 100644 --- a/pymoab-py3-18.04 +++ b/pymoab-py3-18.04 @@ -7,19 +7,19 @@ RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone ENV HOME /root -RUN apt-get -y --force-yes update -RUN apt-get install -y --force-yes \ - software-properties-common \ - build-essential \ - git \ - cmake \ - gfortran \ - libblas-dev \ - python3-pip \ - liblapack-dev \ - libhdf5-dev \ - autoconf \ - libtool +RUN apt-get -y --force-yes update \ + && apt-get install -y --force-yes \ + software-properties-common \ + build-essential \ + git \ + cmake \ + gfortran \ + libblas-dev \ + python3-pip \ + liblapack-dev \ + libhdf5-dev \ + autoconf \ + libtool # need to put libhdf5.so on LD_LIBRARY_PATH ENV LD_LIBRARY_PATH /usr/lib/x86_64-linux-gnu @@ -31,8 +31,8 @@ RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 10; \ update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 10; # upgrade pip and install python dependencies -RUN python -m pip install --upgrade pip -RUN pip install numpy scipy cython tables matplotlib setuptools future pytest +RUN python -m pip install --upgrade pip \ + && pip install numpy scipy cython tables matplotlib setuptools future pytest # make starting directory