I am running Mathematica 10.2 on Windows 7 (64bit) and when I want to use the C compiler I get the message:

A C compiler cannot be found on your system. Please consult the documentation to learn how to set up suitable compilers.

I have done the following:


then CCompilers[]gives Out= {}

CCompilers[Full] gives

{"Name" -> "Intel Compiler", 
 "Compiler" -> CCompilerDriver`IntelCompiler`IntelCompiler, 
 "CompilerInstallation" -> None, 
 "CompilerName" -> Automatic}, {"Name" -> "Generic C Compiler", 
 "Compiler" -> CCompilerDriver`GenericCCompiler`GenericCCompiler, 
 "CompilerInstallation" -> None, "CompilerName" -> Automatic}}

though I have Visual Studio 2015 installed. (I have compiled "Hello World" as console application in VS and it worked there, convincing me that I do have a C compiler). For GetEnvironment[]I get

{... "VS140COMNTOOLS" -> "C:\\Program Files (x86)\\Microsoft Visual Studio \14.0\\Common7\\Tools\\", ...}

(though when I look up this directory I don't see a compiler in there, but the C compiler (cl.exe) seems to be in: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin).

How can I tell Mathematica where to find the C compiler?

Cheers, Bernhard

  • 2
    $\begingroup$ It doesn't support VS 2015 (and neither does 10.3, unfortunately). But it's easy to fix that, just follow the above link. $\endgroup$ – Szabolcs Oct 29 '15 at 11:36
  • $\begingroup$ I found an answer that worked here: community.wolfram.com/groups/-/m/t/548006 . After manually addind the path to VS 2015 in the system file "VisualStudioCompiler.m" and restarting Mathematica it worked. Cheers! $\endgroup$ – PuzzledBiologist Oct 29 '15 at 12:31
  • $\begingroup$ In fact that Wolfram Community thread is linking to the same post I mentioned above. $\endgroup$ – Szabolcs Oct 29 '15 at 13:26

Browse other questions tagged or ask your own question.