almost compiling on a 64-bit ubuntu kernel
except for plotter linking errors.