[CMake] No mechanism to set -Xcompiler options with Visual Studio CUDA integration?

Hancox, James JHancox at tmvse.com
Wed Jun 21 12:04:06 EDT 2017


Hi Brad, 

Thanks for the information, that makes a lot of sense. Here's hoping that CUDA 9 fixes the problem! Sadly it's a bit of a showstopper right now, but I'll be sure to try this again in a future version. 

 Cheers,
James

-----Original Message-----
From: Brad King [mailto:brad.king at kitware.com] 
Sent: 21 June 2017 16:49
To: Hancox, James <JHancox at tmvse.com>
Cc: cmake at cmake.org; Robert Maynard <robert.maynard at kitware.com>
Subject: Re: [CMake] No mechanism to set -Xcompiler options with Visual Studio CUDA integration?

On 06/21/2017 09:08 AM, Hancox, James wrote:
> it almost seems like -Xcompiler flags are being deliberately stripped 
> out.)

Unfortunately we have to strip them out to work around a bug in CUDA's VS integration.

The -Xcompiler options are parsed for inclusion in AdditionalCompilerOptions in the .vcxproj file by flag map entries here:

  https://gitlab.kitware.com/cmake/cmake/blob/v3.9.0-rc3/Source/cmVS10CudaFlagTable.h#L3-6

Then a subset of the options that have dedicated elements defined by the CUDA VS integration are extracted by flag map entries here:

  https://gitlab.kitware.com/cmake/cmake/blob/v3.9.0-rc3/Source/cmVS10CudaHostFlagTable.h

Ideally we should then leave the rest in AdditionalCompilerOptions, but CUDA's VS integration puts them in the wrong place and breaks builds.
Therefore we have to drop them:

  https://gitlab.kitware.com/cmake/cmake/blob/v3.9.0-rc3/Source/cmVisualStudio10TargetGenerator.cxx#L2508-2510

We've reported this to NVIDIA but can't take the workaround out until a version of CUDA comes out that fixes it.

-Brad


______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service.
For more information please visit http://www.symanteccloud.com ______________________________________________________________________

______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service.
For more information please visit http://www.symanteccloud.com
______________________________________________________________________


More information about the CMake mailing list