build python extension for comparison