Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2012

[Date Index] [Thread Index] [Author Index]

Search the Archive

Strange Compile runtime error

  • To: mathgroup at smc.vnet.net
  • Subject: [mg127529] Strange Compile runtime error
  • From: Axel <axel.kowald at gmail.com>
  • Date: Thu, 2 Aug 2012 04:50:01 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • Delivered-to: l-mathgroup@wolfram.com
  • Delivered-to: mathgroup-newout@smc.vnet.net
  • Delivered-to: mathgroup-newsend@smc.vnet.net

Hello everybody,

I'm using Mathematica 8.0.1 on 32bit Win7 and I have a strange problem with Compile.
Here my example that demonstrates the problem.

compileTestC = Compile[{{paramList, _Integer, 1}},
   Module[{a, b},
    Print[paramList[[1]]];
    a = paramList[[1]];
    
    If[False,
     b = 1,
     b = 0
     ] ;
    Return[5]
    ] 
   ] ; 


The first call to the compiled function works as expected and gives:
compileTestC[{100}] 
100
5

However, all following calls to the function give this error message:
compileTestC[{100}] 
100
CompiledFunction::cflist: Nontensor object generated; proceeding with uncompiled evaluation. >>
100
5

Slight variations to the function also make the error disappear. 
E.g. deleting the line: a=paramList[[1]];
or deleting the If statement.

This looks absolutely crazy to me and I have no idea what's going on.
Anybody there who can help me?   Maybe it's a Mathematica bug ??

Many thanks,
 Axel
 



  • Prev by Date: Re: Mathematica as a New Approach to Teaching Maths
  • Next by Date: Using Mathematica Workbench to debug compiled functions ??
  • Previous by thread: Re: Heat Equation on a surface sphere using NDSolve?
  • Next by thread: Re: Strange Compile runtime error