Re: Compiling CUDA file ending in .cu

Edward Diener via Boost-build <[email protected]> Thu, 3 Oct 2019 18:28:03 -0400
Newsgroups gmane.comp.lib.boost.build
Message-ID <[email protected]>
On 10/1/2019 2:12 PM, Phillip Seaver via Boost-build wrote:
> On 10/1/2019 1:49 PM, Edward Diener via Boost-build wrote:
>> I just want to use the 'compile' rule to compile a CUDA file, meaning 
>> a file ending in .cu, to an object file in a .jam file. In all other 
>> respects the CUDA file should be treated like a normal .cpp file being 
>> compiled with the 'compile' rule. Is there some way to specify this in 
>> a jam file ?
>>
>> My current attempt generates:
>>
>> somepath/boost/tools/build/src/build/generators.jam:1127: in 
>> ensure-type from module generators
>> error: target { clang_cuda.cu. } has no type
>> etc.
>>
>> What do I have to do to tell Boost Build that the .cu type should be 
>> treated just like .cpp type for my 'compile' test ?
> 
> 
> If it's just for a file or two, you can probably do "[ cast _ cpp : 
> clang_cuda.cu ]" where you would normally put the cpp file.  To treat 
> all .cu files as cpp files, I think "type.register-suffixes cu : cpp ;" 
> will do it.  (I haven't tested either -- just looking at the boost-build 
> source).

Your first suggestion worked fine. Just had to also add 'import cast ;'. 
Thanks !

_______________________________________________
Unsubscribe & other changes: https://lists.boost.org/mailman/listinfo.cgi/boost-build