Mathematica does not recognize any C compiler on my computer. I run Mathematica 8.0.4.0 on Windows 7. I've tried to make sure various C compilers are installed on my computer, but I'm not sure how to get Mathematica to recognize the installation.
If the compiler is installed correctly, should Mathematica automatically recognize it, or do I have to point Mathematica to a very specific folder to find it?
I edited this post according to some of the comments below by @Szabolcs and @. I've been through https://stackoverflow.com/a/6549505/695132 , and step 2 appears to fail.
I've already been to http://forums.wolfram.com/mathgroup/archive/2011/Nov/msg00024.html, and I installed Microsoft Windows SDK v7.1 for Windows 7 and .NET Framework 4 for xI64. http://www.microsoft.com/en-us/download/details.aspx?id=8442
I also got the Microsoft Visual C++ 2010 Service Pack 1 Compiler Update for the Windows SDK 7.1: http://www.microsoft.com/download/en/details.aspx?id=4422
Please forgive me for not knowing how to check to see if the compiler is working. I simply don't even know where to start with Visual Studios and all that.
Needs["CCompilerDriver`"]
DefaultCCompiler[]
CCompilers[Full]
CCompilers[]
gives the following output:
$Failed
{}
{{"Name" -> "Intel Compiler",
"Compiler" -> CCompilerDriver`IntelCompiler`IntelCompiler,
"CompilerInstallation" -> None,
"CompilerName" -> Automatic}, {"Name" -> "Generic C Compiler",
"Compiler" -> CCompilerDriver`GenericCCompiler`GenericCCompiler,
"CompilerInstallation" -> None, "CompilerName" -> Automatic}}
I get the following error when I try to compile:
CreateLibrary::instl: The compiler installation directive "CompilerInstallation" -> C:\Program Files (x86)\Microsoft Visual Studio 10.0\SDK does not indicate a usable installation of Visual Studio. >>
My question is similar to this question thread, but I don't have enough reputation to ask on that thread. https://stackoverflow.com/questions/6537457/gcc-installed-mathematica-still-wont-compile-to-c
I also have "gcc" show up in a search in various folders under Python27 and MinGW, but Mathematica doesn't seem to know about it. I don't care which compiler I use; I just want an easy installation.
I spent a day trying all sorts of stuff mentioned on various forums, but nothing is working. Why does Mathematica not come out of the box with a working compiler?
Needs["CCompilerDriver`"]; CCompilers[](in a fresh kernel) and post what it returns. Also tryCompile[x, x, CompilationTarget -> "C"]. Actually iy would be best if you went through those 4 steps I posted here and posted the results. Again: don't change things like$CCompilerbefore testing!! Can you start a Windows SDK Command Prompt and test manually that the compiler works (cl.exe)? – Szabolcs May 13 '12 at 06:38MinGWCompiler.mso that it supports both 32- and 64-bit MinGW. – Oleksandr R. May 13 '12 at 07:11%ProgramFiles(x86)%\Microsoft Visual Studio 10.0\VC\bin\vcvarsamd64.bat? (Mathematica looks for this and it should be there if you followed the steps I described.) If not, where (if anywhere) is it? – Oleksandr R. May 14 '12 at 01:06VS100COMNTOOLSset? In Mathematica, evaluateEnvironment["VS100COMNTOOLS"]and tell us what it returns. You can also get the list of all environment variables by typingsetinto a Windows command prompt (cmd.exe). – Szabolcs May 14 '12 at 12:42@OleksandrR., vcvarsamd64.bat does not exist. I installed the x64 version of the SDK from http://www.microsoft.com/en-us/download/details.aspx?id=8442. Should I have installed a different one? I also probably installed more than just the headers and libraries just to be safe. Is that bad? Do I need to uninstall everything and start over?
– Paul May 14 '12 at 20:41%ProgramFiles(x86)%\Microsoft Visual Studio 10.0\SDKthis time too. – Oleksandr R. May 14 '12 at 20:52vcvarsamd64.batshould be in the%ProgramFiles(x86)%\Microsoft Visual Studio 10.0\VC\bin\amd64directory if it's present. Can you find it there? – Oleksandr R. May 14 '12 at 21:00