Compilation issue with '.cu file' - cl.exe

I am trying compile a ".cu" file on Windows 8 but getting the following error:
nvcc fatal: Can not find compiler 'cl.exe' in PATH
I tried adding "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin" in PATH variable but it did not help. Any solution/suggestions?

Instead of manually modifying the PATH environment variable, you can execute a batch script "vsvars32.bat" located in "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools" directory. This script sets all the environment variables correctly.

Related

Build a Visual Studio C++ project using the Command Line

I''ve written this batch script to build a Visual Studio C++ project using the Command Line:
pushd C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\
VsDevCmd.bat
pushd F:\Master_Copy2\embedded\IFV-170\visualC12
Msbuild.exe DSP1_Emu.vcxproj
The script changes to C:\Program Files (x86)\ ... directory, runs the VsDevCmd.bat, and then don't complete the commands, and I don't know what's wrong.
Note: When I run these commands one by one in a Command window it runs properly and builds the project.
Edit: #roalz pointed out that I should use Call with the batch file VsDevCmd.bat, and this solved the problem.
I think you need to use the call batch command to call VsDevCmd.bat from inside your batch file.
"The CALL command will launch a new batch file context along with any specified parameters. When the end of the second batch file is reached (or if EXIT is used), control will return to just after the initial CALL statement."
Please see the reference here
Another suggestion is to enclose paths containing spaces inside double quotes, i.e.
"C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\"

MSBuild - Cannot open include file (despite listed in the INCLUDE list )

I am probably missing something obvious - but I have been stuck for a while on this issue. I am compiling a Visual Studio project on the command line using MSBuild. Basically like this:
CALL vcvars32.bat
MSBuild myproject.sln /m /t:rebuild /p:Configuration=Release /verbosity:m
But this gives me an error: fatal error C1083: Cannot open include file 'winsock.h': No such file or directory
But if I check the environment variable INCLUDEafter the vcvars32.bat call the directory containing 'winsock.h' is in the list - so I definitely have this file in the SDK.
In addition if I change verbosity of MSBuild to detailed I can see the full compile command used. If I copy that and run it in the console the same cpp file compiles without any problem.
Any idea whats different inside the MSBuild context ?
Solved it, adding /p:useenv=true make MSBuild use the INCLUDE environment variable.
( Still a bit unsure why that had to be done though, since I can't recall having needed that earlier for command line builds. )

Sublime Text 2 Wants to Only Build Using Java

For some reason, if I try to run and build a .py .cpp .tex or etc and I try to build any file it tries to run java and returns an error like this:
[Error 2] The system cannot find the file specified
[cmd: [u'javac', u'C:\\Users\\name\\Documents\\evolve1\\case0\\herp.cpp']]
[dir: C:\Users\name\Documents\evolve1\case0]
[path: C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\ImageMagick-6.8.9-Q16;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\QuickTime Alternative\QTSystem;C:\Program Files\MATLAB\R2012b\runtime\win64;C:\Program Files\MATLAB\R2012b\bin;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files (x86)\WinMerge;C:\Python27\;C:\Program Files (x86)\MiKTeX 2.9\miktex\bin\;C:\Program Files (x86)\Skype\Phone\;C:\Program Files (x86)\Avogadro\bin]
[Finished]
This is weird on multiple levels, but I'm primarily concerned with getting it to stop building with Java (which I never use anyways) and im a tad confused about why its looking in that particular dir in the third line considering I never even ran code in there.
Select Tools -> Build System -> Automatic, and Sublime should pick the correct build system depending on the syntax of the source file. For example, when editing a .py file, after saving and hitting CtrlB, you should build with Python. If for some reason that doesn't work, just select your desired build system before you build.

mingw32-g++.exe: error: (invalid): No such file or directory

--- Not a useful topic --- Problem occurred in project...
I viewed this page: mingw32-g++.exe: error: CreateProcess: No such file or directory
I installed MinGW(32) first, and installed MinGW64 (by mingw-builds).
And this error occurred. I know i installed EGCS(64bit MinGW).
I tried to uninstall(by wizard) and reboot but i still can't build in C::B.
And i now uninstalled mingw(the original version) and installed TDM-GCC-32 and 64.
The configure is not wrong, and the files is correct.
My %Path%:
PATH=C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program File
s (x86)\Common Files\Microsoft Shared\Windows Live;C:\Windows\system32;C:\Window
s;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Progra
m Files\Lenovo\Bluetooth Software\;C:\Program Files\Lenovo\Bluetooth Software\sy
swow64;C:\Program Files (x86)\Windows Live\Shared;depot_tools;C:\Program Files (
x86)\Common Files\Acronis\SnapAPI\;C:\Program Files\Microsoft SQL Server\110\Too
ls\Binn\;C:\Program Files\Microsoft Windows Performance Toolkit\;C:\Program File
s (x86)\NArrange 0.2.9\;C:\TDM-GCC-64\bin;C:\TDM-GCC-32\bin
I'm going to assume from your above comment that the mingw toolchain you installed on your machine is working properly. The next thing you need to verify is that code::blocks is looking in the right place for that install.
To do this goto Settings->Compiler. This brings up the "Global compiler settings" window. Click on the "Toolchain executables" tab. You should see something like the following:
Check that the "Compiler's installation directory" has the correct path for your mingw install. Also check and make sure the various fields below point to the correct compiler executable name.
Your global variable setup is incorrect for cb_release_type. It is (invalid) in base field.
You need to re-point the base to some other useful directory.
For example i put c:\codeblocks\src\bin and compilation started
Thanks

Visual Studio 2012 error MSB3073

I'm trying to upgrade just my IDE, not the compiler yet, from Visual studio 2010 to 2012. I keep getting
Error 9 error MSB3073: The command ""C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\Tools\..\IDE\devenv" mdlibs.sln /Build "Release|x64"" exited with code 1. C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.MakeFile.Targets 38 lib_mdlibs (Visual Studio 2008)
It directs me to this code
<Target Name="Build"
DependsOnTargets="PrepareForNMakeBuild;ResolveReferences;GetTargetPath"
Returns="$(NMakeManagedOutput)">
<VCMessage Code="MSB8005" Type="Warning" Arguments="NMakeBuildCommandLine"
Condition="'$(NMakeBuildCommandLine)'==''"/>
<Exec Command="$(NMakeBuildCommandLine)"
Condition="'$(NMakeBuildCommandLine)'!=''"/>
</Target>
Specifically the second last line
I have no idea how to deal with this! I've tried a few things but nothing so far has worked
When I build just lib_mdlibs it says
The operation could not be completed
1>
1> Use:
1> devenv [solutionfile | projectfile | anyfile.ext] [switches]
1>
1> The first argument for devenv is usually a solution file or project file.
1> You can also use any other file as the first argument if you want to have the
1> file open automatically in an editor. When you enter a project file, the IDE
1> looks for an .sln file with the same base name as the project file in the
1> parent directory for the project file. If no such .sln file exists, then the
1> IDE looks for a single .sln file that references the project. If no such single
1> .sln file exists, then the IDE creates an unsaved solution with a default .sln
1> file name that has the same base name as the project file.
I thought maybe it was my Command line Build which is
"$(VS110COMNTOOLS)..\IDE\devenv" mdlibs.sln /Build "$(Configuration)|$(Platform)"
But I've tried changing it a couple of time and nothing really helps
I tried opening the just the mdlibs solution in vs2012 and building that, but when I try to build it I get a pop up that says the project file ' ' has been renamed or is no longer in the solution
Or if I try to build any of the individual projects in mdlibs.sln it says cannot perform requested action because a build is already in progress, even if I had just opened the solution
Any suggestions? Any help at all would be greatly appreciated I'm completely stuck
This is most probably because vc11 vcvars get setup as default. Go to VS2010 -> VS Tools -> VS Command Prompt (2010) & then execute your command there.
If above works, execute the 2010 vcvars.bat from the command prompt before executing devenv.exe or msbuild.exe.