Hi Jussi,
On Friday, November 13, 2015 at 8:37:08 AM UTC-8, Jussi Pakkanen wrote:
On Fri, Nov 13, 2015 at 12:30 AM, Rob
<rdool...@gmail.com> wrote:
The issue I had is my generator needed those '-Ixxx' lines. So now my generator looks like:
cuda_gen = generator(nvcc,
output: '@BASENAME@.o',
arguments: ['-c', '@INPUT@', '-o', '@OUTPUT@', '-I', lib_inc_str, '-I', '/usr/local/nvidia/5.0/cuda/samples/common/inc/'],
)
Is there a way to extract the string path from 'lib_inc = include_directories('.')'?
Include_directories is a bit more involved and does stuff behind the scenes so extracting is not so straightforward. However if you just need the source dir there is an easier way, like this:
'-I' + meson.current_source_dir()
Ok, that's what I'm doing.
My more pressing issue at the moment is the inability to use the generated objects when it comes time to build the final app.
A fix for this was just committed so it should work now.
Fix works - thanks!
So, now that I have generated .o files from .cu files, how to I use them to build my final exe?
cuda_gen = generator(nvcc,
output: '@BASENAME@.o',
arguments: ['-c', '@INPUT@', '-o', '@OUTPUT@', '-I', lib1_inc_str, '-I', '/usr/local/nvidia/5.0/cuda/samples/common/inc/'],
)
generated = cuda_gen.process(cuda_src)
This fails:
app = executable('backproject', src, generated)
output: ninja: error: '../
f1.cu', needed by 'app@exe/f1.o', missing and no known rule to make it
This also fails
app = executable('backproject', src,
objects: generated,
)
output: Bad object in target app.
This also fails:
app = executable('backproject', src,
link_with: generated,
)
output: Link target is not library.
How do link with the object files that the generator outputs?