How do I enable execution on a local instance of Compiler Explorer?

639 Views Asked by At

What do I need to do to enable execution support on a local instance of Compiler Explorer? My particular setup is on Windows 11, currently testing with MSVC 2022, with cl.exe version 19.35.32019.

I tried to enable execution in the web GUI of my local instance of Compiler Explorer but found the option grayed out. I expected it to be enabled by default. grayed-out output options in local instance of Compiler Explorer

1

There are 1 best solutions below

0
On

The secret is to set the following options per compiler, in your c++.local.properties file.

For example, if you have vs2022 installed, this file might look like this, in part:

includePath=C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.35.32124\include;C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.35.32124\ATLMFC\include;C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Auxiliary\VS\include;C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt;C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\um;C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\shared;C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\winrt;C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\cppwinrt;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.7.2\include\um
libPath=C:\Program Files (x86)\Windows Kits\10\Lib\10.0.22621.0\um\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.22621.0\ucrt\x64;C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.35.32124\lib\x64
    
demangler=C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.35.32124\bin\Hostx64\x64\undname.exe

defaultCompiler=vc2022_64

compilers=&vc2022:&clang

group.vc2022.groupName=Visual Studio MSVC
group.vc2022.compilers=vc2022_32:vc2022_64
group.vc2022.options=-EHsc
group.vc2022.compilerType=win32-vc
group.vc2022.needsMulti=false
group.vc2022.includeFlag=/I
group.vc2022.versionFlag=/?
group.vc2022.versionRe=^.*Microsoft \(R\).*$
group.vc2022.supportsBinary=true
group.vc2022.supportsExecute=true

In particular, note the last two lines. Also note the libPath and includePath and adjust according to what you have installed.