Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

In Mathematica 9, I entered the following sample code, but it returns an error. I can not figure what is not right. Any help?

CUDACCompilers[]

{{"Name" -> "GCC", 
  "Compiler" -> CCompilerDriver`GCCCompiler`GCCCompiler, 
  "CompilerInstallation" -> "/usr/bin", "CompilerName" -> Automatic}}

doubleFun = CUDAFunctionLoad["
  __global__ void doubleVec(mint * in,  mint length) {
      mint index = threadIdx.x + blockIdx.x * blockDim.x;

    if (index < length)
      in[index] = 2*in[index];
    }", "doubleVec", {{_Integer}, _Integer}, 256, 
  ShellOutputFunction -> Print]

CUDAFunctionLoad::cmpf: The kernel compilation failed. Consider setting the option "ShellOutputFunction"->Print to display the compiler error message. >>

gcc: error trying to exec 'cc1plus': execvp: No such file or directory

CUDAFunctionLoad["
 __global__ void doubleVec(mint * in,  mint length) {
     mint index = threadIdx.x + blockIdx.x * blockDim.x;

    if (index < length)
      in[index] = 2*in[index];
   }", "doubleVec", {{_Integer}, _Integer}, 256, 
 ShellOutputFunction -> Print]
share|improve this question
    
Do you have the c++ compiler installed (not just gcc)? –  rasher Jan 29 at 6:57
    
The code itself is fine. Compiles here –  Rojo Jan 29 at 14:08
    
Rasher.. I am not sure what you mean by compile here. Do you mean that it compiles at your end? –  Jose E Calderon Feb 26 at 2:57
    
Wha tis the command in Linuz RHEL to install the c++? –  Jose E Calderon Feb 26 at 2:58
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.