View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0016031CMakeCMakepublic2016-03-22 13:092016-06-10 14:21
ReporterThibault Notargiacomo 
Assigned To 
PriorityhighSeveritymajorReproducibilityalways
StatusclosedResolutionduplicate 
PlatformOSLinuxOS VersionAll versions
Product VersionCMake 3.5 
Target VersionFixed in Version 
Summary0016031: FindCUDA.cmake - CUDA_SEPARABLE_COMPILATION fails because of escape character
DescriptionWhen using
set( CUDA_SEPARABLE_COMPILATION ON )
in cunjunction with
find_package(CUDA 7.5 REQUIRED)

I get a problem in the make command generated for the link with the intermediate object file, especially, the "-ccbin" option that should give to the cuda command line the $CXX variable (in my case).


Steps To ReproduceTry to setup in a directory the following files:

===================================================
test.cu:
#include "test.cu.h"
#include "thrust/device_vector.h"

void A::doIt()
{
    thrust::device_vector<float> a(10,10);
    std::cout <<"A = "<<a[0]<<std::endl;
}

===================================================
test.cu.h:
#include <iostream>

class A
{
public:
    A()=default;
    virtual ~A()=default;
    virtual void doIt();
private:
    int m_a;
};
===================================================
main.cpp:
#include <cstdlib>
#include "test.cu.h"

int main(int argc, char* argv[])
{
    A a;
    a.doIt();
    return EXIT_SUCCESS;
}

===================================================
CMakeLists.txt:
cmake_minimum_required (VERSION 3.5)

ADD_DEFINITIONS( ${CMAKE_CXX_FLAGS} "-std=c++11" )
find_package(CUDA 7.5 REQUIRED)
set( CUDA_SEPARABLE_COMPILATION ON )
cuda_add_executable( testit test.cu main.cpp )
Additional InformationExtract of the build.make file that I had to modify in order to bypass the problem temporarily:

CMakeFiles/testit.dir/testit_intermediate_link.o: CMakeFiles/testit.dir/testit_generated_test.cu.o
    @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --blue --bold --progress-dir=/home/technic105/Documents/test/cmake35Bug/CMakeFiles --progress-num=$(CMAKE_PROGRESS_2) "Building NVCC intermediate link file CMakeFiles/testit.dir/testit_intermediate_link.o"
    /usr/local/cuda/bin/nvcc -m64 -ccbin \"/opt/rh/devtoolset-2/root/usr/bin/gcc\" -dlink /home/technic105/Documents/test/cmake35Bug/CMakeFiles/testit.dir//./testit_generated_test.cu.o -o /home/technic105/Documents/test/cmake35Bug/CMakeFiles/testit.dir/./testit_intermediate_link.o


Notice the -ccbin \"/opt/rh/devtoolset-2/root/usr/bin/gcc\" that causes the build to fail on my machine
TagsNo tags attached.
Attached Filestxt file icon CMakeLists.txt [^] (205 bytes) 2016-03-22 13:11 [Show Content]
cpp file icon main.cpp [^] (118 bytes) 2016-03-22 13:11
? file icon test.cu [^] (155 bytes) 2016-03-22 13:11
? file icon test.cu.h [^] (120 bytes) 2016-03-22 13:12

 Relationships
duplicate of 0016027closedBrad King nvcc encloses -ccbin argument with gratuitous quotation marks during intermediate-link phase 

  Notes
(0040750)
Thibault Notargiacomo (reporter)
2016-03-22 13:13

I forgot to say that, in order to reproduce the problem, you should run the following commands:

cmake -G "Unix Makefiles"
make
(0041217)
Kitware Robot (administrator)
2016-06-10 14:21

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.

 Issue History
Date Modified Username Field Change
2016-03-22 13:09 Thibault Notargiacomo New Issue
2016-03-22 13:11 Thibault Notargiacomo File Added: CMakeLists.txt
2016-03-22 13:11 Thibault Notargiacomo File Added: main.cpp
2016-03-22 13:11 Thibault Notargiacomo File Added: test.cu
2016-03-22 13:12 Thibault Notargiacomo File Added: test.cu.h
2016-03-22 13:13 Thibault Notargiacomo Note Added: 0040750
2016-03-22 13:35 Brad King Relationship added duplicate of 0016027
2016-03-22 13:35 Brad King Status new => resolved
2016-03-22 13:35 Brad King Resolution open => duplicate
2016-06-10 14:21 Kitware Robot Note Added: 0041217
2016-06-10 14:21 Kitware Robot Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team