|
| 1 | +FROM ubuntu:18.04 |
| 2 | + |
| 3 | +# set timezone |
| 4 | +ENV HOME /root |
| 5 | +ENV TZ=America/Chicago |
| 6 | +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone |
| 7 | + |
| 8 | +ENV HOME /root |
| 9 | + |
| 10 | +RUN apt-get -y --force-yes update \ |
| 11 | + && apt-get install -y --force-yes \ |
| 12 | + software-properties-common \ |
| 13 | + build-essential \ |
| 14 | + git \ |
| 15 | + cmake \ |
| 16 | + gfortran \ |
| 17 | + libblas-dev \ |
| 18 | + python3-pip \ |
| 19 | + liblapack-dev \ |
| 20 | + libhdf5-dev \ |
| 21 | + autoconf \ |
| 22 | + libtool |
| 23 | + |
| 24 | +# need to put libhdf5.so on LD_LIBRARY_PATH |
| 25 | +ENV LD_LIBRARY_PATH /usr/lib/x86_64-linux-gnu |
| 26 | +ENV LIBRARY_PATH /usr/lib/x86_64-linux-gnu |
| 27 | +ENV PATH $HOME/.local/bin:$PATH |
| 28 | + |
| 29 | +# switch to python 3 |
| 30 | +RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 10; \ |
| 31 | + update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 10; |
| 32 | + |
| 33 | +# upgrade pip and install python dependencies |
| 34 | +RUN python -m pip install --upgrade pip \ |
| 35 | + && pip install numpy scipy cython tables matplotlib setuptools future pytest |
| 36 | + |
| 37 | + |
| 38 | +# make starting directory |
| 39 | +RUN cd $HOME \ |
| 40 | + && mkdir opt |
| 41 | + |
| 42 | +# build MOAB |
| 43 | +RUN cd $HOME/opt \ |
| 44 | + && mkdir moab \ |
| 45 | + && cd moab \ |
| 46 | + && git clone --depth 1 -b Version5.1.0 --single-branch https://bitbucket.org/fathomteam/moab \ |
| 47 | + && mkdir build \ |
| 48 | + && cd build \ |
| 49 | + && cmake ../moab -DCMAKE_C_FLAGS="-fPIC -DPIC" -DCMAKE_CXX_FLAGS="-fPIC -DPIC" -DBUILD_SHARED_LIBS=ON \ |
| 50 | + -DCMAKE_SHARED_LINKER_FLAGS="-Wl,--no-undefined" -DENABLE_MPI=OFF \ |
| 51 | + -DENABLE_HDF5=ON -DHDF5_ROOT=/usr/lib/x86_64-linux-gnu/hdf5/serial \ |
| 52 | + -DENABLE_NETCDF=OFF -DENABLE_METIS=OFF -DENABLE_IMESH=OFF -DENABLE_FBIGEOM=OFF \ |
| 53 | + -DENABLE_PYMOAB=ON -DPREFIX=$HOME/opt/moab \ |
| 54 | + && make all -j 8 \ |
| 55 | + && cd .. \ |
| 56 | + && rm -rf build moab |
| 57 | + |
| 58 | +# set environment variables |
| 59 | +ENV PATH $HOME/opt/moab/bin/:$PATH |
| 60 | +ENV LD_LIBRARY_PATH $HOME/opt/moab/lib:$LD_LIBRARY_PATH |
| 61 | +ENV PYTHONPATH $HOME/opt/moab/lib/python3.6/site-packages/:$PYTHONPATH |
0 commit comments