Skip to content

Prerequisites for C Compiler

njpipeorgan edited this page Oct 31, 2019 · 16 revisions

MathCompile depends on a C++ compiler that supports C++17 standard to compile Wolfram Language functions to machine code. The compiler used is typically choose automatically, but it can also controlled by CCompilerDriver`$CCompiler, see the Documentation for more information.

Unix-like

GCC 7 or higher

To manually switch to GCC,

CCompilerDriver`$CCompiler = CCompilerDriver`GCCCompiler`GCCCompiler;

Clang 4 or higher

To enable Clang on Linux, set $CCompiler with the installation path and specify the compiler name, e.g.

CCompilerDriver`$CCompiler = {
  "Compiler" -> CCompilerDriver`GenericCCompiler`GenericCCompiler,
  "CompilerInstallation" -> "/usr/bin" (* path to clang *),
  "CompilerName" -> "clang++"
};

Intel C++ Compiler 19 or higher

To enable Intel C++, set $CCompiler with the installation path, e.g.

CCompilerDriver`$CCompiler = {
  "Compiler" -> CCompilerDriver`IntelCompiler`IntelCompiler,
  "CompilerInstallation" -> "/opt/intel/bin" (* path to icc *)
};

Intel C++ compiler is freely available to students and open source contributors, Intel Parallel Studio XE.

Windows

Microsoft Visual C++ 19.20 or higher

MSVC is available as part of Microsoft Visual Studio. MSVC 19.20 corresponds to the initial version of Visual Studio 2019.

To manually switch to MSVC, set $CCompiler with the installation path, e.g.

MinGW

Clone this wiki locally