How to use Mingw with a build system in Sublime Text - c++

I am using Sublime Text and learning C++. I installed Mingw (also added path) and Sublime Text and added a new build system for taking the external output and input.
Here is the code:
{
"cmd" : ["g++ -std=c++14 '$file_name' -o '$file_base_name' && timeout 4s ./'$file_base_name'<input.txt>output.txt"],
"selector" : "source.c, source.cpp",
"shell": true,
"working_dir" : "$file_path"
}
After pressing Control+B, it threw an error:
c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe:D:\Anand\competitive programming\input.txt: file format not recognized; treating as linker script
c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe:D:\Anand\competitive programming\input.txt:1: syntax error
collect2.exe: error: ld returned 1 exit status
[Finished in 0.1s with exit code 1]
[shell_cmd: g++ "D:\Anand\competitive programming\input.txt" -o "D:\Anand\competitive programming/input" && "D:\Anand\competitive programming/input"]
[dir: D:\Anand\competitive programming]
[path: C:\MinGW\bin;C:\Program Files\Java\jdk-12.0.2\bin;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files\Git\cmd;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\MinGW\bin]
Error 2:
The system cannot find the path specified.
[Finished in 0.0s with exit code 1]
[cmd: ["g++ -std=c++14 'HelloWorld.cpp' -o 'HelloWorld' && timeout 4s ./'HelloWorld'<input.txt>output.txt"]]
[dir: D:\Anand\competitive programming]
[path: C:\MinGW\bin;C:\Program Files\Java\jdk-12.0.2\bin;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files\Git\cmd;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\MinGW\bin]

You don't need the single quotes surrounding the $ variables, and you don't need the ./, as you're running Windows. Edit your build system to include the following:
"cmd" : ["g++ -std=c++14 $file_name -o $file_base_name && timeout 4s $file_base_name < input.txt > output.txt"],
and you should be all set.

Related

How to add specific boost library to MINGW include path

I am trying to set up the boost libraries for C++ in Visual Studio Code: I have extracted the zip file to my program files but when I go to build it all with bootstrap.bat it comes up with this error. It works fine for the first 4 then stops. I have no additional permissions set up
C:\Users\*user*>cd "C:\Program Files\boost\boost_1_78_0"
C:\Program Files\boost\boost_1_78_0>bootstrap.bat
Building Boost.Build engine
LOCALAPPDATA=C:\Users\Alex\AppData\Local
Found with vswhere C:\Program Files\Microsoft Visual Studio\2022\Community
Found with vswhere C:\Program Files\Microsoft Visual Studio\2022\Community
Call_If_Exists "C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\Tools\..\..\VC\Auxiliary\Build\vcvarsall.bat" AMD64
**********************************************************************
** Visual Studio 2022 Developer Command Prompt v17.0.5
** Copyright (c) 2021 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64'
###
### Using 'vc143' toolset.
###
C:\Program Files\boost\boost_1_78_0\tools\build\src\engine>"cl" /nologo /MP /MT /TP /Feb2 /wd4996 /O2 /GL /EHsc -DNDEBUG builtins.cpp class.cpp command.cpp compile.cpp constants.cpp cwd.cpp debug.cpp debugger.cpp execcmd.cpp execnt.cpp execunix.cpp filent.cpp filesys.cpp fileunix.cpp frames.cpp function.cpp glob.cpp hash.cpp hcache.cpp hdrmacro.cpp headers.cpp jam.cpp jamgram.cpp lists.cpp make.cpp make1.cpp md5.cpp mem.cpp modules.cpp native.cpp object.cpp option.cpp output.cpp parse.cpp pathnt.cpp pathsys.cpp pathunix.cpp regexp.cpp rules.cpp scan.cpp search.cpp jam_strings.cpp startup.cpp subst.cpp sysinfo.cpp timestamp.cpp variable.cpp w32_getreg.cpp modules/order.cpp modules/path.cpp modules/property-set.cpp modules/regex.cpp modules/sequence.cpp modules/set.cpp /link kernel32.lib advapi32.lib user32.lib
builtins.cpp
class.cpp
command.cpp
compile.cpp
C:\Program Files\boost\boost_1_78_0\tools\build\src\engine\class.cpp : fatal error C1083: Cannot open compiler generated file: 'C:\Program Files\boost\boost_1_78_0\tools\build\src\engine\class.obj': Permission denied
C:\Program Files\boost\boost_1_78_0\tools\build\src\engine\command.cpp : fatal error C1083: Cannot open compiler generated file: 'C:\Program Files\boost\boost_1_78_0\tools\build\src\engine\command.obj': Permission denied
C:\Program Files\boost\boost_1_78_0\tools\build\src\engine\compile.cpp : fatal error C1083: Cannot open compiler generated file: 'C:\Program Files\boost\boost_1_78_0\tools\build\src\engine\compile.obj': Permission denied
C:\Program Files\boost\boost_1_78_0\tools\build\src\engine\builtins.cpp : fatal error C1083: Cannot open compiler generated file: 'C:\Program Files\boost\boost_1_78_0\tools\build\src\engine\builtins.obj': Permission denied
cl : Command line error D8040 : error creating or communicating with child process
C:\Program Files\boost\boost_1_78_0\tools\build\src\engine>dir *.exe
vol drive c
vol serial number
Directory of C:\Program Files\boost\boost_1_78_0\tools\build\src\engine
File Not Found
C:\Program Files\boost\boost_1_78_0\tools\build\src\engine>copy /b .\b2.exe .\bjam.exe
The system cannot find the file specified.
Failed to build Boost.Build engine.
C:\Program Files\boost\boost_1_78_0>
All I want these for is for the Python Library, is there a way to move said library directly into the MINGW include file and ignore the rest that won't work?

How to tell Bazel which compiler to use without configuring a new toolchain

I would like to force Bazel to use a new compiler to build my project.
From what I understand I could configure a new toolchain or use some command-line options.
I tried the following options:
-CC=clang bazel build //main:hello-world
-export CC=C:\cygwin64\bin\clang++
- bazel build //main:hello-world --client_env=CC=clang
I think these are not working because if I compile the same hello-world.cc file with
clang hello-world.cc
I get the error:
clang-8: error: linker command failed with exit code 1 (use -v to see invocation)
but with
CC=clang bazel build //main:hello-world
or
bazel build //main:hello-world --client_env=CC=clang
the build is successful.
Any idea why the result is different, and how to solve this?
Where can I check which compiler is Bazel using?
EDIT:
here the output of:
CC=C:\cygwin64\bin\clang bazel build -s //main:hello-world
Starting local Bazel server and connecting to it...
Loading:
Loading: 0 packages loaded
Analyzing: target //main:hello-world (1 packages loaded, 0 targets configured)
Analyzing: target //main:hello-world (11 packages loaded, 18 targets configured)
INFO: Analyzed target //main:hello-world (14 packages loaded, 59 targets configured).
INFO: Found 1 target...
[0 / 6] [Prepa] BazelWorkspaceStatusAction stable-status.txt ... (4 actions, 0 running)
SUBCOMMAND: # //main:hello-world [action 'Compiling main/hello-world.cc', configuration: 1f7c3bee164375155568e7845819f422152903a0240344d14b0c6474746ef185, execution platform: #local_config_platform//:host]
cd C:/cygwin64/home/user/_bazel_user/5r4lncy4/execroot/__main__
SET INCLUDE=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\ATLMFC\include;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\include;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um;C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt;C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared;C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um;C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt;C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt
SET PATH=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\bin\HostX64\x64;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\VC\VCPackages;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\TestWindow;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\bin\Roslyn;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Team Tools\Performance Tools\x64;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Team Tools\Performance Tools;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Common\VSPerfCollectionTools\vs2019\\x64;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Common\VSPerfCollectionTools\vs2019\;C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\x64\;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\FSharp\;C:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0\x64;C:\Program Files (x86)\Windows Kits\10\bin\x64;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\\MSBuild\Current\Bin;C:\Windows\Microsoft.NET\Framework64\v4.0.30319;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\Tools\;;C:\WINDOWS\system32;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\VC\Linux\bin\ConnectionManagerExe
SET PWD=/proc/self/cwd
SET RUNFILES_MANIFEST_ONLY=1
SET TEMP=C:\cygwin64\tmp
SET TMP=C:\cygwin64\tmp
C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.25.28610/bin/HostX64/x64/cl.exe /nologo /DCOMPILER_MSVC /DNOMINMAX /D_WIN32_WINNT=0x0601 /D_CRT_SECURE_NO_DEPRECATE /D_CRT_SECURE_NO_WARNINGS /bigobj /Zm500 /EHsc /wd4351 /wd4291 /wd4250 /wd4996 /I. /Ibazel-out/x64_windows-fastbuild/bin /Iexternal/bazel_tools /Ibazel-out/x64_windows-fastbuild/bin/external/bazel_tools /showIncludes /MD /Od /Z7 /wd4117 -D__DATE__="redacted" -D__TIMESTAMP__="redacted" -D__TIME__="redacted" /Fobazel-out/x64_windows-fastbuild/bin/main/_objs/hello-world/hello-world.obj /c main/hello-world.cc
SUBCOMMAND: # //main:hello-world [action 'Linking main/hello-world.exe', configuration: 1f7c3bee164375155568e7845819f422152903a0240344d14b0c6474746ef185, execution platform: #local_config_platform//:host]
cd C:/cygwin64/home/user/_bazel_user/5r4lncy4/execroot/__main__
SET LIB=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\ATLMFC\lib\x64;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\lib\x64;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\lib\um\x64;C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\um\x64;
SET PATH=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\bin\HostX64\x64;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\VC\VCPackages;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\TestWindow;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\bin\Roslyn;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Team Tools\Performance Tools\x64;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Team Tools\Performance Tools;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Common\VSPerfCollectionTools\vs2019\\x64;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Common\VSPerfCollectionTools\vs2019\;C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\x64\;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\FSharp\;C:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0\x64;C:\Program Files (x86)\Windows Kits\10\bin\x64;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\\MSBuild\Current\Bin;C:\Windows\Microsoft.NET\Framework64\v4.0.30319;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\Tools\;;C:\WINDOWS\system32;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\VC\Linux\bin\ConnectionManagerExe
SET PWD=/proc/self/cwd
SET RUNFILES_MANIFEST_ONLY=1
SET TEMP=C:\cygwin64\tmp
SET TMP=C:\cygwin64\tmp
C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.25.28610/bin/HostX64/x64/link.exe #bazel-out/x64_windows-fastbuild/bin/main/hello-world.exe-2.params
Target //main:hello-world up-to-date:
bazel-bin/main/hello-world.exe
INFO: Elapsed time: 4.561s, Critical Path: 0.67s
INFO: 2 processes: 2 local.
INFO: Build completed successfully, 6 total actions
INFO: Build completed successfully, 6 total actions
Any idea why this happens? i am using windows 10. Thank you in advance
When not defining your own toolchain, bazel attempts to perform automatic configuration for you which indeed takes into account value of CC variable when defined. Why your bare compilation attempt has failed is not entirely clear from the part of error message posted, but when in doubt, you can add -s to your bazel command line to see commands called and with that see which compiler has been called:
$ CC=/usr/bin/clang bazel build -s //:hello
INFO: Analyzed target //:hello (1 packages loaded, 15 targets configured).
INFO: Found 1 target...
SUBCOMMAND: # //:greet [action 'Compiling greet.cpp', configuration: dd44f3279b21e91676f65783c46b7b7816026ef7e696e80c251418ec64ffdf5e]
(cd /tmp/_bzl/execroot/__main__ && \
exec env - \
PATH=/bin:/usr/bin:/usr/local/bin \
PWD=/proc/self/cwd \
/usr/bin/clang -U_FORTIFY_SOURCE -fstack-protector -Wall -Wthread-safety -Wself-assign -fcolor-diagnostics -fno-omit-frame-pointer '-std=c++0x' -I/usr/lib64/qt/include -MD -MF bazel-out/k8-fastbuild/bin/_objs/greet/greet.pic.d '-frandom-seed=bazel-out/k8-fastbuild/bin/_objs/greet/greet.pic.o' -fPIC -iquote . -iquote bazel-out/k8-fastbuild/bin -Ibazel-out/k8-fastbuild/bin/_virtual_includes/greet -no-canonical-prefixes -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -c greet.cpp -o bazel-out/k8-fastbuild/bin/_objs/greet/greet.pic.o)
SUBCOMMAND: # //:hello [action 'Compiling hello.cpp', configuration: dd44f3279b21e91676f65783c46b7b7816026ef7e696e80c251418ec64ffdf5e]
(cd /tmp/_bzl/execroot/__main__ && \
exec env - \
PATH=/bin:/usr/bin:/usr/local/bin \
PWD=/proc/self/cwd \
/usr/bin/clang -U_FORTIFY_SOURCE -fstack-protector -Wall -Wthread-safety -Wself-assign -fcolor-diagnostics -fno-omit-frame-pointer '-std=c++0x' -I/usr/lib64/qt/include -MD -MF bazel-out/k8-fastbuild/bin/_objs/hello/hello.pic.d '-frandom-seed=bazel-out/k8-fastbuild/bin/_objs/hello/hello.pic.o' -fPIC -iquote . -iquote bazel-out/k8-fastbuild/bin -iquote external/bazel_tools -iquote bazel-out/k8-fastbuild/bin/external/bazel_tools -Ibazel-out/k8-fastbuild/bin/_virtual_includes/greet -no-canonical-prefixes -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -c hello.cpp -o bazel-out/k8-fastbuild/bin/_objs/hello/hello.pic.o)
SUBCOMMAND: # //:hello [action 'Linking hello', configuration: dd44f3279b21e91676f65783c46b7b7816026ef7e696e80c251418ec64ffdf5e]
(cd /tmp/_bzl/execroot/__main__ && \
exec env - \
PATH=/bin:/usr/bin:/usr/local/bin \
PWD=/proc/self/cwd \
/usr/bin/clang #bazel-out/k8-fastbuild/bin/hello-2.params)
Target //:hello up-to-date:
bazel-bin/hello
INFO: Elapsed time: 1.606s, Critical Path: 0.44s
INFO: 3 processes: 3 linux-sandbox.
INFO: Build completed successfully, 5 total actions
Windows is a bit special / different case: I've started looking at the the corresponding rules_cc, but from there actually followed back to the docs, currently recommended method would be to add a platform definition (e.g. in your workspace root BUILD):
platform(
name = "x64_windows-clang-cl",
constraint_values = [
"#platforms//cpu:x86_64",
"#platforms//os:windows",
"#bazel_tools//tools/cpp:clang-cl",
],
)
And registering the additional toolchain in your WORKSPACE file:
register_execution_platforms(
":x64_windows-clang-cl"
)
register_toolchains(
"#local_config_cc//:cc-toolchain-x64_windows-clang-cl",
)
Then (for now) use --incompatible_enable_cc_toolchain_resolution flag with bazel.
At least at the moment, alternatively you should be able to tell bazel to use LLVM on Windows by running bazel with: --compiler=clang-cl.
You may need to set BAZEL_LLVM (this time) to a directory where LLVM is installed (or try relying on automatic resolution).
That said, it does not look like you could use cygwin LLVM compiler on Windows while still relying on automatic toolchain configuration. I suspect you would really need to define your own toolchain for that (not sure how substantial problems would you encounter crossing the boundary between bazel for Windows and cygwin based compiler each having different idea about what path names to use).

Different errors when trying to link cuRAND on Windows

I have a DLL that contains my CUDA code and recent added a pair .cuh/.cu with cuRAND code to be part of the DLL.
Because there are a lot of linking problems regarding cuRAND, first I wrote a minimalist piece of code just to see if the thing links.
For the sake of completion, the .cuh and .cu are, respectively:
extern "C"
{
void simple_curand_test(void);
}
And
#include "GPU_Rand.cuh"
#include <curand.h>
#include <curand_kernel.h>
void simple_curand_test(void)
{
curandGenerator_t gen;
curandCreateGenerator(&gen, CURAND_RNG_PSEUDO_DEFAULT);
}
Then, my compiler command to generate the DLL is:
nvcc -o bin\GPU_Methods.dll --shared src\GPU_Utils.cu src\GPU_Rand.cu -L"c:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.1\lib\x64" -lcurand
It ends with this error:
Creating library bin/GPU_Methods.lib and object bin/GPU_Methods.exp
tmpxft_000015a0_00000000-44_GPU_Rand.obj : error LNK2019: unresolved external symbol curandCreateGenerator referenced in function simple_curand_test
bin/SCS_GPU.dll : fatal error LNK1120: 1 unresolved externals
If I change the command to make the linker use the variable LIBRARIES, it looks like:
set LIBRARIES="c:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.1\lib\x64"
nvcc -o bin\GPU_Methods.dll --shared src\GPU_Utils.cu src\GPU_Rand.cu -lcurand
Then the error turns to:
nvlink fatal : Could not open input file 'c:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.1\lib\x64'
After spending some days reading and trying multiple combinations of parameters and commands, it is time to ask if you guys can spot what I am missing.
UPDATE - 01/06/2018
These are the environment variables in a command prompt that runs nvcc (some of them were omitted because they are not relevant to the issue and to avoid bloating your screen even more):
ALLUSERSPROFILE=C:\ProgramData
CommonProgramFiles=C:\Program Files\Common Files
CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files
CommonProgramW6432=C:\Program Files\Common Files
CUDA_PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.1
CUDA_PATH_V9_1=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.1
FP_NO_HOST_CHECK=NO
HOMEDRIVE=C:
NVCUDASAMPLES9_1_ROOT=C:\ProgramData\NVIDIA Corporation\CUDA Samples\v9.1
NVCUDASAMPLES_ROOT=C:\ProgramData\NVIDIA Corporation\CUDA Samples\v9.1
NVTOOLSEXT_PATH=C:\Program Files\NVIDIA Corporation\NvToolsExt\
OS=Windows_NT
Path=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.1\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.1\libnvvp;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Windows Live\Shared;C:\MiKTeX 2.9\miktex\bin\x64\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Programming\MSYS2\mingw64\bin;C:\Programming\Java\jdk1.8.0_162\bin;C:\Programming\Python365;C:\Programming\Python365\Lib;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\bin\Hostx64\x64
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
PROCESSOR_ARCHITECTURE=AMD64
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 94 Stepping 3, GenuineIntel
PROCESSOR_LEVEL=6
PROCESSOR_REVISION=5e03
ProgramData=C:\ProgramData
ProgramFiles=C:\Program Files
ProgramFiles(x86)=C:\Program Files (x86)
ProgramW6432=C:\Program Files
PROMPT=$P$G
PSModulePath=C:\Windows\system32\WindowsPowerShell\v1.0\Modules\
PUBLIC=C:\Users\Public
PYTHONPATH=C:\Programming\Python365;C:\Programming\Python365\Lib
SESSIONNAME=Console
SystemDrive=C:
SystemRoot=C:\Windows
VS120COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\
windir=C:\Windows
The way I managed to link cuRAND and generate the dll was using Visual Studio instead of the command line. Somehow it has the proper arguments for nvcc to link cuRAND that, I suspect, my environment variables are missing.
Thanks to Robert Crovella for also giving it a try and providing input.

Issues with building any C++ on Sublime Text 3

So I'm trying to build a C++ program on Sublime Text 3 but I keep getting a variety of issues. I've tried numerous video and web tutorials and have all failed me, so please don't recommend me any. Here's what I've done:
I am building with build file CPP.sublime-build:
{
"cmd":["bash", "-c", "g++ -std=c++14 -Wall '${file}' -o '${file_path}/${file_base_name}' && '${file_path}/${file_base_name}'"],
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"working_dir": "${file_path}",
"selector": "source.c, source.c++",
"variants":
[
{
"name": "Run",
"cmd":["bash", "-c", "g++ -std=c++14 '${file}' -o '${file_path}/${file_base_name}' && '${file_path}/${file_base_name}'"]
}
]
}
I've installed MinGW, and have edited my environmental PATH variable to include C:\MinGW\bin.
I have HelloWorld.cpp below, in directory C:\Users\kevin\Desktop\C++:
#include <iostream>
#include <string>
int main(){
std::cout << "Hello World!" << std::endl;
std::cout << "Hello World!" << std::endl;
std::cout << "Hello World!" << std::endl;
std::cout << "Hello World!" << std::endl;
return 0;
}
When I try to build this file (Ctrl-B) in Sublime Text, however, I get this long error:
[WinError 2] The system cannot find the file specified
[cmd: ['bash', '-c', "g++ -std=c++ -Wall 'C:\\Users\\kevin\\Desktop\\C++\\HelloWorld.cpp' -o 'C:\\Users\\kevin\\Desktop\\C++/HelloWorld' && 'C:\\Users\\kevin\\Desktop\\C++/HelloWorld'"]]
[dir: C:\Users\kevin\Desktop\C++]
[path: C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\WIDCOMM\Bluetooth Software\;C:\Program Files\WIDCOMM\Bluetooth Software\syswow64;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Bitvise SSH Client;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\Microsoft SQL Server\120\DTS\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\ManagementStudio\;C:\Program Files (x86)\Microsoft SQL Server\120\DTS\Binn\;C:\Program Files\Java\jdk1.8.0_121\bin;C:\Program Files (x86)\Skype\Phone\;C:\MinGW\bin;C:\Users\kevin\AppData\Local\Microsoft\WindowsApps;]
[Finished]
Building with the built-in C++ Single File generates another error:
Access is denied.
[Finished in 2.6s with exit code 1]
Additional details: Running Windows 10, x64 based PC.
Any ideas?
EDIT: DO NOT recommend me Visual Studio- it works but I'm a minimalist and hate it.

error MSB3721 when building CUDA Samples for VS2010, WINDOWS7, 64BIT

I have installed CUDA 5.5 Production Release with the default installation directory structure.
Then I follow the NVIDIA CUDA Getting Started Guide for Microsoft Windows.
The nvcc -V test and deviceQuery.exe and bandwidthTest.exe works fine in windows command promote.
Then I try to build bandwidthTest project(located in the NVIDIA Corporation\CUDA Samples\v5.5\1_Utilities\bandwidthTest)
Some errors pop up as follows:
1>------ Build started: Project: bandwidthTest, Configuration: Release x64 ------
1>Build started 2013/11/19 13:13:41.
1>AddCudaCompileDeps:
1>Skipping target "AddCudaCompileDeps" because all output files are up-to-date with respect to the input files.
1>AddCudaCompilePropsDeps:
1>Skipping target "AddCudaCompilePropsDeps" because all output files are up-to-date with respect to the input files.
1>CudaBuild:
1> Compiling CUDA source file bandwidthTest.cu...
1> 'C:\Users\IMI_User\AppData\Local\Temp' is not recognized as an internal or external command,
1> operable program or batch file.
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\BuildCustomizations\CUDA 5.5.targets(592,9): error MSB3721: The command ""C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.5\bin\nvcc.exe" -gencode=arch=compute_10,code=\"sm_10,compute_10\" -gencode=arch=compute_20,code=\"sm_20,compute_20\" -gencode=arch=compute_30,code=\"sm_30,compute_30\" -gencode=arch=compute_35,code=\"sm_35,compute_35\" --use-local-env --cl-version 2010 -ccbin "c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\x86_amd64" -I./ -I../../common/inc -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.5\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.5\include" --keep-dir x64\Release -maxrregcount=0 --machine 64 --compile -cudart static -Xcompiler "/wd 4819" -DWIN32 -D_MBCS -Xcompiler "/EHsc /W3 /nologo /O2 /Zi /MT " -o x64/Release/bandwidthTest.cu.obj "C:\ProgramData\NVIDIA Corporation\CUDA Samples\v5.5\1_Utilities\bandwidthTest\bandwidthTest.cu"" exited with code 1.
1>
1>Build FAILED.
1>
1) I fould one solution on the internet :https://devtalk.nvidia.com/default/topic/533797/visual-studio-2010-how-to-fix-error-msb3721-exiting-with-code-1/
which is quite similar to my situation. It mentions that it is the antivirus software that causes this problem.
So I uninstalled any antivirus software and reinstall the CUDA 5.5 product. Restart the computer. But it didn't solve my problem.
2) I found another solution that should 'Run as a administrator'. Again, it won't help. CUDA 4.2. toolbox & VS2010
I build another sample project deviceQuery located in the NVIDIA Corporation\CUDA Samples\v5.5\1_Utilities\deviceQuery and sucessfully.
Can anyone help me with the problem I have here?
bandwidthTest_vs2010.log
Build started 2013/11/20 12:24:19.
Environment at start of build:
MSBuildExtensionsPath32 = C:\Program Files (x86)\MSBuild
MSBuildExtensionsPath64 = C:\Program Files\MSBuild
MSBuildExtensionsPath = C:\Program Files (x86)\MSBuild
LOCALAPPDATA = C:\Users\IMI_User\AppData\Local
ALLUSERSPROFILE = C:\ProgramData
APPDATA = C:\Users\IMI_User\AppData\Roaming
BURN_AUTOPLAY = C:\Program Files (x86)\Roxio\OEM\Roxio Burn\
CommonProgramFiles = C:\Program Files (x86)\Common Files
CommonProgramW6432 = C:\Program Files\Common Files
COMPUTERNAME = IMI_USER-PC
ComSpec = C:\Windows\system32\cmd.exe
CUDA_PATH = C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.5
CUDA_PATH_V5_5 = C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.5
EMC_AUTOPLAY = C:\Program Files (x86)\Common Files\Roxio Shared\OEM\
FP_NO_HOST_CHECK = NO
GNUPLOT_LIB = C:\tmp\gnuplot\demo
HOMEDRIVE = C:
HOMEPATH = \Users\IMI_User
LOGONSERVER = \\IMI_USER-PC
MOZ_PLUGIN_PATH = C:\Program Files (x86)\Foxit Software\Foxit Reader\plugins\
NUMBER_OF_PROCESSORS = 4
NVCUDASAMPLES5_5_ROOT = C:\ProgramData\NVIDIA Corporation\CUDA Samples\v5.5
NVCUDASAMPLES_ROOT = C:\ProgramData\NVIDIA Corporation\CUDA Samples\v5.5
NVTOOLSEXT_PATH = C:\Program Files\NVIDIA Corporation\NvToolsExt\
OS = Windows_NT
Path = C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.5\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.5\libnvvp;C:\Program Files\MiKTeX 2.9\miktex\bin\x64\;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Intel\Services\IPT\;C:\Program Files (x86)\NTRU Cryptosystems\NTRU TCG Software Stack\bin\;C:\Program Files\NTRU Cryptosystems\NTRU TCG Software Stack\bin\;C:\Program Files\Dell\Dell Data Protection\Access\Advanced\Wave\Gemalto\Access Client\v5\;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files (x86)\Common Files\Roxio Shared\DLLShared\;C:\Program Files (x86)\Common Files\Roxio Shared\OEM\DLLShared\;C:\Program Files (x86)\Common Files\Roxio Shared\OEM\DLLShared\;C:\Program Files (x86)\Common Files\Roxio Shared\OEM\12.0\DLLShared\;C:\Program Files (x86)\Roxio\OEM\AudioCore\;c:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\Tools\Binn\; C:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files (x86)\MATLAB\R2011b\bin\win32;C:\Program Files (x86)\Common Files\Autodesk Shared\;C:\Program Files\Common Files\Autodesk Shared\;C:\Program Files (x86)\opencv\build\x86\vc10\bin;C:\Program Files (x86)\opencv\build\common\tbb\ia32\vc10;C:\Deploy\bin\Win32\Release;C:\Program Files\MATLAB\R2011b\bin;D:\Research\SQA\CODES\opensmile-2.0-rc1\msvcbuild;C:\Users\IMI_User\AppData\Local\Enthought\Canopy\User\Scripts;C:\Program Files (x86)\Git\cmd;C:\Users\IMI_User\AppData\Local\Enthought\Canopy\User\Scripts;C:\Users\IMI_User\AppData\Local\Enthought\Canopy\User;C:\Users\IMI_User\AppData\Local\Enthought\Canopy\System\Scripts
PATHEXT = .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
PBRT_SEARCHPATH = C:\pbrt-v1\pbrt-1.05\bin
PROCESSOR_ARCHITECTURE = x86
PROCESSOR_ARCHITEW6432 = AMD64
PROCESSOR_IDENTIFIER = Intel64 Family 6 Model 42 Stepping 7, GenuineIntel
PROCESSOR_LEVEL = 6
PROCESSOR_REVISION = 2a07
ProgramData = C:\ProgramData
ProgramFiles = C:\Program Files (x86)
ProgramW6432 = C:\Program Files
PSModulePath = C:\Windows\system32\WindowsPowerShell\v1.0\Modules\
PUBLIC = C:\Users\Public
RCAUTOPLAY = C:\Program Files (x86)\Roxio\OEM\Roxio Central 5\
SESSIONNAME = Console
SystemDrive = C:
SystemRoot = C:\Windows
TEMP = C:\Users\IMI_User\AppData\Local\Temp
TMP = C:\Users\IMI_User\AppData\Local\TEMP_~1
USERDOMAIN = IMI_User-PC
USERNAME = IMI_User
USERPROFILE = C:\Users\IMI_User
VisualStudioDir = C:\Users\IMI_User\Documents\Visual Studio 2010
VS100COMNTOOLS = c:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Tools\
windir = C:\Windows
windows_tracing_flags = 3
windows_tracing_logfile = C:\BVTBin\Tests\installpackage\csilogfile.log
12:24:19.379 1>Project "C:\ProgramData\NVIDIA Corporation\CUDA Samples\v5.5\1_Utilities\bandwidthTest\bandwidthTest_vs2010.vcxproj" on node 2 (rebuild target(s)).
12:24:19.379 1>Building with tools version "4.0".
12:24:19.379 1>Target "_CheckForInvalidConfigurationAndPlatform: (TargetId:2)" in file "c:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.Targets" from project "C:\ProgramData\NVIDIA Corporation\CUDA Samples\v5.5\1_Utilities\bandwidthTest\bandwidthTest_vs2010.vcxproj" (entry point):
Task "Error" skipped, due to false condition; ( '$(_InvalidConfigurationError)' == 'true' ) was evaluated as ( '' == 'true' ).
Task "Warning" skipped, due to false condition; ( '$(_InvalidConfigurationWarning)' == 'true' ) was evaluated as ( '' == 'true' ).
Using "Message" task from assembly "Microsoft.Build.Tasks.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
Task "Message" (TaskId:2)
Configuration=Release (TaskId:2)
Done executing task "Message". (TaskId:2)
Task "Message" (TaskId:3)
Platform=x64 (TaskId:3)
Done executing task "Message". (TaskId:3)
Task "Error" skipped, due to false condition; ('$(OutDir)' != '' and !HasTrailingSlash('$(OutDir)')) was evaluated as ('../../bin/win64/Release/' != '' and !HasTrailingSlash('../../bin/win64/Release/')).
Task "Error" skipped, due to false condition; ('$(BaseIntermediateOutputPath)' != '' and !HasTrailingSlash('$(BaseIntermediateOutputPath)')) was evaluated as ('obj\' != '' and !HasTrailingSlash('obj\')).
Task "Error" skipped, due to false condition; ('$(IntermediateOutputPath)' != '' and !HasTrailingSlash('$(IntermediateOutputPath)')) was evaluated as ('x64/Release/' != '' and !HasTrailingSlash('x64/Release/')).
12:24:19.400 1>Done building target "_CheckForInvalidConfigurationAndPlatform" in project "bandwidthTest_vs2010.vcxproj".: (TargetId:2)
12:24:19.400 1>Target "_DetermineManagedStateFromCL: (TargetId:3)" in file "C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets" from project "C:\ProgramData\NVIDIA Corporation\CUDA Samples\v5.5\1_Utilities\bandwidthTest\bandwidthTest_vs2010.vcxproj" (target "Rebuild" depends on it):
12:24:19.400 1>Done building target "_DetermineManagedStateFromCL" in project "bandwidthTest_vs2010.vcxproj".: (TargetId:3)
12:24:19.400 1>Target "_PrepareForRebuild: (TargetId:4)" in file "C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.BuildSteps.Targets" from project "C:\ProgramData\NVIDIA Corporation\CUDA Samples\v5.5\1_Utilities\bandwidthTest\bandwidthTest_vs2010.vcxproj" (target "Rebuild" depends on it):
12:24:19.401 1>Done building target "_PrepareForRebuild" in project "bandwidthTest_vs2010.vcxproj".: (TargetId:4)
12:24:19.401 1>Target "BeforeRebuild: (TargetId:5)" in file "c:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.Targets" from project "C:\ProgramData\NVIDIA Corporation\CUDA Samples\v5.5\1_Utilities\bandwidthTest\bandwidthTest_vs2010.vcxproj" (target "Rebuild" depends on it):
12:24:19.401 1>Done building target "BeforeRebuild" in project "bandwidthTest_vs2010.vcxproj".: (TargetId:5)
12:24:19.401 1>Target "_PrepareForClean: (TargetId:6)" in file "C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.BuildSteps.Targets" from project "C:\ProgramData\NVIDIA Corporation\CUDA Samples\v5.5\1_Utilities\bandwidthTest\bandwidthTest_vs2010.vcxproj" (target "Clean" depends on it):
Task "Delete" skipped, due to false condition; (Exists($(LastBuildState))) was evaluated as (Exists(x64/Release/bandwidthTest.lastbuildstate)).
12:24:19.401 1>Done building target "_PrepareForClean" in project "bandwidthTest_vs2010.vcxproj".: (TargetId:6)
12:24:19.401 1>Target "BeforeClean: (TargetId:7)" in file "c:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.Targets" from project "C:\ProgramData\NVIDIA Corporation\CUDA Samples\v5.5\1_Utilities\bandwidthTest\bandwidthTest_vs2010.vcxproj" (target "Clean" depends on it):
12:24:19.401 1>Done building target "BeforeClean" in project "bandwidthTest_vs2010.vcxproj".: (TargetId:7)
Target "UnmanagedUnregistration" skipped, due to false condition; ((('$(_AssemblyTimestampBeforeCompile)' != '$(_AssemblyTimestampAfterCompile)' or '$(RegisterForComInterop)' != 'true' or '$(OutputType)' != 'library') or
('$(_AssemblyTimestampBeforeCompile)' == '')) and
Exists('#(_UnmanagedRegistrationCache)')) was evaluated as ((('' != '' or '' != 'true' or 'exe' != 'library') or
('' == '')) and
Exists('obj\bandwidthTest_vs2010.vcxproj.UnmanagedRegistration.cache')).
12:24:19.401 1>Target "CoreClean: (TargetId:8)" in file "c:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.Targets" from project "C:\ProgramData\NVIDIA Corporation\CUDA Samples\v5.5\1_Utilities\bandwidthTest\bandwidthTest_vs2010.vcxproj" (target "Clean" depends on it):
Using "Delete" task from assembly "Microsoft.Build.Tasks.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
Task "Delete" (TaskId:4)
Done executing task "Delete". (TaskId:4)
Using "ReadLinesFromFile" task from assembly "Microsoft.Build.Tasks.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
Task "ReadLinesFromFile" (TaskId:5)
Done executing task "ReadLinesFromFile". (TaskId:5)
Using "FindUnderPath" task from assembly "Microsoft.Build.Tasks.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
Task "FindUnderPath" (TaskId:6)
Comparison path is "../../bin/win64/Release/". (TaskId:6)
Done executing task "FindUnderPath". (TaskId:6)
Task "FindUnderPath" (TaskId:7)
Comparison path is "x64/Release/". (TaskId:7)
Done executing task "FindUnderPath". (TaskId:7)
Task "Delete" (TaskId:8)
Done executing task "Delete". (TaskId:8)
Using "RemoveDuplicates" task from assembly "Microsoft.Build.Tasks.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
Task "RemoveDuplicates" (TaskId:9)
Done executing task "RemoveDuplicates". (TaskId:9)
Using "MakeDir" task from assembly "Microsoft.Build.Tasks.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
Task "MakeDir" (TaskId:10)
Done executing task "MakeDir". (TaskId:10)
Using "WriteLinesToFile" task from assembly "Microsoft.Build.Tasks.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
Task "WriteLinesToFile" (TaskId:11)
Done executing task "WriteLinesToFile". (TaskId:11)
12:24:19.404 1>Done building target "CoreClean" in project "bandwidthTest_vs2010.vcxproj".: (TargetId:8)
Target "AssignProjectConfiguration" skipped, due to false condition; ('#(ProjectReference)'!='') was evaluated as (''!='').
12:24:19.404 1>Target "_SplitProjectReferencesByFileExistence: (TargetId:9)" in file "c:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.Targets" from project "C:\ProgramData\NVIDIA Corporation\CUDA Samples\v5.5\1_Utilities\bandwidthTest\bandwidthTest_vs2010.vcxproj" (target "CleanReferencedProjects" depends on it):
Task "ResolveNonMSBuildProjectOutput" skipped, due to false condition; ('$(BuildingInsideVisualStudio)'=='true' and '#(ProjectReferenceWithConfiguration)'!='') was evaluated as ('true'=='true' and ''!='').
12:24:19.404 1>Done building target "_SplitProjectReferencesByFileExistence" in project "bandwidthTest_vs2010.vcxproj".: (TargetId:9)
12:24:19.404 1>Target "CleanReferencedProjects: (TargetId:10)" in file "c:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.Targets" from project "C:\ProgramData\NVIDIA Corporation\CUDA Samples\v5.5\1_Utilities\bandwidthTest\bandwidthTest_vs2010.vcxproj" (target "Clean" depends on it):
Task "MSBuild" skipped, due to false condition; ('$(BuildingInsideVisualStudio)' != 'true' and '$(BuildProjectReferences)' == 'true' and '#(_MSBuildProjectReferenceExistent)' != '') was evaluated as ('true' != 'true' and 'true' == 'true' and '' != '').
12:24:19.404 1>Done building target "CleanReferencedProjects" in project "bandwidthTest_vs2010.vcxproj".: (TargetId:10)
12:24:19.404 1>Target "CleanPublishFolder: (TargetId:11)" in file "c:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.Targets" from project "C:\ProgramData\NVIDIA Corporation\CUDA Samples\v5.5\1_Utilities\bandwidthTest\bandwidthTest_vs2010.vcxproj" (target "Clean" depends on it):
Task "RemoveDir" skipped, due to false condition; ('$(PublishDir)'=='$(OutputPath)app.publish\' and Exists('$(PublishDir)')) was evaluated as ('C:\ProgramData\NVIDIA Corporation\CUDA Samples\v5.5\1_Utilities\bandwidthTest\x64\Release\app.publish\'=='C:\ProgramData\NVIDIA Corporation\CUDA Samples\v5.5\1_Utilities\bandwidthTest\x64\Release\app.publish\' and Exists('C:\ProgramData\NVIDIA Corporation\CUDA Samples\v5.5\1_Utilities\bandwidthTest\x64\Release\app.publish\')).
12:24:19.404 1>Done building target "CleanPublishFolder" in project "bandwidthTest_vs2010.vcxproj".: (TargetId:11)
12:24:19.404 1>Target "AfterClean: (TargetId:12)" in file "c:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.Targets" from project "C:\ProgramData\NVIDIA Corporation\CUDA Samples\v5.5\1_Utilities\bandwidthTest\bandwidthTest_vs2010.vcxproj" (target "Clean" depends on it):
12:24:19.404 1>Done building target "AfterClean" in project "bandwidthTest_vs2010.vcxproj".: (TargetId:12)
Target "EntityClean" skipped, due to false condition; ('#(EntityDeploy)' != '') was evaluated as ('' != '').
12:24:19.404 1>Target "BeforeCppClean: (TargetId:13)" in file "C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppClean.targets" from project "C:\ProgramData\NVIDIA Corporation\CUDA Samples\v5.5\1_Utilities\bandwidthTest\bandwidthTest_vs2010.vcxproj" (target "CppClean" depends on it):
12:24:19.404 1>Done building target "BeforeCppClean" in project "bandwidthTest_vs2010.vcxproj".: (TargetId:13)
12:24:19.404 1>Target "CoreCppClean: (TargetId:14)" in file "C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppClean.targets" from project "C:\ProgramData\NVIDIA Corporation\CUDA Samples\v5.5\1_Utilities\bandwidthTest\bandwidthTest_vs2010.vcxproj" (target "CppClean" depends on it):
Task "MakeDir" (TaskId:12)
Done executing task "MakeDir". (TaskId:12)
Using "CppClean" task from assembly "Microsoft.Build.CppTasks.Common, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
Task "CppClean" (TaskId:13)
Done executing task "CppClean". (TaskId:13)
Task "WriteLinesToFile" (TaskId:14)
Done executing task "WriteLinesToFile". (TaskId:14)
12:24:19.409 1>Done building target "CoreCppClean" in project "bandwidthTest_vs2010.vcxproj".: (TargetId:14)
12:24:19.409 1>Target "AfterCppClean: (TargetId:15)" in file "C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppClean.targets" from project "C:\ProgramData\NVIDIA Corporation\CUDA Samples\v5.5\1_Utilities\bandwidthTest\bandwidthTest_vs2010.vcxproj" (target "CppClean" depends on it):
12:24:19.409 1>Done building target "AfterCppClean" in project "bandwidthTest_vs2010.vcxproj".: (TargetId:15)
12:24:19.409 1>Target "PGInstrumentedClean: (TargetId:16)" in file "C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppClean.targets" from project "C:\ProgramData\NVIDIA Corporation\CUDA Samples\v5.5\1_Utilities\bandwidthTest\bandwidthTest_vs2010.vcxproj" (target "CppClean" depends on it):
Task "Delete" (TaskId:15)
Done executing task "Delete". (TaskId:15)
12:24:19.409 1>Done building target "PGInstrumentedClean" in project "bandwidthTest_vs2010.vcxproj".: (TargetId:16)
12:24:19.409 1>Target "InitializeCudaHostProperties: (TargetId:17)" in file "C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\BuildCustomizations\CUDA 5.5.targets" from project "C:\ProgramData\NVIDIA Corporation\CUDA Samples\v5.5\1_Utilities\bandwidthTest\bandwidthTest_vs2010.vcxproj" (target "AddCudaCompileMetadata" depends on it):
12:24:19.409 1>Done building target "InitializeCudaHostProperties" in project "bandwidthTest_vs2010.vcxproj".: (TargetId:17)
12:24:19.410 1>Target "AddCudaCompileMetadata: (TargetId:18)" in file "C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\BuildCustomizations\CUDA 5.5.targets" from project "C:\ProgramData\NVIDIA Corporation\CUDA Samples\v5.5\1_Utilities\bandwidthTest\bandwidthTest_vs2010.vcxproj" (target "CudaClean" depends on it):
Building target "AddCudaCompileMetadata" completely.
No input files were specified.
Using "SanitizePaths" task from assembly "C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\BuildCustomizations\Nvda.Build.CudaTasks.v5.5.dll".
Task "SanitizePaths" (TaskId:16)
Done executing task "SanitizePaths". (TaskId:16)
Task "ReadLinesFromFile" (TaskId:17)
Done executing task "ReadLinesFromFile". (TaskId:17)
Using "SplitToItemMetadata" task from assembly "C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\BuildCustomizations\Nvda.Build.CudaTasks.v5.5.dll".
Task "SplitToItemMetadata" (TaskId:18)
Done executing task "SplitToItemMetadata". (TaskId:18)
12:24:19.422 1>Done building target "AddCudaCompileMetadata" in project "bandwidthTest_vs2010.vcxproj".: (TargetId:18)
12:24:19.422 1>Target "ValidateCudaBuild: (TargetId:19)" in file "C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\BuildCustomizations\CUDA 5.5.targets" from project "C:\ProgramData\NVIDIA Corporation\CUDA Samples\v5.5\1_Utilities\bandwidthTest\bandwidthTest_vs2010.vcxproj" (target "CudaClean" depends on it):
Task "Error" skipped, due to false condition; (!Exists($(CudaToolkitDir))) was evaluated as (!Exists(C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.5\)).
12:24:19.422 1>Done building target "ValidateCudaBuild" in project "bandwidthTest_vs2010.vcxproj".: (TargetId:19)
12:24:19.422 1>Target "CudaClean: (TargetId:20)" in file "C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\BuildCustomizations\CUDA 5.5.targets" from project "C:\ProgramData\NVIDIA Corporation\CUDA Samples\v5.5\1_Utilities\bandwidthTest\bandwidthTest_vs2010.vcxproj" (target "CppClean" depends on it):
Building target "CudaClean" completely.
No input files were specified.
Initializing task factory "XamlTaskFactory" from assembly "Microsoft.Build.Tasks.v4.0".
Using "CudaCompile" task from the task factory "XamlTaskFactory".
Task "CudaCompile" (TaskId:19)
cmd.exe /C "C:\Users\IMI_User\AppData\Local\Temp;\8f2923f4a8704bedb3b1e52239ac5f64.cmd" (TaskId:19)
"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.5\bin\nvcc.exe" -ccbin "c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\x86_amd64" -I./ -I../../common/inc -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.5\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.5\include" --keep-dir x64\Release -maxrregcount=0 --machine 64 --compile -Xcompiler "/wd 4819" -DWIN32 -D_MBCS -Xcompiler "/EHsc /W3 /nologo /O2 /Zi /MT " -o x64/Release/bandwidthTest.cu.obj "C:\ProgramData\NVIDIA Corporation\CUDA Samples\v5.5\1_Utilities\bandwidthTest\bandwidthTest.cu" -clean (TaskId:19)
'C:\Users\IMI_User\AppData\Local\Temp' is not recognized as an internal or external command, (TaskId:19)
operable program or batch file. (TaskId:19)
12:24:19.668 1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\BuildCustomizations\CUDA 5.5.targets(758,9): error MSB3721: The command ""C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.5\bin\nvcc.exe" -ccbin "c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\x86_amd64" -I./ -I../../common/inc -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.5\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.5\include" --keep-dir x64\Release -maxrregcount=0 --machine 64 --compile -Xcompiler "/wd 4819" -DWIN32 -D_MBCS -Xcompiler "/EHsc /W3 /nologo /O2 /Zi /MT " -o x64/Release/bandwidthTest.cu.obj "C:\ProgramData\NVIDIA Corporation\CUDA Samples\v5.5\1_Utilities\bandwidthTest\bandwidthTest.cu" -clean" exited with code 1.
Done executing task "CudaCompile" -- FAILED. (TaskId:19)
12:24:19.669 1>Done building target "CudaClean" in project "bandwidthTest_vs2010.vcxproj" -- FAILED.: (TargetId:20)
12:24:19.669 1>Done Building Project "C:\ProgramData\NVIDIA Corporation\CUDA Samples\v5.5\1_Utilities\bandwidthTest\bandwidthTest_vs2010.vcxproj" (rebuild target(s)) -- FAILED.
Project Performance Summary:
290 ms C:\ProgramData\NVIDIA Corporation\CUDA Samples\v5.5\1_Utilities\bandwidthTest\bandwidthTest_vs2010.vcxproj 1 calls
290 ms rebuild 1 calls
Target Performance Summary:
0 ms CleanReferencedProjects 1 calls
0 ms CleanPublishFolder 1 calls
0 ms AfterCppClean 1 calls
0 ms PGInstrumentedClean 1 calls
0 ms ValidateCudaBuild 1 calls
0 ms BeforeCppClean 1 calls
0 ms BeforeClean 1 calls
0 ms _DetermineManagedStateFromCL 1 calls
0 ms _SplitProjectReferencesByFileExistence 1 calls
0 ms AfterClean 1 calls
0 ms InitializeCudaHostProperties 1 calls
0 ms BeforeRebuild 1 calls
0 ms _PrepareForClean 1 calls
1 ms _PrepareForRebuild 1 calls
3 ms CoreClean 1 calls
5 ms CoreCppClean 1 calls
12 ms AddCudaCompileMetadata 1 calls
21 ms _CheckForInvalidConfigurationAndPlatform 1 calls
247 ms CudaClean 1 calls
Task Performance Summary:
0 ms RemoveDuplicates 1 calls
0 ms FindUnderPath 2 calls
0 ms MakeDir 2 calls
1 ms WriteLinesToFile 2 calls
2 ms Delete 3 calls
2 ms SplitToItemMetadata 1 calls
2 ms CppClean 1 calls
3 ms ReadLinesFromFile 2 calls
3 ms SanitizePaths 1 calls
15 ms Message 2 calls
45 ms CudaCompile 1 calls
Build FAILED.
Time Elapsed 00:00:00.28
It looks like you have a ";" on the end of the path stored in your TEMP environment variable. This should be removed as the TEMP variable is only a single path, not a list of paths. After modifying the TEMP variable in the OS, restart Visual Studio.
In Windows 7, type advanced system settings in the Start button search field. In the Advanced tab, click Environment Variables. Click TEMP in User variables, then click Edit and remove the ";" from the end of the path.
Edit:
I just noticed that in the environment variable list at the beginning of the log, there is no ";" at the end of the TEMP path, so this might not be the solution.
The best clue we have to what's going on is this line:
cmd.exe /C "C:\Users\IMI_User\AppData\Local\Temp;\8f2923f4a8704bedb3b1e52239ac5f64.cmd" (TaskId:19)
The ";" after Temp is what is breaking the build.