-
Notifications
You must be signed in to change notification settings - Fork 11
Prerequisites for C Compiler
MathCompile depends on a C++ compiler that supports C++17 standard to compile Wolfram Language functions to machine code. The compiler used is often chose automatically, but it can be override by CCompilerDriver`$CCompiler
, see the Documentation for more information.
To manually switch to GCC,
CCompilerDriver`$CCompiler = CCompilerDriver`GCCCompiler`GCCCompiler;
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",
"CompilerName" -> "clang++"
};
Intel C++ compiler is freely available to students and open source contributors, Intel Parallel Studio XE.
To enable Intel C++, set $CCompiler
with the installation path, e.g.
CCompilerDriver`$CCompiler = {
"Compiler" -> CCompilerDriver`IntelCompiler`IntelCompiler,
"CompilerInstallation" -> "/opt/intel/bin"
};
MSVC is available as part of Microsoft Visual Studio. MSVC 19.20 corresponds to the initial version of Visual Studio 2019. Alternatively, build tools for Visual Studio (available here) can be installed without the IDE.
To manually switch to MSVC, set $CCompiler
with the installation path, e.g.
CCompilerDriver`$CCompiler = {
"Compiler" -> CCompilerDriver`VisualStudioCompiler`VisualStudioCompiler,
"CompilerInstallation" ->
"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community"
};
Mingw-w64 supports GCC on Windows for x86-64 targets. It is freely available through SourceForge.
During the installation, choose GCC version 7 or higher and x86_64
architecture. Be aware that the installation path should not contain spaces.
With a installation path of C:\mingw-w64
, set $CCompiler
as follows:
CCompilerDriver`$CCompiler = {
"Compiler" -> CCompilerDriver`GenericCCompiler`GenericCCompiler,
"CompilerInstallation" -> "C:\\mingw-w64\\mingw64\\bin",
"CompilerName" -> "g++.exe"};