I am trying to generate C code for some functions, which I do not post in full because they are a few hundred lines long. The functions do nothing too fancy: a bunch of dot products, powers and roots.
Still, when compiling to C code Mathematica sticks in some unwanted dependency on its own libraries, which is not acceptable for the use case in question. The functions I am trying to compile have 5 arguments, 4 of which are 3-dimensional vectors.
The compile printout of one of them can be found here. As you can see, there are 3 Mathematica functions being pulled in: DotVV, Power and Internal`ReciprocalSqrt. Is there any way I can get rid of these without modifying the code manually?
Edit: here is the code I am using to compile the function
Compile[{{pos, _Real, 1} , {a, _Real, 1}, {v, _Real, 1}, {ba, _Real,
1} , {V, _Real}} ,
xSol, CompilationTarget -> "C"];
Needs["CompiledFunctionTools`"]; CompilePrint[ Compile[{{pos, _Real, 1}, {a, _Real, 1}}, pos.a, CompilationTarget -> "WVM"] ]– acl Jul 04 '14 at 10:38DotVV. As your question is posed, we'd need to come up with code that producesInternal`ReciprocalSqrt,DotVVandPowerwhen compiled, solve the problem, then report to you. You could help by providing an example of problematic code. This is what I have been trying to hint at, but... – acl Jul 04 '14 at 14:14