Boost logo

Boost-Build :

From: Phillip Seaver (phil_at_[hidden])
Date: 2019-10-01 18:12:31


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).

Phillip


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk