# Compile::cplist: error from MapThread [duplicate]

What is the cause of this error?

Compile[{{r, _Integer, 2}, {d, _Integer, 2}},
pos = Position[MapThread[#1 > #2 &, {r, d}, 2], x_ /; x == True]]


Compile::cplist: MapThread[#1 > #2&, {r, d}, 2] should be a tensor of type Integer, Real, or Complex; evaluation will use the uncompiled function. >>

• The error message tells you: the virtual machine does not support registers of tensor boolean type. See this related question. – Oleksandr R. Jan 9 '16 at 21:11
• Thanks @OleksandrR. I will trying it without MapThread, and threading it by a loop. – jack cilba Jan 10 '16 at 5:54
• Whichever method you attempt to use to produce a boolean list will fail in the VM, unfortunately, since this simply does not exist as a type. Perhaps, as in the linked question, you could produce a list of 1s and 0s instead of Trues and Falses? – Oleksandr R. Jan 10 '16 at 9:32
• Yes actually I have problem yet, there is some problem with ">" Greater , Also. @OleksandrR. MapThread is not the core of problem, I used it with Compile before. – jack cilba Jan 10 '16 at 11:31
• I know. Seriously, please read the linked thread in detail. It discusses the very same problem as you're facing, and Andy Ross's answer tells you what to do about it. – Oleksandr R. Jan 10 '16 at 11:53

Compile[{{r, _Integer, 2}, {d, _Integer, 2}},

• Regarding your comment, probably the compiler cannot tell what type the list will be and is expecting an Integer array. You can often fix this by using a third argument in Compile; see the documentation for details. Post a new question with a minimal self-contained example if you need help. – Mr.Wizard Feb 3 '16 at 12:40