2

C compilers and mathematica.

Hi, I want to use the CUDA functionality in mathematica. However, it requires a working c compiler. I am usually a unix person but i have a windows copy of mathematica. I tried isntalling visual studio express and miniGW (some sort of gcc to windows port). But now when i start mathematica and do a CCompiler[] after having loaded CCompilerDriver and CUDALink with Needs, I get an empty list of compilers. Is there something hidden somewhere I need to set to make mathematica discover these compielrs. I am totally lost with this windows environment.

I find no mention of this on wolframs website, in all their examples visual studio is allways there and working already.

Oh yeah, my mathematica is version 8.

Mr.Wizard
  • 24,179
  • 5
  • 44
  • 125
JohnKay
  • 233
  • 2
  • 7
  • `miniGW (some sort of gcc to windows port)` -> 0) MinGW, without the i, 1) `s/some sort of gcc to windows port/the windows port of gcc/` – Sebastian Mach Jul 08 '11 at 12:51

2 Answers2

2

Both were detected automatically on my system, so I'm not sure what's wrong on yours.

You can look at the files in AddOns\Applications\CCompilerDriver and see how the different compilers are detected. Search for ResolveInstallation in these files.

Based what I found in those files, some things you can try are:

  1. Put MinGW into c:\mingw.
  2. Make sure the VS Express is correctly installed and the environment variable VS100COMNTOOLS or VS90COMNTOOLS is set.
Szabolcs
  • 24,728
  • 9
  • 85
  • 174
  • Thanks, wasn't exactly the solution but lead me onto the right track. The problem was that MinGW only does 32 bit targets. I had thought about if this was a problem and thought that if it was tehn at least visual express 2010 would do 64 bit, but no it does neither, without an windows SDK & net framework update. This is now fixed, but still cuda stuff is not running because i get an error about the cuda compiler no having Target windows-x86-64 - which i find odd because wolfram's examples online are clearly done on a 64 bit machine too. But at least i am much closer now. Thanks. – JohnKay Jul 12 '11 at 13:44
0

I realized I am good for premium support, and they informed me there the fact that I have not found anywhere in the documentation, which is, that the only working 64 bit compiler for cuda under windows is visual studio 2005 and 2008. They are working on support for 2010, but as of the time of writing it isn't working with CUDALink. (o i wish i could go back to working with unix)

when installing 2005 or 2008 follow the instructions at http://reference.wolfram.com/mathematica/CCompilerDriver/tutorial/SpecificCompilers.html

you might actually have to downgrade some framework to get it running.

I was haltedi n doing this because my glorious cuda-card broke in the process (sic), so having to wait for it to be fixed before I can get any further,

  • Furthermore, the express versions of 2005 or 2008 won't do! So I had to get a deprecated copy of the whole thing. Luckily we had some dusting around in the office, you might have some problems finding them in retail though. – JohnKay Jul 25 '11 at 07:46