VS 2017 cmake error - cmake

I am trying to build my code using 3d builder. Am using VS 2017 version. Previously it was working fine but after windows update while trying to open code using VS cmake compiler error. Hereby attaching the log files of error. Is anyone facing the same error? Could someone suggest a way to resolve it?
Build started 7/20/2018 6:39:28 PM.
Project "C:\code\dump64\CMakeFiles\3.8.20170425-g0257b-dirty\CompilerIdCXX\CompilerIdCXX.vcxproj" on node 1 (default targets).
PrepareForBuild:
Creating directory "Debug\".
Creating directory "Debug\CompilerIdCXX.tlog\".
InitializeBuildStatus:
Creating "Debug\CompilerIdCXX.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
ClCompile:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.14.26428\bin\HostX86\x64\CL.exe /c /nologo /W0 /WX- /diagnostics:classic /Od /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"Debug\\" /Fd"Debug\vc141.pdb" /Gd /TP /FC /errorReport:queue CMakeCXXCompilerId.cpp
CMakeCXXCompilerId.cpp
Link:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.14.26428\bin\HostX86\x64\link.exe /ERRORREPORT:QUEUE /OUT:".\CompilerIdCXX.exe" /INCREMENTAL:NO /NOLOGO kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /PDB:".\CompilerIdCXX.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:".\CompilerIdCXX.lib" /MACHINE:X64 Debug\CMakeCXXCompilerId.obj
LINK : fatal error LNK1104: cannot open file 'ucrtd.lib' [C:\code\dump64\CMakeFiles\3.8.20170425-g0257b-dirty\CompilerIdCXX\CompilerIdCXX.vcxproj]
Done Building Project "C:\code\dump64\CMakeFiles\3.8.20170425-g0257b-dirty\CompilerIdCXX\CompilerIdCXX.vcxproj" (default targets) -- FAILED.
Build FAILED.

Related

"cannot open file 'user32.lib'" when trying to use Visual Studio 2005 on Windows 10

I'm attempting to match output with a C++ Win32 executable compiled with Visual Studio 2005, so I'm trying to use that MSVC to do so. I have a project defined in CMake. I open "Visual Studio 2005 Command Prompt", but when I try to cmake -G "NMake Makefiles" .. I get LINK : fatal error LNK1104: cannot open file 'user32.lib'.
Here's the CMakeLists.txt:
cmake_minimum_required(VERSION 3.15)
# set the project name
project(LEGOStarWarsSaga)
# add the executable
add_executable(LEGOStarWarsSaga src/main.cpp)
Here's the Visual Studio 2005 Command Prompt output:
C:\Users\aprim\Documents\lstsc>mkdir build
C:\Users\aprim\Documents\lstsc>cd build
C:\Users\aprim\Documents\lstsc\build>cmake -G "NMake Makefiles" ..
-- The C compiler identification is MSVC 14.0.50727
-- The CXX compiler identification is MSVC 14.0.50727
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 8/VC/bin/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 8/VC/bin/cl.exe - broken
CMake Error at C:/Program Files/CMake/share/cmake-3.19/Modules/CMakeTestCCompiler.cmake:66 (message):
The C compiler
"C:/Program Files (x86)/Microsoft Visual Studio 8/VC/bin/cl.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: C:/Users/aprim/Documents/lstsc/build/CMakeFiles/CMakeTmp
Run Build Command(s):nmake /nologo cmTC_41947\fast && "C:\Program Files (x86)\Microsoft Visual Studio 8\VC\BIN\nmake.exe" -f CMakeFiles\cmTC_41947.dir\build.make /nologo -L CMakeFiles\cmTC_41947.dir\build
Building C object CMakeFiles/cmTC_41947.dir/testCCompiler.c.obj
C:\PROGRA~2\MI30EB~1\VC\bin\cl.exe #C:\Users\aprim\AppData\Local\Temp\nmBDB4.tmp
testCCompiler.c
Linking C executable cmTC_41947.exe
"C:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe --intdir=CMakeFiles\cmTC_41947.dir --rc=C:\PROGRA~2\MI30EB~1\VC\bin\rc.exe --mt=C:\PROGRA~2\MI30EB~1\VC\bin\mt.exe --manifests -- C:\PROGRA~2\MI30EB~1\VC\bin\link.exe /nologo #CMakeFiles\cmTC_41947.dir\objects1.rsp #C:\Users\aprim\AppData\Local\Temp\nmBE13.tmp
LINK Pass 1: command "C:\PROGRA~2\MI30EB~1\VC\bin\link.exe /nologo #CMakeFiles\cmTC_41947.dir\objects1.rsp /out:cmTC_41947.exe /implib:cmTC_41947.lib /pdb:C:\Users\aprim\Documents\lstsc\build\CMakeFiles\CMakeTmp\cmTC_41947.pdb /version:0.0 /machine:X86 /debug /INCREMENTAL:YES /subsystem:console kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:CMakeFiles\cmTC_41947.dir/intermediate.manifest CMakeFiles\cmTC_41947.dir/manifest.res" failed (exit code 1104) with the following output:
LINK : fatal error LNK1104: cannot open file 'user32.lib'
NMAKE : fatal error U1077: '"C:\Program Files\CMake\bin\cmake.exe"' : return code '0xffffffff'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 8\VC\BIN\nmake.exe"' : return code '0x2'
Stop.
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:4 (project)
-- Configuring incomplete, errors occurred!
See also "C:/Users/aprim/Documents/lstsc/build/CMakeFiles/CMakeOutput.log".
See also "C:/Users/aprim/Documents/lstsc/build/CMakeFiles/CMakeError.log".
After reading online, I've come to find that this is something to do with missing the Windows SDK. However, I have the Windows SDKs 7.1 and 10.0 installed. What am I missing?
Bonus points if there's a build tool that'll make this process (nearly) seamless for anyone cloning the project.
EDIT: Installing Visual Studio 2005 Professional with the full Visual C++ option installs the SDK properly, and the project builds. My worry is that not everyone has access to VS 2005 Pro.

No CMAKE_CUDA_COMPILER could be found

I am trying to generate a build system for CMake, but it throws an error at me, that I havent managed to fix for days. I have installed VC 2017 and CUDA latest release.
In my directory I created build directory and ran:
cmake ..
After that it started creating it but it didn't find the CUDA compiler
C:\Users\lenovo\Documents\Fax\4\Lasersko skeniranje\Projekat\Open3D-PointNet2-Semantic3D\tf_ops\build>cmake ..
-- Building for: Visual Studio 15 2017
-- The CXX compiler identification is MSVC 19.16.27027.1
-- The CUDA compiler identification is unknown
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at CMakeLists.txt:5 (project):
> No CMAKE_CUDA_COMPILER could be found.
>-- Configuring incomplete, errors occurred!
See also "C:/Users/lenovo/Documents/Fax/4/Lasersko skeniranje/Projekat/Open3D-PointNet2-Semantic3D/tf_ops/build/CMakeFiles/CMakeOutput.log".
The log file says:
Compiling the CUDA compiler identification source file "CMakeCUDACompilerId.cu" failed.
Compiler:
Build flags:
Id flags: -v;--keep;--keep-dir;tmp
The output was:
1
Microsoft (R) Build Engine version 15.9.21+g9802d43bc3 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
Build started 07-Mar-19 14:14:03.
Project "C:\Users\lenovo\Documents\Fax\4\Lasersko skeniranje\Projekat\Open3D-PointNet2-Semantic3D\tf_ops\build\CMakeFiles\3.13.3\CompilerIdCUDA\CompilerIdCUDA.vcxproj" on node 1 (default targets).
PrepareForBuild:
Creating directory "Debug\".
Creating directory "Debug\CompilerIdCUDA.tlog\".
InitializeBuildStatus:
Creating "Debug\CompilerIdCUDA.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
AddCudaCompileDeps:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x86\cl.exe /E /nologo /showIncludes /TP /D__CUDACC__ /D_MBCS /I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\include" /I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\bin" /I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\include" /I. /FIcuda_runtime.h /c "C:\Users\lenovo\Documents\Fax\4\Lasersko skeniranje\Projekat\Open3D-PointNet2-Semantic3D\tf_ops\build\CMakeFiles\3.13.3\CompilerIdCUDA\CMakeCUDACompilerId.cu"
Project "C:\Users\lenovo\Documents\Fax\4\Lasersko skeniranje\Projekat\Open3D-PointNet2-Semantic3D\tf_ops\build\CMakeFiles\3.13.3\CompilerIdCUDA\CompilerIdCUDA.vcxproj" (1) is building "C:\Users\lenovo\Documents\Fax\4\Lasersko skeniranje\Projekat\Open3D-PointNet2-Semantic3D\tf_ops\build\CMakeFiles\3.13.3\CompilerIdCUDA\CompilerIdCUDA.vcxproj" (1:2) on node 1 (CudaBuildCore target(s)).
CudaBuildCore:
Compiling CUDA source file CMakeCUDACompilerId.cu...
cmd.exe /C "C:\Users\lenovo\AppData\Local\Temp\tmp5b923de4e22e4f04be6ba6f85d34ca98.cmd"
"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\bin\nvcc.exe" -gencode=arch=compute_35,code=\"sm_35,compute_35\" --use-local-env -ccbin "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x86" -x cu -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\include" -G --keep-dir Debug -maxrregcount=0 --machine 32 --compile -cudart static -g -D_MBCS -Xcompiler "/EHsc /W0 /nologo /Od /FdDebug\vc141.pdb /FS /Zi /RTC1 /MDd " -o Debug\CMakeCUDACompilerId.cu.obj "C:\Users\lenovo\Documents\Fax\4\Lasersko skeniranje\Projekat\Open3D-PointNet2-Semantic3D\tf_ops\build\CMakeFiles\3.13.3\CompilerIdCUDA\CMakeCUDACompilerId.cu"
C:\Users\lenovo\Documents\Fax\4\Lasersko skeniranje\Projekat\Open3D-PointNet2-Semantic3D\tf_ops\build\CMakeFiles\3.13.3\CompilerIdCUDA>"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\bin\nvcc.exe" -gencode=arch=compute_35,code=\"sm_35,compute_35\" --use-local-env -ccbin "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x86" -x cu -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\include" -G --keep-dir Debug -maxrregcount=0 --machine 32 --compile -cudart static -g -D_MBCS -Xcompiler "/EHsc /W0 /nologo /Od /FdDebug\vc141.pdb /FS /Zi /RTC1 /MDd " -o Debug\CMakeCUDACompilerId.cu.obj "C:\Users\lenovo\Documents\Fax\4\Lasersko skeniranje\Projekat\Open3D-PointNet2-Semantic3D\tf_ops\build\CMakeFiles\3.13.3\CompilerIdCUDA\CMakeCUDACompilerId.cu"
nvcc fatal : 32 bit compilation is only supported for Microsoft Visual Studio 2013 and earlier
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\BuildCustomizations\CUDA 10.1.targets(757,9): error MSB3721: The command ""C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\bin\nvcc.exe" -gencode=arch=compute_35,code=\"sm_35,compute_35\" --use-local-env -ccbin "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x86" -x cu -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\include" -G --keep-dir Debug -maxrregcount=0 --machine 32 --compile -cudart static -g -D_MBCS -Xcompiler "/EHsc /W0 /nologo /Od /FdDebug\vc141.pdb /FS /Zi /RTC1 /MDd " -o Debug\CMakeCUDACompilerId.cu.obj "C:\Users\lenovo\Documents\Fax\4\Lasersko skeniranje\Projekat\Open3D-PointNet2-Semantic3D\tf_ops\build\CMakeFiles\3.13.3\CompilerIdCUDA\CMakeCUDACompilerId.cu"" exited with code 1. [C:\Users\lenovo\Documents\Fax\4\Lasersko skeniranje\Projekat\Open3D-PointNet2-Semantic3D\tf_ops\build\CMakeFiles\3.13.3\CompilerIdCUDA\CompilerIdCUDA.vcxproj]
Done Building Project "C:\Users\lenovo\Documents\Fax\4\Lasersko skeniranje\Projekat\Open3D-PointNet2-Semantic3D\tf_ops\build\CMakeFiles\3.13.3\CompilerIdCUDA\CompilerIdCUDA.vcxproj" (CudaBuildCore target(s)) -- FAILED.
Done Building Project "C:\Users\lenovo\Documents\Fax\4\Lasersko skeniranje\Projekat\Open3D-PointNet2-Semantic3D\tf_ops\build\CMakeFiles\3.13.3\CompilerIdCUDA\CompilerIdCUDA.vcxproj" (default targets) -- FAILED.
Build FAILED.
"C:\Users\lenovo\Documents\Fax\4\Lasersko skeniranje\Projekat\Open3D-PointNet2-Semantic3D\tf_ops\build\CMakeFiles\3.13.3\CompilerIdCUDA\CompilerIdCUDA.vcxproj" (default target) (1) ->
"C:\Users\lenovo\Documents\Fax\4\Lasersko skeniranje\Projekat\Open3D-PointNet2-Semantic3D\tf_ops\build\CMakeFiles\3.13.3\CompilerIdCUDA\CompilerIdCUDA.vcxproj" (CudaBuildCore target) (1:2) ->
(CudaBuildCore target) ->
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\BuildCustomizations\CUDA 10.1.targets(757,9): error MSB3721: The command ""C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\bin\nvcc.exe" -gencode=arch=compute_35,code=\"sm_35,compute_35\" --use-local-env -ccbin "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x86" -x cu -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\include" -G --keep-dir Debug -maxrregcount=0 --machine 32 --compile -cudart static -g -D_MBCS -Xcompiler "/EHsc /W0 /nologo /Od /FdDebug\vc141.pdb /FS /Zi /RTC1 /MDd " -o Debug\CMakeCUDACompilerId.cu.obj "C:\Users\lenovo\Documents\Fax\4\Lasersko skeniranje\Projekat\Open3D-PointNet2-Semantic3D\tf_ops\build\CMakeFiles\3.13.3\CompilerIdCUDA\CMakeCUDACompilerId.cu"" exited with code 1. [C:\Users\lenovo\Documents\Fax\4\Lasersko skeniranje\Projekat\Open3D-PointNet2-Semantic3D\tf_ops\build\CMakeFiles\3.13.3\CompilerIdCUDA\CompilerIdCUDA.vcxproj]
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:02.74
Compiling the CUDA compiler identification source file "CMakeCUDACompilerId.cu" failed.
Compiler:
Build flags:
Id flags: -v;--keep;--keep-dir;tmp
The output was:
1
Microsoft (R) Build Engine version 15.9.21+g9802d43bc3 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
Build started 07-Mar-19 14:14:06.
Project "C:\Users\lenovo\Documents\Fax\4\Lasersko skeniranje\Projekat\Open3D-PointNet2-Semantic3D\tf_ops\build\CMakeFiles\3.13.3\CompilerIdCUDA\CompilerIdCUDA.vcxproj" on node 1 (default targets).
PrepareForBuild:
Creating directory "Debug\".
Creating directory "Debug\CompilerIdCUDA.tlog\".
InitializeBuildStatus:
Creating "Debug\CompilerIdCUDA.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
AddCudaCompileDeps:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x86\cl.exe /E /nologo /showIncludes /TP /D__CUDACC__ /D_MBCS /I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\include" /I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\bin" /I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\include" /I. /FIcuda_runtime.h /c "C:\Users\lenovo\Documents\Fax\4\Lasersko skeniranje\Projekat\Open3D-PointNet2-Semantic3D\tf_ops\build\CMakeFiles\3.13.3\CompilerIdCUDA\CMakeCUDACompilerId.cu"
Project "C:\Users\lenovo\Documents\Fax\4\Lasersko skeniranje\Projekat\Open3D-PointNet2-Semantic3D\tf_ops\build\CMakeFiles\3.13.3\CompilerIdCUDA\CompilerIdCUDA.vcxproj" (1) is building "C:\Users\lenovo\Documents\Fax\4\Lasersko skeniranje\Projekat\Open3D-PointNet2-Semantic3D\tf_ops\build\CMakeFiles\3.13.3\CompilerIdCUDA\CompilerIdCUDA.vcxproj" (1:2) on node 1 (CudaBuildCore target(s)).
CudaBuildCore:
Compiling CUDA source file CMakeCUDACompilerId.cu...
cmd.exe /C "C:\Users\lenovo\AppData\Local\Temp\tmp6a6113e32a54449682bdc11103da68f9.cmd"
"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\bin\nvcc.exe" -gencode=arch=compute_35,code=\"sm_35,compute_35\" --use-local-env -ccbin "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x86" -x cu -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\include" -G --keep-dir Debug -maxrregcount=0 --machine 32 --compile -cudart static -g -D_MBCS -Xcompiler "/EHsc /W0 /nologo /Od /FdDebug\vc141.pdb /FS /Zi /RTC1 /MDd " -o Debug\CMakeCUDACompilerId.cu.obj "C:\Users\lenovo\Documents\Fax\4\Lasersko skeniranje\Projekat\Open3D-PointNet2-Semantic3D\tf_ops\build\CMakeFiles\3.13.3\CompilerIdCUDA\CMakeCUDACompilerId.cu"
C:\Users\lenovo\Documents\Fax\4\Lasersko skeniranje\Projekat\Open3D-PointNet2-Semantic3D\tf_ops\build\CMakeFiles\3.13.3\CompilerIdCUDA>"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\bin\nvcc.exe" -gencode=arch=compute_35,code=\"sm_35,compute_35\" --use-local-env -ccbin "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x86" -x cu -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\include" -G --keep-dir Debug -maxrregcount=0 --machine 32 --compile -cudart static -g -D_MBCS -Xcompiler "/EHsc /W0 /nologo /Od /FdDebug\vc141.pdb /FS /Zi /RTC1 /MDd " -o Debug\CMakeCUDACompilerId.cu.obj "C:\Users\lenovo\Documents\Fax\4\Lasersko skeniranje\Projekat\Open3D-PointNet2-Semantic3D\tf_ops\build\CMakeFiles\3.13.3\CompilerIdCUDA\CMakeCUDACompilerId.cu"
nvcc fatal : 32 bit compilation is only supported for Microsoft Visual Studio 2013 and earlier
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\BuildCustomizations\CUDA 10.1.targets(757,9): error MSB3721: The command ""C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\bin\nvcc.exe" -gencode=arch=compute_35,code=\"sm_35,compute_35\" --use-local-env -ccbin "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x86" -x cu -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\include" -G --keep-dir Debug -maxrregcount=0 --machine 32 --compile -cudart static -g -D_MBCS -Xcompiler "/EHsc /W0 /nologo /Od /FdDebug\vc141.pdb /FS /Zi /RTC1 /MDd " -o Debug\CMakeCUDACompilerId.cu.obj "C:\Users\lenovo\Documents\Fax\4\Lasersko skeniranje\Projekat\Open3D-PointNet2-Semantic3D\tf_ops\build\CMakeFiles\3.13.3\CompilerIdCUDA\CMakeCUDACompilerId.cu"" exited with code 1. [C:\Users\lenovo\Documents\Fax\4\Lasersko skeniranje\Projekat\Open3D-PointNet2-Semantic3D\tf_ops\build\CMakeFiles\3.13.3\CompilerIdCUDA\CompilerIdCUDA.vcxproj]
Done Building Project "C:\Users\lenovo\Documents\Fax\4\Lasersko skeniranje\Projekat\Open3D-PointNet2-Semantic3D\tf_ops\build\CMakeFiles\3.13.3\CompilerIdCUDA\CompilerIdCUDA.vcxproj" (CudaBuildCore target(s)) -- FAILED.
Done Building Project "C:\Users\lenovo\Documents\Fax\4\Lasersko skeniranje\Projekat\Open3D-PointNet2-Semantic3D\tf_ops\build\CMakeFiles\3.13.3\CompilerIdCUDA\CompilerIdCUDA.vcxproj" (default targets) -- FAILED.
Build FAILED.
"C:\Users\lenovo\Documents\Fax\4\Lasersko skeniranje\Projekat\Open3D-PointNet2-Semantic3D\tf_ops\build\CMakeFiles\3.13.3\CompilerIdCUDA\CompilerIdCUDA.vcxproj" (default target) (1) ->
"C:\Users\lenovo\Documents\Fax\4\Lasersko skeniranje\Projekat\Open3D-PointNet2-Semantic3D\tf_ops\build\CMakeFiles\3.13.3\CompilerIdCUDA\CompilerIdCUDA.vcxproj" (CudaBuildCore target) (1:2) ->
(CudaBuildCore target) ->
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\BuildCustomizations\CUDA 10.1.targets(757,9): error MSB3721: The command ""C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\bin\nvcc.exe" -gencode=arch=compute_35,code=\"sm_35,compute_35\" --use-local-env -ccbin "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x86" -x cu -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\include" -G --keep-dir Debug -maxrregcount=0 --machine 32 --compile -cudart static -g -D_MBCS -Xcompiler "/EHsc /W0 /nologo /Od /FdDebug\vc141.pdb /FS /Zi /RTC1 /MDd " -o Debug\CMakeCUDACompilerId.cu.obj "C:\Users\lenovo\Documents\Fax\4\Lasersko skeniranje\Projekat\Open3D-PointNet2-Semantic3D\tf_ops\build\CMakeFiles\3.13.3\CompilerIdCUDA\CMakeCUDACompilerId.cu"" exited with code 1. [C:\Users\lenovo\Documents\Fax\4\Lasersko skeniranje\Projekat\Open3D-PointNet2-Semantic3D\tf_ops\build\CMakeFiles\3.13.3\CompilerIdCUDA\CompilerIdCUDA.vcxproj]
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:02.65
Any idea? I cant seem to resolve the issue... I am running Win10
It looks like you are expected to specify the full path to nvcc by hand. I don't like the idea, though.
You do that this way:
cmake -DCMAKE_CUDA_COMPILER:PATH=/usr/local/cuda/bin/nvcc ...other cmake options...
That will compile things as expected, except it doesn't automatically add the include folder. I'm still looking at how to handle that second part without including the FindCUDA.cmake file.
According to the logs, the problem is nvcc fatal : 32 bit compilation is only supported for Microsoft Visual Studio 2013 and earlier when compiling CMakeCUDACompilerId.cu, which is used internally by CMake to make sure the compiler is working.
For some reasons, CMake decided to compile the file in 32 bits, which is not supported anymore. As CMake version was not specified, I would suggest updating CMake.
Try
cmake -G "Microsoft Visual Studio 15 2017 Win64" ..
I know this is an old question, but I faced same problem and maybe, the solution I took could help anyone else.
Actually, I always install CUDA as custom installation since I don't want samples and doc to be installed. At first time I installed I forgot to tick Visual Studio integration option. That made for some reason CUDA compiler not be visible. After I reinstalled CUDA ticking the option it worked.

C compiler identification is unknown despite setting CC and CXX variables

I'm using the command:
cmake CC="C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\cl.exe"
CXX="C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\cl.exe" -G "Visual Studio 12
Win64" -DBOOST_ROOT="c:\local\boost_1_56_0" -DBOOST_LIBRARYDIR="c:\local\boost_1_56_0\lib64-
msvc-12.0" ..
It says:
The C compiler identification is unknown
and
The CXX compiler identification is unknown
How is it possible when I set those variables right there?
EDIT: Error log file:
Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler:
Build flags:
Id flags:
The output was:
1
Microsoft (R) Build Engine version 12.0.30723.0
[Microsoft .NET Framework, version 4.0.30319.18444]
Copyright (C) Microsoft Corporation. All rights reserved.
Build started 21-09-2014 20:17:49.
Project "D:\foo\build\CMakeFiles\3.0.2\CompilerIdC\CompilerIdC.vcxproj" on node 1 (default targets).
PrepareForBuild:
Creating directory "Debug\".
Creating directory "Debug\CompilerIdC.tlog\".
InitializeBuildStatus:
Creating "Debug\CompilerIdC.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
ClCompile:
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\x86_amd64\CL.exe /c /nologo /W0 /WX- /Od /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fo"Debug\\" /Fd"Debug\vc120.pdb" /Gd /TC /errorReport:queue CMakeCCompilerId.c
CMakeCCompilerId.c
Link:
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\x86_amd64\link.exe /ERRORREPORT:QUEUE /OUT:".\CompilerIdC.exe" /INCREMENTAL:NO /NOLOGO kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /PDB:".\CompilerIdC.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:".\CompilerIdC.lib" /MACHINE:X64 Debug\CMakeCCompilerId.obj
LINK : fatal error LNK1181: cannot open input file 'gdi32.lib' [D:\foo\build\CMakeFiles\3.0.2\CompilerIdC\CompilerIdC.vcxproj]
Done Building Project "D:\foo\build\CMakeFiles\3.0.2\CompilerIdC\CompilerIdC.vcxproj" (default targets) -- FAILED.
Build FAILED.
"D:\foo\build\CMakeFiles\3.0.2\CompilerIdC\CompilerIdC.vcxproj" (default target) (1) ->
(Link target) ->
LINK : fatal error LNK1181: cannot open input file 'gdi32.lib' [D:\foo\build\CMakeFiles\3.0.2\CompilerIdC\CompilerIdC.vcxproj]
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.47
Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler:
Build flags:
Id flags:
The output was:
1
Microsoft (R) Build Engine version 12.0.30723.0
[Microsoft .NET Framework, version 4.0.30319.18444]
Copyright (C) Microsoft Corporation. All rights reserved.
Build started 21-09-2014 20:17:50.
Project "D:\foo\build\CMakeFiles\3.0.2\CompilerIdCXX\CompilerIdCXX.vcxproj" on node 1 (default targets).
PrepareForBuild:
Creating directory "Debug\".
Creating directory "Debug\CompilerIdCXX.tlog\".
InitializeBuildStatus:
Creating "Debug\CompilerIdCXX.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
ClCompile:
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\x86_amd64\CL.exe /c /nologo /W0 /WX- /Od /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fo"Debug\\" /Fd"Debug\vc120.pdb" /Gd /TP /errorReport:queue CMakeCXXCompilerId.cpp
CMakeCXXCompilerId.cpp
Link:
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\x86_amd64\link.exe /ERRORREPORT:QUEUE /OUT:".\CompilerIdCXX.exe" /INCREMENTAL:NO /NOLOGO kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /PDB:".\CompilerIdCXX.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:".\CompilerIdCXX.lib" /MACHINE:X64 Debug\CMakeCXXCompilerId.obj
LINK : fatal error LNK1181: cannot open input file 'gdi32.lib' [D:\foo\build\CMakeFiles\3.0.2\CompilerIdCXX\CompilerIdCXX.vcxproj]
Done Building Project "D:\foo\build\CMakeFiles\3.0.2\CompilerIdCXX\CompilerIdCXX.vcxproj" (default targets) -- FAILED.
Build FAILED.
"D:\foo\build\CMakeFiles\3.0.2\CompilerIdCXX\CompilerIdCXX.vcxproj" (default target) (1) ->
(Link target) ->
LINK : fatal error LNK1181: cannot open input file 'gdi32.lib' [D:\foo\build\CMakeFiles\3.0.2\CompilerIdCXX\CompilerIdCXX.vcxproj]
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.50
The compiler can be selected by using the CC and CXX variables, but by it's much more complicated than using the -G (generator) parameter. For one, the slashes in the path must be Unix style (/) and they don't take effect after the first time CMake configuration is ran unless the cache is cleared.
For a list of available generator options include the --help option
The paths to the Boost library must also use Unix style slashes (/). Many of the commands will convert Windows paths, but when passing in definitions at the command-line you'll want to always use Unix style paths.
Your command would change to the following:
cmake -G "Visual Studio 12 2013 Win64" -DBOOST_ROOT="C:/local/boost_1_56_0" -DBOOST_LIBRARYDIR="C:/local/boost_1_56_0/lib64-msvc-12.0" ..
You'll also want to make sure that your PATH environment variable is setup correctly for Visual Studio and x64. This can be done easily by opening a VS2013 x64 Native Tools Command Prompt using the command below:
cmd /k "%VS120CoMNTOOLS%\..\..\VC\vcvarsall.bat" amd64
In addition, you should make sure you're clearing out the cmake cache before you try. The easiest way to do this is to delete your cmake build folder, but you can also use the CMake-gui to clear the cache.

CMake / NMake link error on Visual Studio 2012 / vc11

I configured and generated the nmake build files using CMake (2.8.11.2) on Windows 7 64bit for the openmpi 1.4.3 package. I am using the "VS2012 x64 Cross Tools Command Prompt". Unfortunately the link step for the first DLL target fails because some traget libraries are added to the link command line with an '/l' prefix, that causes the linker to issue warnings, but results then in unresolved external symbols, because the needed libraries have been ignored. I.e.
Linking C shared library ..\liblibopen-pal.dll
cd C:\home\re04179\thirdparty\openmpi-1.4.3-build\vc11\x64\release\opal
"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -E vs_link_dll C:\PROGRA~2\MICROS~1.0\VC\bin\X86_AM~1\link.exe /nologo #CMakeFiles\libopen-pal.dir\objects1.rsp #C:\Users\RE04179\AppData\Local\Temp\nm1B31.tmp
Visual Studio Non-Incremental Link
LINK:
C:\PROGRA~2\MICROS~1.0\VC\bin\X86_AM~1\link.exe /nologo #CMakeFiles\libopen-pal.dir\objects1.rsp /out:..\liblibopen-pal.dll /implib:..\liblibopen-pal.dll.a /pdb:C:\home\re04179\thirdparty\openmpi-1.4.3-build\vc11\x64\release\liblibopen-pal.pdb /dll /version:0.0 /machine:x64 /INCREMENTAL:NO -lWs2_32.lib -lshlwapi.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST
LINK : warning LNK4044: unrecognized option '/lWs2_32.lib'; ignored
LINK : warning LNK4044: unrecognized option '/lshlwapi.lib'; ignored
Creating library ..\liblibopen-pal.dll.a and object ..\liblibopen-pal.dll.exp
win32.obj : error LNK2019: unresolved external symbol __imp_WSAGetLastError referenced in function win32_insert
evutil.obj : error LNK2001: unresolved external symbol __imp_WSAGetLastError
if.obj : error LNK2001: unresolved external symbol __imp_WSAGetLastError
win32.obj : error LNK2019: unresolved external symbol __imp_WSACloseEvent referenced in function win32_del
win32.obj : error LNK2019: unresolved external symbol __imp_WSACreateEvent referenced in function win32_recompute_event
win32.obj : error LNK2019: unresolved external symbol __imp_WSAEnumNetworkEvents referenced in function win32_socket_event_callback
win32.obj : error LNK2019: unresolved external symbol __imp_WSAEventSelect referenced in function win32_del
win32.obj : error LNK2019: unresolved external symbol __imp_WSAHtonl referenced in function win32_insert
etc.
By editing line 156 of file 'C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows-MSVC.cmake' from
set(CMAKE_C_STANDARD_LIBRARIES_INIT "kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib")
to
set(CMAKE_C_STANDARD_LIBRARIES_INIT "ws2_32.lib shlwapi.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib")
i.e., adding the required libraries explicitly, allows me to build the package successfully, the linker warnings remain, though, and this is certainly only a work-around, but no satisfactory solution to the problem.
You should add libraries to openmpi cmake file and not change CMake files. And you should never change CMake distribution files but rather fix files which accompany a library you are trying to build. Most of the time it is a library's bug not CMake's.

Failed to configure CMake with Visual Studio 2010 Express

Can somebody help me please, I am trying to configure CMake with Visual Studio 2010 Express but it's failed. The whole error message is bellow :
The C compiler identification is MSVC 16.0.30319.1 The CXX compiler
identification is MSVC 16.0.30319.1 Check for working C compiler
using: Visual Studio 10 Check for working C compiler using: Visual
Studio 10 -- broken CMake Error at C:/Program Files/CMake
2.8/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:61 (message): The C compiler "C:/Program Files/Microsoft Visual Studio
10.0/VC/bin/cl.exe" is not able to compile a simple test program.
It fails with the following output:
Change Dir: C:/OpenCV2.2/build/CMakeFiles/CMakeTmp
Run Build
Command:C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe
cmTryCompileExec2312584318.vcxproj /p:Configuration=Debug
/p:VisualStudioVersion=10.0
Microsoft (R) Build Engine version 4.0.30319.17929
[Microsoft .NET Framework, version 4.0.30319.17929]
Copyright (C) Microsoft Corporation. All rights reserved.
Build started 30/05/2013 20:16:01.
Project
"C:\OpenCV2.2\build\CMakeFiles\CMakeTmp\cmTryCompileExec2312584318.vcxproj"
on node 1 (default targets).
PrepareForBuild:
Creating directory "cmTryCompileExec2312584318.dir\Debug\".
Creating directory "C:\OpenCV2.2\build\CMakeFiles\CMakeTmp\Debug\".
InitializeBuildStatus:
Creating "cmTryCompileExec2312584318.dir\Debug\cmTryCompileExec2312584318.unsuccessfulbuild"
because "AlwaysCreate" was specified.
ClCompile:
C:\Program Files\Microsoft Visual Studio 10.0\VC\bin\CL.exe /c /Zi /W3 /WX- /Od /Ob0 /Oy- /D WIN32 /D _WINDOWS /D _DEBUG /D
"CMAKE_INTDIR=\"Debug\"" /D _MBCS /Gm- /RTC1 /MDd /GS /fp:precise
/Zc:wchar_t /Zc:forScope /Fo"cmTryCompileExec2312584318.dir\Debug\"
/Fd"C:/OpenCV2.2/build/CMakeFiles/CMakeTmp/Debug/cmTryCompileExec2312584318.pdb"
/Gd /TC /analyze- /errorReport:queue testCCompiler.c
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.30319.01 for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.
cl /c /Zi /W3 /WX- /Od /Ob0 /Oy- /D WIN32 /D _WINDOWS /D _DEBUG /D "CMAKE_INTDIR=\"Debug\"" /D _MBCS /Gm- /RTC1 /MDd /GS /fp:precise
/Zc:wchar_t /Zc:forScope /Fo"cmTryCompileExec2312584318.dir\Debug\"
/Fd"C:/OpenCV2.2/build/CMakeFiles/CMakeTmp/Debug/cmTryCompileExec2312584318.pdb"
/Gd /TC /analyze- /errorReport:queue testCCompiler.c
testCCompiler.c
ManifestResourceCompile:
C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\rc.exe /nologo /fo"cmTryCompileExec2312584318.dir\Debug\cmTryCompileExec2312584318.exe.embed.manifest.res" cmTryCompileExec2312584318.dir\Debug\cmTryCompileExec2312584318_manifest.rc
Link:
C:\Program Files\Microsoft Visual Studio 10.0\VC\bin\link.exe /ERRORREPORT:QUEUE
/OUT:"C:\OpenCV2.2\build\CMakeFiles\CMakeTmp\Debug\cmTryCompileExec2312584318.exe"
/INCREMENTAL /NOLOGO kernel32.lib user32.lib gdi32.lib winspool.lib
shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib
/MANIFEST
/ManifestFile:"cmTryCompileExec2312584318.dir\Debug\cmTryCompileExec2312584318.exe.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG
/PDB:"C:/OpenCV2.2/build/CMakeFiles/CMakeTmp/Debug/cmTryCompileExec2312584318.pdb"
/SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT
/IMPLIB:"C:/OpenCV2.2/build/CMakeFiles/CMakeTmp/Debug/cmTryCompileExec2312584318.lib"
/MACHINE:X86
cmTryCompileExec2312584318.dir\Debug\cmTryCompileExec2312584318.exe.embed.manifest.res
cmTryCompileExec2312584318.dir\Debug\testCCompiler.obj /machine:X86 /debug
LINK : fatal error LNK1123: failure during conversion to COFF: file
invalid or corrupt
[C:\OpenCV2.2\build\CMakeFiles\CMakeTmp\cmTryCompileExec2312584318.vcxproj]
Done Building Project
"C:\OpenCV2.2\build\CMakeFiles\CMakeTmp\cmTryCompileExec2312584318.vcxproj"
(default targets) -- FAILED.
Build FAILED.
"C:\OpenCV2.2\build\CMakeFiles\CMakeTmp\cmTryCompileExec2312584318.vcxproj"
(default target) (1) ->
(Link target) ->
LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt
[C:\OpenCV2.2\build\CMakeFiles\CMakeTmp\cmTryCompileExec2312584318.vcxproj]
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.64
CMake will not be able to correctly generate this project. Call
Stack (most recent call first): CMakeLists.txt:47 (project)
Configuring incomplete, errors occurred!
any advice?
Install the windows 7 SDK then install VC-Compiler-KB2519277. Fixed the issue for me.
Was having the same problem with CMake on win7x64. The problem relates to .NET 4.5. If you don't want to uninstall 4.5, and your Solution is already setup, make sure to disable incremental linking, otherwise you will not be able to build.
To fix your CMake issue, you will have to uninstall .NET 4.5 on your machine and re-install .NET 4.0 in order to get CMake to work (4.5 removes all of 4.0's assemblies, etc!)
Apparently can't install 4.0 while 4.5 is already installed, so use Windows Control Panel to do the uninstall (Control Panel\Programs\Programs and Features)
CMake does not consider this a bug, rather it is a MS issue.
If you have Net framework 4.5 installed, you have to update VS 2010 to SP1 in order to make some stuff work correctly. Sometimes you can overcome the problem by just setting off incremental build in project Configurations > Linker settings. If you have VS 2012 installed after VS 2010, then before updating the VS 2010, you need to search at MSDN for the article about avoiding dependencies. My guess is that you will have to uninstall newer versions before upgrading the older ones to new service packs. There is a set of pages in MSDN explaining each step. Just google them. I also had this problem with CMake. This is how i solved it. Furthermore, i already had Windows 7 SDK installed. So i am not sure if it is needed to be installed to solve this problem or not.
In my case installing the VC2010 Service Pack 1 solved my issue after a reboot.
Didn't installed the Windows SDK 7.1 at all or anything else.
If you don't want to re-install .NET Frameworks and/or making 400mb Windows SDK updates, try this lighter solution first.