Skip to content

Commit ccb7ee9

Browse files
authored
Merge pull request cnerg#1 from kkiesling/pymoab-images
build scripts w/ moab and pymoab w/ python 2 and 3
2 parents f584ebe + 66acc6f commit ccb7ee9

File tree

2 files changed

+117
-0
lines changed

2 files changed

+117
-0
lines changed

pymoab-py2-18.04

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
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+
python-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+
28+
# upgrade pip and install python dependencies
29+
ENV PATH $HOME/.local/bin:$PATH
30+
RUN python -m pip install --upgrade pip \
31+
&& pip install numpy scipy cython tables matplotlib setuptools future pytest
32+
33+
# make starting directory
34+
RUN cd $HOME \
35+
&& mkdir opt
36+
37+
# build MOAB
38+
RUN cd $HOME/opt \
39+
&& mkdir moab \
40+
&& cd moab \
41+
&& git clone --depth 1 -b Version5.1.0 --single-branch https://bitbucket.org/fathomteam/moab \
42+
&& mkdir build \
43+
&& cd build \
44+
&& cmake ../moab -DCMAKE_C_FLAGS="-fPIC -DPIC" -DCMAKE_CXX_FLAGS="-fPIC -DPIC" -DBUILD_SHARED_LIBS=ON \
45+
-DCMAKE_SHARED_LINKER_FLAGS="-Wl,--no-undefined" -DENABLE_MPI=OFF \
46+
-DENABLE_HDF5=ON -DHDF5_ROOT=/usr/lib/x86_64-linux-gnu/hdf5/serial \
47+
-DENABLE_NETCDF=OFF -DENABLE_METIS=OFF -DENABLE_IMESH=OFF -DENABLE_FBIGEOM=OFF \
48+
-DENABLE_PYMOAB=ON -DPREFIX=$HOME/opt/moab \
49+
&& make all -j 8 \
50+
&& cd .. \
51+
&& rm -rf build moab
52+
53+
# set environment variables
54+
ENV PATH $HOME/opt/moab/bin/:$PATH
55+
ENV LD_LIBRARY_PATH $HOME/opt/moab/lib:$LD_LIBRARY_PATH
56+
ENV PYTHONPATH $HOME/opt/moab/lib/python2.7/site-packages/:$PYTHONPATH

pymoab-py3-18.04

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
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

Comments
 (0)