[WIP] Fixes to build hpcmp2 on a cluster

Currently, the master works in Ubuntu. I'll use this branch to provide fixes for one cluster.
This can only be merged into master if it is successfully tested in Ubuntu.

Note: The patch 5a5dda628a32467cea5bd8237e6a8589fa4ff337 below works in Ubuntu as well.