0

I installed Microsoft Windows SDK for Windows 7 and .NET Framework 3.5 SP1 Then, I installed Mathematica 10 trial version.

I did:

Needs["CCompilerDriver`"]

$CCompiler = {"Compiler" -> GenericCCompiler, 
"CompilerInstallation" -> 
"C:\\Program Files (x86)\\Microsoft Visual Studio 9.0\\VC\\bin", 
"CompilerName" -> "cl.exe"};

Compile[{{x}}, x^2 + Sin[x^2], CompilationTarget -> "C"];

I got:

CreateLibrary::badcomp: Compiler specification "Compiler" -> GenericCCompiler does not specify a compiler driver listed by CCompilers[Full]. >>

Compile::nogen: A library could not be generated from the compiled function. >>

How can I set up c compiler which I installed for Mathematica?

MOON
  • 3,864
  • 23
  • 49
  • Do not set $CCompiler. If the Microsoft compiler is installed correctly, Mathematica will auto-detect it. Re-start Mathematica (including the front end) after installing the compiler. – Szabolcs Aug 17 '14 at 23:26
  • It did not work. No matter if I use $CCompiler or not use it, I cannot compile for c compiler. I even restarted Windows but no success. – MOON Aug 18 '14 at 00:24
  • Then the compiler is likely not properly installed. There should be an environment variable names VS90COMNTOOLS or similar. Can you check if it exists? Evaluate GetEnvironment[] and look for it. – Szabolcs Aug 18 '14 at 01:08
  • @Silvia One of the topics is abput visual studio 2013. I have installed 2008 edition. The other says install .Net before SDK but when Í install SDK it installs .Net too. – MOON Aug 18 '14 at 11:28
  • @yashar Sorry, I'm using 2013, so can't really help... – Silvia Aug 18 '14 at 13:17

0 Answers0