Cmake error while installing Pygplates

I’ve discovered a few issues with the pygplates source (in the last public release) when using conda. Here are the fixes:

  1. Was finding the system qwt instead of conda’s qwt:
    To fix this, edit cmake/modules/FindQwt.cmake and insert NAMES_PER_DIR as shown below (but without the + sign):
     find_library(QWT_LIBRARY
       # The '-qt5' versions searched first (in case 'qwt' is a qt4 version)...
       NAMES qwt-qt5 qwt6-qt5 qwt qwt6
    +  NAMES_PER_DIR
       PATHS
         /usr/lib
         /usr/local/lib
    
  2. Was finding the system proj instead of conda’s proj
    To fix this, edit cmake/modules/FindPROJ.cmake and insert proj.h before every occurrence of proj_api.h. An example of this is shown in the diff below:
    -    FIND_PATH(PROJ_INCLUDE_DIR proj_api.h
    +    FIND_PATH(PROJ_INCLUDE_DIR proj.h proj_api.h
    
    Without this you would get a runtime error like undefined symbol: pj_free when importing pygplates.
  3. A compile error: invalid use of incomplete type ‘class QwtText’:
    To fix this, edit src/qt-widgets/KinematicGraphPicker.h and insert #include "qwt_text.h" as shown below (but without the + sign):
     #include "qwt_plot_canvas.h"
     #include "qwt_plot_picker.h"
    +#include "qwt_text.h"
    
    This is needed because conda upgraded qwt from 6.1 to 6.2.

I would suggest starting with a fresh install of the source code you have (ie, delete your current source code directory and extract it again). Then try the above edits. And then run cmake and make, as before. Once I did this I was able to successfully compile pygplates with conda and import it into conda’s Python.

These fixes are in the latest development source code (and will be available in the next public release).

Running the conda-build script might have similar problems because it is essentially building in the same way - which is why we will be providing a conda package for pygplates for the next public release (along the lines of Michael’s test build) so that users don’t have to go through this.