[cmake-developers] [CMake 0012198]: FindCUDA.cmake, INCLUDE_DIRECTORIES, The command line is too long.

Mantis Bug Tracker mantis at public.kitware.com
Tue May 17 08:51:24 EDT 2011


The following issue has been SUBMITTED. 
====================================================================== 
http://public.kitware.com/Bug/view.php?id=12198 
====================================================================== 
Reported By:                Denis Shamonin
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   12198
Category:                   CMake
Reproducibility:            always
Severity:                   major
Priority:                   high
Status:                     new
====================================================================== 
Date Submitted:             2011-05-17 08:51 EDT
Last Modified:              2011-05-17 08:51 EDT
====================================================================== 
Summary:                    FindCUDA.cmake, INCLUDE_DIRECTORIES, The command
line is too long.
Description: 
Hello,

1. I am posting it to CMake bug tracker because original creators of
FindCUDA.cmake
James Bigler and Abe Stephens not willing to support it according to
http://www.cmake.org/pipermail/cmake/2010-January/034322.html

2. Development tools: 
Visual Studio 2008
CMake 2.8.4
CUDA Toolkit 3.2 stable release (64 bit)
ITK 4.0.0

3. I've created the simple library with only 2 files in it (see
CUDA_lib_test.zip) .
This library also includes ITK4 with FIND_PACKAGE( ITK REQUIRED )

4. Problem:
Therefore we have some issues with FindCUDA.cmake module.
When we start the compilation we see the following call to NVidia compiler 
(see nvcc_call.txt inside of CUDA_lib_test.zip)

This call looks very strange to us. 
Why would you need to pass all include directories from entire solution to
NVidia compiler? 
I could understand that you would like to provide include directories for the 
ncvv.exe -Xcompiler option. But probably in more specific and controlled way.
I've studied this problem a bit and found that this is happens because of the
CMake call:

  get_directory_property(CUDA_NVCC_INCLUDE_DIRECTORIES INCLUDE_DIRECTORIES) at
line 890: FindCUDA.cmake
  if(CUDA_NVCC_INCLUDE_DIRECTORIES)
    foreach(dir ${CUDA_NVCC_INCLUDE_DIRECTORIES})
      list(APPEND CUDA_NVCC_INCLUDE_ARGS "-I${dir}")
    endforeach()
  endif()

Do you mean the CUDA_INCLUDE_DIRECTORIES instead of INCLUDE_DIRECTORIES?
So as a temp solution we commented this part of FindCUDA.cmake.

The question is how to control or disable the directories to be passed to NVidia
compiler?

As a result of this long ITK include directories list NVidia compiler could not
be executed on Windows platform.
Ending with system error:

1>The command line is too long.
1>CMake Error at
CMakeFiles/CUDA_lib_test_generated_bicubicTexture.cu.obj.cmake:198 (message):
1>  Error generating
1> 
D:/tests/CUDA_lib_test/build/Debug/CUDA_lib_test_generated_bicubicTexture.cu.obj
1>Project : error PRJ0019: A tool returned an error code from "Building NVCC
(Device) object Debug/CUDA_lib_test_generated_bicubicTexture.cu.obj"
1>Build log was saved at
"file://d:\tests\CUDA_lib_test\build\CUDA_lib_test.dir\Debug\BuildLog.htm"
1>CUDA_lib_test - 1 error(s), 0 warning(s)

5. As a part of this problem I don see why c++ compiler flags like
(-DITK_IO_FACTORY_REGISTER_MANAGER or -D_SCL_SECURE_NO_DEPRECATE
-D_CRT_SECURE_NO_DEPRECATE -

D_CRT_TIME_FUNCTIONS_NO_DEPRECATE) are propagated to NVidia ncvv.exe compiler
and not to -Xcompiler? (see nvcc_call.txt inside of CUDA_lib_test.zip)

I think that is another error in FindCUDA.cmake.

Could you please fix it or recommend the solution for this problems.

Thank you,
-Denis.
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2011-05-17 08:51 Denis Shamonin New Issue                                    
2011-05-17 08:51 Denis Shamonin File Added: CUDA_lib_test.zip                   

======================================================================




More information about the cmake-developers mailing list