Created
August 28, 2022 07:24
-
-
Save epifanio/f163c75e5de017af4f64cbc42dbc3a87 to your computer and use it in GitHub Desktop.
Dockerfile to build PDAL with the MB-System driver
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
FROM ubuntu:20.04 | |
ENV DEBIAN_FRONTEND=noninteractive | |
ENV PYTHONUNBUFFERED=1 | |
ARG MBSYS_VERSION=5.7.5 | |
RUN apt-get update && apt-get upgrade -y | |
# main build dependencies | |
RUN apt-get install -y \ | |
python3-pip \ | |
build-essential \ | |
gfortran \ | |
libeigen3-dev \ | |
cmake \ | |
git \ | |
wget \ | |
unzip \ | |
pkg-config \ | |
pkg-config \ | |
python3-dev \ | |
python3-numpy \ | |
pylint \ | |
libgdal-dev \ | |
cmake-curses-gui \ | |
nano | |
# MB-System dependencies | |
RUN apt-get update && apt-get install -y gmt \ | |
libgmt-dev \ | |
libfftw3-dev \ | |
libgl1-mesa-dev \ | |
libglu1-mesa-dev \ | |
cmake-curses-gui \ | |
liblaszip-dev \ | |
python3-all-dev \ | |
libtirpc-dev \ | |
libntirpc-dev \ | |
libmotif-dev \ | |
&& rm -rf /var/lib/apt/lists/* | |
COPY OTPS.tar.Z OTPS.tar.Z | |
RUN tar -zxvf OTPS.tar.Z && rm -rf OTPS.tar.Z && cd OTPS && make && make predict_tide | |
RUN ls /usr/include/tirpc/ | |
RUN ls /usr/include/tirpc/rpc | |
# Install the last working version 5.7.5 of MB-System which is known to work with the PDAL MBIO driver | |
RUN mkdir -p /opt/mb && cd /opt/mb && wget https://github.com/dwcaress/MB-System/archive/$MBSYS_VERSION.tar.gz && \ | |
tar -zxf $MBSYS_VERSION.tar.gz && \ | |
cd MB-System-$MBSYS_VERSION && \ | |
sh autogen.sh && \ | |
./configure --disable-mbtools --with-proj-include=/usr/include \ | |
--with-otps-dir='OTPS/' && \ | |
make -j"$(nproc)" && \ | |
make install | |
# comment the previous MB-System build instruction and uncomment the one below | |
# to enable the build of MB-System from github master branch | |
# RUN mkdir -p /opt/mb && cd /opt/mb && git clone https://github.com/dwcaress/MB-System/ && \ | |
# cd MB-System && \ | |
# ./configure --disable-mbtools --with-proj-include=/usr/include \ | |
# --with-otps-dir='OTPS/' && \ | |
# make -j"$(nproc)" && \ | |
# make install | |
RUN mkdir -p /opt/pdal && cd /opt/pdal && git clone https://github.com/hobu/laz-perf.git && \ | |
cd laz-perf && \ | |
mkdir build && \ | |
cd build && \ | |
cmake .. && \ | |
make -j"$(nproc)" && \ | |
make install | |
RUN mkdir -p /opt/pdal && cd /opt/pdal && git clone https://github.com/PDAL/PDAL && \ | |
cd PDAL && \ | |
mkdir build && \ | |
cd build && \ | |
cmake -DBUILD_PLUGIN_MBIO=ON -DCMAKE_BUILD_TYPE=Debug .. && \ | |
make -j"$(nproc)" && \ | |
make install | |
RUN /usr/bin/python3 -m pip install --upgrade pip && pip install scikit-build && pip install pybind11[global] | |
RUN pip3 install Cython | |
RUN cd /opt/pdal && \ | |
git clone https://github.com/PDAL/python && \ | |
cd python && \ | |
python3 setup.py build && \ | |
python3 setup.py install | |
RUN ldconfig /etc/ld.so.conf.d | |
# Download (or copy) a sonar test file into the docker image | |
RUN wget --directory-prefix=/opt/mb-data/ https://cloud.epinux.com/s/5MWBzBEssoK7AEM/download/170_001_1942.hsx | |
# COPY 170_001_1942.hsx /opt/mb-data/170_001_1942.hsx | |
# uncooment the line below to run a simple test | |
# RUN pdal info --driver readers.mbio --readers.mbio.format="MBF_HYSWEEP1" /opt/mb-data/170_001_1942.hsx |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment