improved error message for uncompiled thresh_and_sum