I’ve discovered a few issues with the pygplates source (in the last public release) when using conda. Here are the fixes:
-
Was finding the system
qwtinstead of conda’sqwt:
To fix this, editcmake/modules/FindQwt.cmakeand insertNAMES_PER_DIRas 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 -
Was finding the system
projinstead of conda’sproj
To fix this, editcmake/modules/FindPROJ.cmakeand insertproj.hbefore every occurrence ofproj_api.h. An example of this is shown in the diff below:
Without this you would get a runtime error like- FIND_PATH(PROJ_INCLUDE_DIR proj_api.h + FIND_PATH(PROJ_INCLUDE_DIR proj.h proj_api.hundefined symbol: pj_freewhen importing pygplates. -
A compile error:
invalid use of incomplete type ‘class QwtText’:
To fix this, editsrc/qt-widgets/KinematicGraphPicker.hand insert#include "qwt_text.h"as shown below (but without the+sign):
This is needed because conda upgraded#include "qwt_plot_canvas.h" #include "qwt_plot_picker.h" +#include "qwt_text.h"qwtfrom 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.