Compiling Gplates from the souce code on Ubuntu 20.04

Hello!
Since the Qt4 library has been removed from Ubuntu 20.04 due to its EOL, compiling Gplates from the source code on this platform seems to be hard.
I tried to install Qt4 libraries (libqt4-opengl-dev, libqt4-dev) from a third party ppa. They got installed successfully, but cmake still cannot find them on my platform.
Is there any solution for this problem? Is it possible to compile Gplates from source on Ubuntu 20.04?
Thanks!

Hi Jovid,

Here’s the source code that compiles with Qt5. It has been successfully compiled on Ubuntu 20.04 and 20.10. It’s essentially GPlates 2.2 for Qt5 instead of Qt4. The dependencies to install are listed in DEPS.Linux and the build instructions are in BUILD.Linux. You might get some compilation warnings when building but you can ignore those.

Regards,
John

Hi John!
Thanks a lot for the source code. It compiled and got installed smoothly.
Best regards,
Jovid.

Hi John,

Do you have a list of the Qt5 dependencies that GPlates requires? Arch Linux splits Qt5 into a heap of packages so there is no Qt5 package to install.

Kind regards,
Robbie

Hi Robbie,

The DEPS.Linux file lists them for Ubuntu…

qt5-default libqt5opengl5-dev libqt5svg5-dev libqt5xmlpatterns5-dev

However for Arch Linux it looks like qt5-base is the main package. And, of all the qt5 packages listed here (which, as you mention, there are a lot), perhaps try installing the following…

qt5-base qt5-svg qt5-xmlpatterns

…if that is not enough then it might just be easier to install the entire qt5 group (if that’s possible, perhaps by specifying qt5) rather than installing the individual (sub)packages.

Regards,
John

I just installed pygplates on Ubuntu 20.04 (new installation in a Windows Subsystem for Linux). When the python code tries to import pygplates, it returns an error:
ImportError: libQt5Core.so.5: cannot open shared object file: No such file or directory
Is there a (quick) fix for this? I am not familiar with compiling unlike Jovid and wouldn’t know where to start.

Hi Thomas,

Did you install from the Focal (20.04) DEB package or compile from the source code link in this thread?

If it’s the source code link then that’s only meant for GPlates (the current PyGPlates can be found here).

I haven’t used Windows Subsystem for Linux yet, but I’ll give that a try

Hi John,

Thanks!
I installed from the DEB package. In my directory /usr/lib/pygplates/revision28/ is one file: pygplates.so. I have added it to the PYTHONPATH re the instruction on the sourceforge page and also added the sys.path.insert(1, '/path/to/pygplates') to my script (with the correct path).

Edit: I solved it:
sudo apt-get install qtdeclarative5-dev (not sure if this is necessary or I overlooked the files, damn capitalization)
strip --remove-section=.note.ABI-tag /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
Source: https://askubuntu.com/questions/1034313/ubuntu-18-4-libqt5core-so-5-cannot-open-shared-object-file-no-such-file-or-dir

Hi Thomas,

I see you’ve edited your post to say that you’ve solved the issue. Nice one, that looked tricky. Seems like that strip command is needed because of the way Qt5 is built on WSL (Windows Subsystem for Linux). Interesting.

Regarding the need for qtdeclarative5-dev, I don’t have that installed on my Ubuntu 20.04. I just installed qt5-default libqt5opengl5-dev libqt5svg5-dev libqt5xmlpatterns5-dev. But then again I’m not using WSL.