# C Compiler: Recognizing Visual Studio 2015

Posted 6 years ago
9516 Views
|
6 Replies
|
2 Total Likes
|
 Re Mathematica 10.2 under Windows 8.1.I have VS 2015 (Community Edition, www.visualstudio.com/products/visual-studio-community-vs) installed but CCompilers@Full returns the Intel and GCC compilers. I think it's because of the following but am not sure...Stack Exchange postings suggest that I must modify 10.2\SystemFiles\Components\CCompilerDriver\VisualStudioCompiler.m. Sure enough, installPath["2015"] isn't there and so I suppose I need a line similar to: installPath["2013"] := installPathFromEnvironment["VS120COMNTOOLS"] If so, "2013" becomes "2015" but what does "VS120COMNTOOLS" become? Or am I barking up the wrong tree?Thanks. Bruce
6 Replies
Sort By:
Posted 6 years ago
 The procedure is described here: This is probably what you referred to, but it's better to actually post the link.VS120COMNTOOLS is an environment variable, so you need to check what similarly named environment variables exist on your system.VS 2013 has version number 12.0 and VS 2015 has version number 14.0. So I suppose it must be VS140COMNTOOLS.Microsoft seems to be supersititious because they skipped version 13.0.
Posted 6 years ago
 Here's how to get Mathematica 10.2 to recognize MS Visual Studio 2015's C compiler (Windows 8.1). In the Mathematica installation folders, go to SystemFiles / Components / CCompilerDriver Make a backup copy of VisualStudioCompiler.m (for any disaster recovery) Open VisualStudioCompiler.m Scroll to \$VisualStudioVersions and add "2015" to the list Scroll to installPath["2013"] and after it, include this new line  installPath["2015"] := installPathFromEnvironment["VS140COMNTOOLS"] These hiccups bit me: Although I could edit VisualStudioCompiler.m, it wouldn't save to the above folder Instead, save it elsewhere and then copy it into the above folder It's not enough to simply install VS2015 -- once installed, within it you must yet install the C++ compiler  Once the C++ compiler is installed, open Mathematica and run:  Needs@"CCompilerDriver" CCompilers@Full ` You should see Visual Studio in the output list -- you're good to goA big "Thank You" to those who led me to this solution.Bruce20150818
Posted 6 years ago
 If you get it working, consider editing the StackExchange post with the correct details for VS 2015 (the "community wiki" designation of that answer means that you are welcome to do this). Other people who use VS 2015 will appreciate it. I do not have this software myself so I cannot test, I can only guess at the correct setup.
Posted 6 years ago
 Thanks, Szabolcs. You're right -- "VS140COMNTOOLS" is correct, per the environment variable that I've just learned to access (Control Panel / System / System / AdvSystemSettings / AdvancedTab / EnvironmentVariables then scroll down in the box).Now I need to unprotect VisualStudioCompiler.m so that I can edit it. Years ago, Wolfram Tech Support said "Check with us first before editing *.m files" so I'll wait 'til Monday to do so. I'll then post to Stack Exchange, as you requested (yes, that was indeed the thread -- I now see that you had participated in it).