Skip to content

Commit

Permalink
💩 Build GMT binary from source, change from gmt-python to PyGMT
Browse files Browse the repository at this point in the history
Couple of breaking changes. Since GenericMappingTools/pygmt#261, the conda-forge binary package is broken (hence all the recent CI build failures...) and we have to build the GMT binary from source, sigh. The new Dockerfile code for handling this isn't nice but it'll do for now.

Also, the Python `gmt-python` package has been renamed to `pygmt` in GenericMappingTools/pygmt#265, so the Pipfile is updated accordingly here. Also pinning to a newer git version on the upstream branch instead of my personal fork, since GenericMappingTools/pygmt#245 has been merged in!
  • Loading branch information
weiji14 committed Feb 8, 2019
1 parent 329fb0b commit ee9df38
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
COMET_API_KEY=
COMET_REST_API_KEY=Wnh3NkQ1aWVNb21XNk1wclM2R28zdDJjQQ==
LD_LIBRARY_PATH=${CONDA_PREFIX}/lib/
GMT_LIBRARY_PATH=${CONDA_PREFIX}/lib/
GMT_LIBRARY_PATH=${PWD}/gmt/lib/
JUPYTER_CONFIG_DIR=${PWD}/.jupyter
30 changes: 30 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,36 @@ RUN conda env create -n deepbedmap -f environment.yml && \
conda clean -tipsy && \
conda list -n deepbedmap

# Install Generic Mapping Tools binary from source
ENV GMT_COMMIT_HASH 9f24c96d09e42d66ddbca4b1505b5c18498e7847
ENV INSTALLDIR ${HOME}/gmt
ENV COASTLINEDIR ${INSTALLDIR}/coast

RUN git clone --depth=1 https://github.com/GenericMappingTools/gmt.git && \
cd gmt && \
git checkout ${GMT_COMMIT_HASH}
RUN cd gmt && \
mkdir -p ${INSTALLDIR} && \
mkdir -p ${COASTLINEDIR} && \
bash ci/download-coastlines.sh
USER root
RUN apt-get -qq update && \
apt-get install -y --no-install-recommends \
cmake \
ninja-build \
libcurl4-gnutls-dev \
libnetcdf-dev \
libgdal-dev \
libfftw3-dev \
libpcre3-dev \
liblapack-dev \
ghostscript \
curl && \
cd gmt && \
TEST=false bash ci/build-gmt.sh && \
rm -rf /var/lib/apt/lists/*
USER ${NB_USER}

# Install dependencies in Pipfile.lock using pipenv
COPY Pipfile* ${HOME}/
RUN source activate deepbedmap && \
Expand Down
2 changes: 1 addition & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ cupy-cuda92 = "==6.0.0b1"
cython = "==0.29.2"
descartes = "==1.1.0"
geopandas = {editable = true, ref = "0.4.0-26-g9e584cc", git = "https://github.com/geopandas/geopandas.git"}
gmt = {editable = true, ref = "0.1a3-131-g9772fa3", git = "https://github.com/weiji14/gmt-python.git"}
gmt = {editable = true, ref = "0.0.1a0-16-g7004aa0", git = "https://github.com/GenericMappingTools/pygmt.git"}
ipython = "==7.2.0"
jupyterlab = "==0.35.4"
jupytext = "==0.8.6"
Expand Down
32 changes: 19 additions & 13 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions data_prep.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@
"text": [
"Python : 3.6.6 | packaged by conda-forge | (default, Oct 11 2018, 14:33:06) \n",
"Geopandas : 0.4.0+26.g9e584cc\n",
"GMT : 0.1a3+131.g9772fa3\n",
"GMT : 0.0.1a0+16.g7004aa0\n",
"Numpy : 1.14.5\n",
"Rasterio : 1.0.10\n",
"Scikit-image : 0.14.1\n",
"Xarray : 0.11.0\n"
"Rasterio : 1.0.16\n",
"Scikit-image : 0.14.2\n",
"Xarray : 0.11.3\n"
]
}
],
Expand All @@ -49,7 +49,7 @@
"import yaml\n",
"\n",
"import geopandas as gpd\n",
"import gmt\n",
"import pygmt as gmt\n",
"import IPython.display\n",
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
Expand Down
2 changes: 1 addition & 1 deletion data_prep.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
import yaml

import geopandas as gpd
import gmt
import pygmt as gmt
import IPython.display
import matplotlib.pyplot as plt
import numpy as np
Expand Down
1 change: 0 additions & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ dependencies:
- defaults::cudnn=7.2.1[md5=6a84069dcf4aca8ba9493d3cb320090e]
- hcc::cuda_driver=410.73[md5=941787b750b372f4a240287634589d24]
- defaults::cudatoolkit=9.2[md5=f81c96e01ccb9028800101b35e71b844]
- gmt=6.0.0a18[md5=3ee3679433e1bf57640d86e4bc8dfc81]
- pip=18.1[md5=d68c7e5109ba0bf4b1cfe60f0f47870a]
- conda-forge::python=3.6.6[md5=fe9f54422cdaf8779147b6a02cab2dd1]
- pip:
Expand Down

0 comments on commit ee9df38

Please sign in to comment.