I know nothing about compiling, but the following
F = Compile[{{k, _Integer}, {d, _Integer}, {s, _Integer}},
IntegerPartitions[s, {k}, Range[d]]]
With[{s = 8, k = 4, d = 5}, IntegerPartitions[s, {k}, Range[d]]]
With[{s = 8, k = 4, d = 5}, F[k, d, s]]
gives the message "Could not complete external evaluation at instruction 9; proceeding with uncompiled evaluation". Maybe IntegerPartitions
cannot be compiled.
What is the purpose of Block
in your code?