forked from cnerg/dockerfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request cnerg#1 from kkiesling/pymoab-images
build scripts w/ moab and pymoab w/ python 2 and 3
- Loading branch information
Showing
2 changed files
with
117 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
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 \ | ||
&& 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 \ | ||
&& 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 --depth 1 -b Version5.1.0 --single-branch https://bitbucket.org/fathomteam/moab \ | ||
&& mkdir build \ | ||
&& cd build \ | ||
&& 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 | ||
|
||
# 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 |
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,61 @@ | ||
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 \ | ||
&& 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 | ||
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; | ||
|
||
# upgrade pip and install python dependencies | ||
RUN python -m pip install --upgrade pip \ | ||
&& 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 --depth 1 -b Version5.1.0 --single-branch https://bitbucket.org/fathomteam/moab \ | ||
&& mkdir build \ | ||
&& cd build \ | ||
&& 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 | ||
|
||
# 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 |