automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Compile a particular extension files, with a different compiler


From: Jan Engelhardt
Subject: Re: Compile a particular extension files, with a different compiler
Date: Thu, 30 Mar 2023 10:30:31 +0200 (CEST)
User-agent: Alpine 2.25 (LSU 592 2021-09-18)

On Sunday 2023-03-26 14:33, Labeeb Asari wrote:
>
>Basically : compile .c source files with gcc, .cu files with nvcc and
>finally link them together with gcc.
>
>I've tried adding a rule to handle .cu files differently and it does create
>object files for it separately. However while linking, libtool does not
>include these object files!

I have good success with

```
libsomething_la_SOURCES = cpart.cpp
libsomething_la_LDADD = xx.o

.cu.o:
        # fake compiler command for my case
        g++ -x c++ -c -o $@ $<
```

The only downside is a naggy warning about non-portable use of .o files.
I could live with that..

Getting an .lo file out of it is more complicated (I got an xx.lo but
no .libs/xx.o, which is rather odd.)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]