I have been trying to compile some functions in mathematica with target C for speed.
basically when I try:
c = Compile[ {{x, _Real}, {n, _Integer}},
Module[ {sum, inc}, sum = 1.0; inc = 1.0;
Do[inc = inc*x/i; sum = sum + inc, {i, n}]; sum],
CompilationTarget -> "C"];
I get the following error:
Compile::nogen: A library could not be generated from the compiled function.
But it looks like Mathematica is already recognizing my C compiler infact If I try:
Needs["CCompilerDriver`"]
DefaultCCompiler[]
CCompilers[Full]
CCompilers[]
I get:
CCompilerDriver`VisualStudioCompiler`VisualStudioCompiler
{{"Name" -> "Visual Studio",
"Compiler" ->
CCompilerDriver`VisualStudioCompiler`VisualStudioCompiler,
"CompilerInstallation" ->
"C:\\Program Files (x86)\\Microsoft Visual Studio 11.0",
"CompilerName" -> Automatic}, {"Name" -> "Intel Compiler",
"Compiler" -> CCompilerDriver`IntelCompiler`IntelCompiler,
"CompilerInstallation" -> None,
"CompilerName" -> Automatic}, {"Name" -> "Generic C Compiler",
"Compiler" -> CCompilerDriver`GenericCCompiler`GenericCCompiler,
"CompilerInstallation" -> None, "CompilerName" -> Automatic}}
{{"Name" -> "Visual Studio",
"Compiler" ->
CCompilerDriver`VisualStudioCompiler`VisualStudioCompiler,
"CompilerInstallation" ->
"C:\\Program Files (x86)\\Microsoft Visual Studio 11.0",
"CompilerName" -> Automatic}}
Am I doing something completely wrong? Probably yes, Anybody has an answer?
Thank you in advance
$CCompiler = {"Compiler" -> GenericCCompiler, "CompilerInstallation" -> "C:/MinGW-w64", "CompilerName" -> "x86_64-w64-mingw32-gcc.exe"};
$\endgroup$Compiler`$CCompilerOptions = {"ShellOutputFunction" -> Print}
to see the compiler output $\endgroup$