MathGroup Archive 2013

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Mathematica does not recognize C Compiler

  • To: mathgroup at smc.vnet.net
  • Subject: [mg131388] Re: Mathematica does not recognize C Compiler
  • From: Joel Klein <jfklein at wolfram.com>
  • Date: Wed, 17 Jul 2013 01:50:44 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • Delivered-to: l-mathgroup@wolfram.com
  • Delivered-to: mathgroup-outx@smc.vnet.net
  • Delivered-to: mathgroup-newsendx@smc.vnet.net
  • References: <20130716095725.E860D69BD@smc.vnet.net>

On 7/16/2013 4:57 AM, Joao wrote:
> Hi, I would like to ask for some help regarding C Compilers in Mathematica.

I'll be glad to help.

>   
> The problem I have is that Mathematica does not recognize the presence of a C Compiler.

It is convenient if Mathematica recognizes compiler installations, but 
not strictly necessary. You can set $CCompiler, as you did, and then use 
it. Let's debug what you tried.

> I have Windows 7 Ultimate 64 bits.
>
> I followed this thread:
> http://mathematica.stackexchange.com/questions/5487/how-do-i-get-mathematica-to-recognize-a-c-compiler-on-a-64-bit-windows-machine
>
> and installed two C Compilers:  one via .NETFramework and Windows SDK 7.1, the other one was the 64 bit MinGW.

Which version of Visual Studio did you install? And what is the exact 
file path that you installed it to?

> Unfortunetely Mathematica 8 still does not recognize any C Compiler.
>
> I tried
> $CCompiler = {"Compiler" -> GenericCCompiler,
>     "CompilerInstallation" -> "C:��Path",
>     "CompilerName" -> "x86_64-w64-mingw32-gcc.exe"};

If you set $CCompiler, then you can just try using it -- try a hello, 
world example like CreateExecutable["#include <stdio.h\nint main(){ 
printf(\"Hello!\\n\"); }", "hello"]. Did you try using it with this setting?

> Regarding the Microsoft CCompiler, Iâ??m not sure what executable file is appropriate, I read somewhere that it should be cl.exe but I canâ??t find this file anywhere. As you can see I am not very familiar with this subject.

Yes, cl.exe is the right executable. But you shouldn't need to specify 
that for Visual Studio.

There is a known bug in Mathematica 8's CCompilerDriver when using 
non-latin characters in any of the file paths: compiler location, user 
home directory, or any explicitly provided file path. I wonder if that 
is part of your difficulties.

--Joel Klein, Kernel Developer
Wolfram Research




  • Prev by Date: How to combine an If statement with Statistics
  • Next by Date: DynamicModule Problem
  • Previous by thread: Mathematica does not recognize C Compiler
  • Next by thread: reduce needs too much memory