compiling CGAL 4.3 on Windows 7 - visual-c++

I have
Windows 7 64 bit
Visual Studio 10 32 bit
QT 4.84
Boost 1.55
CMake 2.8.8
CGAL 4.3
I did
Downloaded and built everyting before building CGAL 4.3 itself.
Run Cmake as administrator to avoid possible permissione issues.
I get
"Impossible to start application correctly"
Microsoft (R) Visual Studio versione 10.0.40219.1.
Copyright (C) Microsoft Corp. Tutti i diritti riservati.
1>------ Inizio compilazione: Progetto: cmTryCompileExec2140561810, Configurazione: Debug Win32 ------
1> Microsoft (R) 32-bit C/C++ Optimizing Compiler versione 16.00.40219.01 per 80x86
1> Copyright (C) Microsoft Corporation. Tutti i diritti riservati.
1>
1> cl /c /I"C:/CGAL-4.3/auxiliary/gmp/include" /Zi /W3 /WX- /Od /Ob0 /Oy- /D WIN32 /D _WINDOWS /D _CRT_SECURE_NO_DEPRECATE /D _SCL_SECURE_NO_DEPRECATE /D _CRT_SECURE_NO_WARNINGS /D _SCL_SECURE_NO_WARNINGS /D _DEBUG /D "CMAKE_INTDIR=\"Debug\"" /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:strict /fp:except- /Zc:wchar_t /Zc:forScope /GR /Fo"cmTryCompileExec2140561810.dir\Debug\\" /Fd"C:/CGAL-4.3/build/CMakeFiles/CMakeTmp/Debug/cmTryCompileExec2140561810.pdb" /Gd /TP /wd4503 /analyze- /errorReport:prompt "C:\CGAL-4.3\config\support\print_GMP_version.cpp" /Zm1000 /bigobj
1>
1> print_GMP_version.cpp
1>C:\CGAL-4.3\auxiliary\gmp\include\gmp.h(2177): warning C4146: operatore 'meno' unario utilizzato con tipo unsigned. Il risultato resta unsigned.
1> cmTryCompileExec2140561810.vcxproj -> C:\CGAL-4.3\build\CMakeFiles\CMakeTmp\Debug\cmTryCompileExec2140561810.exe
========== Compilazione: 1 completate, 0 non riuscite, 0 aggiornate, 0 ignorate ==========
Exit code 0xc000007b
So this is a GMP problem. The same happens with MPFR compilaton and after this :
any CGAL test like
Performing Test CGAL_CFG_NESTED_CLASS_FRIEND_DECLARATION_BUG - Failed
Performing Test CGAL_CFG_NO_LIMITS - Failed
Performing Test CGAL_CFG_NO_NEXTAFTER - Failed
...
failed with the same 0xc000007b error. Not sure if this related to previous errors or not.
Question
Did anyone experienced the problem like this and if yes how did he suceed to compile CGAL ?

Drop /WX (or disable warning C4146 one way or another). VC gives a useless warning, and you are asking it to treat it as an error.

Related

Cl.exe returing error code D8050

I have the following error on fresh windows 8 install with microsoft visual studio ultimate 2013 :
cl : Command line error D8050 : cannot execute 'C:\Program Files (x86)\Microsoft
Visual Studio 12.0\VC\BIN\amd64\c1xx.dll': failed to get command line into debu
g records
The weird thing is that trying to compile in an admin cmd is working....
I tried to change ownership/rights of the VS12 folder but it changes nothing.
cl /Fobin\x64\Release\file.obj /c src\file.cpp
/TP /nologo /MP /GS /W4 /wd4800 /wd4138 /wd4530 /wd4512 /wd4996 /wd4251
/wd4661 /wd4505 /WX- /Gd /Zi /Gm- /Zc:wchar_t /errorReport:prompt /Zc:forScope
/Fplibvideostitch.pch /FS /Fdvc120.pdb /fp:precise /GL /O2 /Oy- /Oi /MD /Ot
/DWIN32 /D_USE_MATH_DEFINES /D_WINDLL /DNOMINMAX /D_CONSOLE /DNDEBUG
"/IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.5\include"
I had this issue with a cleared environment, and it was resolved (at least in part) by setting the TMP environment variable.
I ran into this error after I cleaned up my C drive (deleted temporary files of all sorts). I was able to fix it by re-setting the environment variables for Visual C++ command-line tools. This page was my reference.
I was building 64 bit.
Run cmd as admin.
c:\>cd YourVSInstallDir\VC
c:\YourVSInstallDir\VC>vcvarsall.bat amd64
I had my %TEMP% and %TMP% vars pointing to a directory that contained a $. Replacing it with an _ solved the issue for me.
Rebooting fixed it for me!
I encountered this issue after a build failed due to running out of disk space. After clearing a lot of space, any subsequent build attempts failed with the D8050 error. Failing to come up with any better solution, I decided to give the age-old "fix" to all Windows problems: rebooting the system. And it worked! My guess is that some temporary setting was stuck in the wrong state, and rebooting cleared it up.

vlfeat nmake: fatal error U1073: don't know how to make "msvcr100.dll"

I have downloaded vlfeat source code. I am trying make file using nmake (Microsoft Visual Studio command) to use vlfeat.
The command I have given is:
nmake /f Makefile.mak ARCH=win32
It gives the following error.
NMAKE : fatal error U1073: don't know how to make '"C:\Program
Files\Microsoft Visual Studio 10.0\VC
\redist\x86\Microsoft.VC100.CRT\msvcr100.dll"' Stop.
Please help me to fix it.
Configurations
Windows 7 32 bit OS
VLFeat version: 0.9.17
Microsoft Visual Studio 2010 Express
Regards
Sridhar
I think you need to put the argument to nmake in quotes:
nmake /f Makefile.mak "ARCH=win32"
but as you have not given details of the makefile in your question its hard to help without more details.

nvcc.exe linking error Microsoft Visual Studio configuration file 'vcvars64.bat' could not found

I want to use nvcc -ptx from windows command line, but I always get this error message:
nvcc : fatal error : Microsoft Visual Studio configuration file 'vcvars64.bat' could not be found for installation at 'C:\Program Files (x86)\Microsoft Visual S
tudio 11.0\VC\bin/../..'
I'm using vs 2012 express edition. What can be the solution?
I have managed to solve the issue and make work with MS Visual Studio Express 2012, here what I did:
Installed MS Visual Studio 2012 Express
Installed cuda_5.5.20_winvista_win7_win8_general_64, the latest version as of 2014-01-16
From this directory: C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin, I have copied x86_amd64 to amd64
In the new directory: C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\amd64, I have created a file vcvars64.bat
In the file vcvars64.bat, just added: CALL setenv /x64
The compilation worked great:
C:\CUDA>nvcc -o square square.cu
Creating library square.lib and object square.exp
C:\CUDA>square.exe
0.000000 1.000000 4.000000 9.000000
16.000000 25.000000 36.000000 49.000000
64.000000 81.000000 100.000000 121.000000
144.000000 169.000000 196.000000 225.000000
From NVIDIA CUDA Compiler Driver document
1.2. Supported Host Compilers
nvcc uses the following compilers for host code compilation:
On Linux platforms
The GNU compiler, gcc, and arm-linux-gnueabihf-g++ for cross compilation to the ARMv7
architecture
On Windows platforms
The Microsoft Visual Studio compiler, cl On both platforms, the compiler found on the current
execution search path will be used, unless nvcc option -compiler-bindir is specified (see File and Path Specifications).
Your visual studio install is asking for .NET v3.5 framework:
http://www.microsoft.com/en-us/download/details.aspx?id=21
Got this info from this: Where can I find Microsoft.Build.Utilities.v3.5
When in your project go to Configuration Properties > CUDA C/C++ > Device and change Code Generation to the following: compute_11,sm_11

Cmake is Unable to Configure Project for Visual Studios 10 amd64

I am trying to get CMAKE to create a project for msvc 10 express edition for x64 architecture. I have both MSVC 2010 Express and Windows SDK 7.1 installed.
If I start CMake Normally I can create a 32 bit project, however it fails to make a 64 bit project. I have also Tried starting CMAKE from within the Windows SDK Command Prompt (cl cmd maps to x64 version) however It still fails with the following.
Found Windows SDK v7.1: C:\Program Files\Microsoft SDKs\Windows\v7.1\
Check for working C compiler using: Visual Studio 10 Win64
Check for working C compiler using: Visual Studio 10 Win64 -- broken
CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:52 (MESSAGE):
The C compiler "c:/Program Files (x86)/Microsoft Visual Studio
10.0/VC/bin/amd64/cl.exe" is not able to compile a simple test program.
It fails with the following output:
Change Dir: C:/Users/Dan/Desktop/pclt/PCL/bin/CMakeFiles/CMakeTmp
Run Build Command:C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe
cmTryCompileExec1400574213.vcxproj /p:Configuration=Debug
Microsoft (R) Build Engine Version 4.0.30319.1
[Microsoft .NET Framework, Version 4.0.30319.296]
Copyright (C) Microsoft Corporation 2007. All rights reserved.
Build started 1/14/2013 8:15:59 AM.
Project
"C:\Users\Dan\Desktop\pclt\PCL\bin\CMakeFiles\CMakeTmp\cmTryCompileExec1400574213.vcxproj"
on node 1 (default targets).
PrepareForBuild:
Creating directory "cmTryCompileExec1400574213.dir\Debug\".
Creating directory "C:\Users\Dan\Desktop\pclt\PCL\bin\CMakeFiles\CMakeTmp\Debug\".
InitializeBuildStatus:
Creating "cmTryCompileExec1400574213.dir\Debug\cmTryCompileExec1400574213.unsuccessfulbuild" because "AlwaysCreate" was specified.
ClCompile:
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\x86_amd64\CL.exe /c /Zi /W3 /WX- /Od /Ob0 /D WIN32 /D _WINDOWS /D _DEBUG /D "CMAKE_INTDIR=\"Debug\"" /D _MBCS /Gm- /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fo"cmTryCompileExec1400574213.dir\Debug\\" /Fd"C:/Users/Dan/Desktop/pclt/PCL/bin/CMakeFiles/CMakeTmp/Debug/cmTryCompileExec1400574213.pdb" /Gd /TC /errorReport:queue C:\Users\Dan\Desktop\pclt\PCL\bin\CMakeFiles\CMakeTmp\testCCompiler.c /Zm1000 /GZ
C:\Program Files
(x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\x64\Microsoft.Cpp.x64.Targets(146,5):
error : Required file "" is missing.
[C:\Users\Dan\Desktop\pclt\PCL\bin\CMakeFiles\CMakeTmp\cmTryCompileExec1400574213.vcxproj]
Done Building Project
"C:\Users\Dan\Desktop\pclt\PCL\bin\CMakeFiles\CMakeTmp\cmTryCompileExec1400574213.vcxproj"
(default targets) -- FAILED.
Build FAILED.
"C:\Users\Dan\Desktop\pclt\PCL\bin\CMakeFiles\CMakeTmp\cmTryCompileExec1400574213.vcxproj"
(default target) (1) ->
(ClCompile target) ->
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\x64\Microsoft.Cpp.x64.Targets(146,5): error : Required file "" is missing. [C:\Users\Dan\Desktop\pclt\PCL\bin\CMakeFiles\CMakeTmp\cmTryCompileExec1400574213.vcxproj]
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.12
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:3 (project)
Configuring incomplete, errors occurred!
I found that my x64 compilers were destroyed by installing SP 1. Try this update to restore them :
http://www.microsoft.com/en-us/download/details.aspx?id=4422
I had similar issues on Win7, and was getting the same error - The C compiler "cl.exe" is not able to compile a simple test program.
The solution that worked for me :
On Windows Donot run cmake on the cygwin terminal.
Run it from the command prompt, AND also ensure that you have admin rights,
In windows 7 you can start command prompt as administrator by going to
Start->All programs->Accessories-> (Right Click on Command Prompt) and Select "Run as administrator"
Then run cmake <your source>
Worked like a charm for me.

Malloc inside Kernel

I am trying to compile a code that has a malloc function inside the kernel
and i get this error:
Error 5 error : calling a host function("malloc") from a __device__/__global__ function("bitapS") is not allowed C:\ProgramData\NVIDIA Corporation\NVIDIA GPU Computing SDK 4.0\C\src\str_bit\main.cu 36 1 str_bit
My command line is:
Error 6 error MSB3721: The command ""C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.0\bin\nvcc.exe" -gencode=arch=compute_10,code=\"sm_10,compute_10\" -gencode=arch=compute_20,code=\"sm_20,compute_20\" --use-local-env --cl-version 2010 -ccbin "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\x86_amd64" -I"../../common/inc" -I"../../../shared/inc" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.0\include" -G0 --keep-dir "x64\Debug" -maxrregcount=0 --machine 64 --compile -D_NEXUS_DEBUG -g -Xcompiler "/EHsc /nologo /Od /Zi /MTd " -o "x64/Debug/main.cu.obj" "C:\ProgramData\NVIDIA Corporation\NVIDIA GPU Computing SDK 4.0\C\src\str_bit\main.cu"" exited with code 2. C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\BuildCustomizations\CUDA 4.0.targets 357 10 str_bit
Any suggestions? I thought that with sm_20 enabled you could allocate... my card is a 460 GTX
Thanks!
It's true you should not do it but if they enabled it probably has some uses.
The code gives an error because you are compiling for architecture 1.0 and 2.0. To make it compile you can remove
-gencode=arch=compute_10,code=\"sm_10,compute_10\"
from the command line if you only intend to run the code on fermi devices or you must provide an alternative code in your source code for older devices. You can do it by using the NVCC preprocessor macro:
__CUDA_ARCH__
like this:
#if (__CUDA_ARCH__ < 200)
/* code for 1.x arch */
#else
/* code for 2.x arch */
#endif
It seems you are using Visual Studio so in the project properties you can go to the cuda section and specify there the architectures you wan't to build for.
I found it....
You have to specify
sm_20,compute_20
also to your file properties not only in the project attributes!
Thanks anyway!
You should not be allocating memory inside the kernel. Ever. This is a clear sign your CUDA kernel is poorly designed and will have bad performance.

Resources