I'm trying to use Mathematica's Compile[] function to speed up some of my computations:

Compile[<some_code>, CompilationTarget -> "C", RuntimeOptions -> "Speed"];

However, whenever I try to do so, I get the following error:

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

When I execute the following code:


I get


And when I execute


I get

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

I am using Mathematica 11 and Windows 11. What I've tried so far:

  • Installed gcc on my computer and configured the PATH correctly. When I type gcc on the command line, I get the expected output.
  • Installed Visual Studio 2022 C++ development tools.
  • Installed Visual Studio 2022 Build Tools for C/C++ development.
  • Read the documentations (both the official one and the one linked below).

What more can I do?



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.