All of lore.kernel.org
 help / color / mirror / Atom feed
* meson cuda compilation
@ 2020-08-26  9:57 Marek Belisko
  2020-08-26 10:09 ` [yocto] " Alexander Kanavin
  0 siblings, 1 reply; 4+ messages in thread
From: Marek Belisko @ 2020-08-26  9:57 UTC (permalink / raw)
  To: yocto

Hi,

I'm trying to compile a simple cuda application which is built using
the meson build system. I have an issue that meson looks for nvcc
compiler on my host and I don't have installed cuda-nvcc compiler
(just use cuda-nvcc-native as dependency). Can we somehow force meson
not to search the local host for compilers?

Thanks and regards,

marek

-- 
as simple and primitive as possible
-------------------------------------------------
Marek Belisko - OPEN-NANDRA
Freelance Developer

Ruska Nova Ves 219 | Presov, 08005 Slovak Republic
Tel: +421 915 052 184
skype: marekwhite
twitter: #opennandra
web: http://open-nandra.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [yocto] meson cuda compilation
  2020-08-26  9:57 meson cuda compilation Marek Belisko
@ 2020-08-26 10:09 ` Alexander Kanavin
  2020-08-26 10:18   ` Marek Belisko
  0 siblings, 1 reply; 4+ messages in thread
From: Alexander Kanavin @ 2020-08-26 10:09 UTC (permalink / raw)
  To: Marek Belisko; +Cc: yocto

[-- Attachment #1: Type: text/plain, Size: 869 bytes --]

You probably need to adjust meson.cross which is written out by
meson.bbclass.

Alex

On Wed, 26 Aug 2020 at 11:58, Marek Belisko <marek.belisko@gmail.com> wrote:

> Hi,
>
> I'm trying to compile a simple cuda application which is built using
> the meson build system. I have an issue that meson looks for nvcc
> compiler on my host and I don't have installed cuda-nvcc compiler
> (just use cuda-nvcc-native as dependency). Can we somehow force meson
> not to search the local host for compilers?
>
> Thanks and regards,
>
> marek
>
> --
> as simple and primitive as possible
> -------------------------------------------------
> Marek Belisko - OPEN-NANDRA
> Freelance Developer
>
> Ruska Nova Ves 219 | Presov, 08005 Slovak Republic
> Tel: +421 915 052 184
> skype: marekwhite
> twitter: #opennandra
> web: http://open-nandra.com
> 
>

[-- Attachment #2: Type: text/html, Size: 1313 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [yocto] meson cuda compilation
  2020-08-26 10:09 ` [yocto] " Alexander Kanavin
@ 2020-08-26 10:18   ` Marek Belisko
  2020-08-26 10:33     ` Alexander Kanavin
  0 siblings, 1 reply; 4+ messages in thread
From: Marek Belisko @ 2020-08-26 10:18 UTC (permalink / raw)
  To: Alexander Kanavin; +Cc: yocto

On Wed, Aug 26, 2020 at 12:09 PM Alexander Kanavin
<alex.kanavin@gmail.com> wrote:
>
> You probably need to adjust meson.cross which is written out by meson.bbclass.
I checked gstreamer1.0 which also use meson for compilation and it's doing same:
Source dir: /home/marek/projects/project/test/build/tmp/work/aarch64-poky-linux/gstreamer1.0/1.16.2-r0/gstreamer-1.16.2
Build dir: /home/marek/projects/project/test/build/tmp/work/aarch64-poky-linux/gstreamer1.0/1.16.2-r0/build
Build type: cross build
Project name: gstreamer
Project version: 1.16.2
No CFLAGS in the environment, not changing global flags.
No LDFLAGS in the environment, not changing global flags.
No CPPFLAGS in the environment, not changing global flags.
Sanity testing C compiler: gcc
Is cross compiler: False.
Sanity check compiler command line: gcc
/home/marek/projects/project/test/build/tmp/work/aarch64-poky-linux/gstreamer1.0/1.16.2-r0/build/meson-private/sanitycheckc.c
-o /home/marek/projects/project/test/build/tmp/work/aarch64-poky-linux/gstreamer1.0/1.16.2-r0/build/meson-private/sanitycheckc.exe
-pipe -D_FILE_OFFSET_BITS=64
Sanity check compile stdout:

-----
Sanity check compile stderr:

-----
Running test binary command:
/home/marek/projects/project/test/build/tmp/work/aarch64-poky-linux/gstreamer1.0/1.16.2-r0/build/meson-private/sanitycheckc.exe
C compiler for the build machine: gcc (gcc 5.4.0 "gcc (Ubuntu
5.4.0-6ubuntu1~16.04.12) 5.4.0 20160609")
C linker for the build machine: gcc ld.bfd 2.26.1
Sanity testing C compiler: aarch64-poky-linux-gcc -march=armv8-a+crc
-fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat
-Wformat-security -Werror=format-security
--sysroot=/home/marek/projects/project/test/build/tmp/work/aarch64-poky-linux/gstreamer1.0/1.16.2-r0/recipe-sysroot
Is cross compiler: True.

first check build with my local gcc and then continue with cross
compilation. Can we somehow skip or redirect for checking
native-sysroot gcc from yocto? I can then add cuda-nvcc-native as
dependency.

Also in meson.cross this part looks odd to me:

[host_machine]
system = 'linux'
cpu_family = 'aarch64'
cpu = 'aarch64'
endian = 'little'

[target_machine]
system = 'linux'
cpu_family = 'aarch64'
cpu = 'aarch64'
endian = 'little'

shouldn't be host_machine set to x86?

Marek

> Alex
>
> On Wed, 26 Aug 2020 at 11:58, Marek Belisko <marek.belisko@gmail.com> wrote:
>>
>> Hi,
>>
>> I'm trying to compile a simple cuda application which is built using
>> the meson build system. I have an issue that meson looks for nvcc
>> compiler on my host and I don't have installed cuda-nvcc compiler
>> (just use cuda-nvcc-native as dependency). Can we somehow force meson
>> not to search the local host for compilers?
>>
>> Thanks and regards,
>>
>> marek
>>
>> --
>> as simple and primitive as possible
>> -------------------------------------------------
>> Marek Belisko - OPEN-NANDRA
>> Freelance Developer
>>
>> Ruska Nova Ves 219 | Presov, 08005 Slovak Republic
>> Tel: +421 915 052 184
>> skype: marekwhite
>> twitter: #opennandra
>> web: http://open-nandra.com
>> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [yocto] meson cuda compilation
  2020-08-26 10:18   ` Marek Belisko
@ 2020-08-26 10:33     ` Alexander Kanavin
  0 siblings, 0 replies; 4+ messages in thread
From: Alexander Kanavin @ 2020-08-26 10:33 UTC (permalink / raw)
  To: Belisko Marek; +Cc: yocto

[-- Attachment #1: Type: text/plain, Size: 682 bytes --]

On Wed, 26 Aug 2020 at 12:18, Belisko Marek <marek.belisko@gmail.com> wrote:

>
> first check build with my local gcc and then continue with cross
> compilation. Can we somehow skip or redirect for checking
> native-sysroot gcc from yocto? I can then add cuda-nvcc-native as
> dependency.
>

Yocto does not provide a gcc that targets the host machine, only the cross
gcc, whose output is unsuitable for running at configuration step.


> shouldn't be host_machine set to x86?
>

Meson assigns different meanings to these, yocto's host is called build
there, and host is actually host for the target binaries.
https://mesonbuild.com/Cross-compilation.html

Alex

[-- Attachment #2: Type: text/html, Size: 1243 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-08-26 10:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-26  9:57 meson cuda compilation Marek Belisko
2020-08-26 10:09 ` [yocto] " Alexander Kanavin
2020-08-26 10:18   ` Marek Belisko
2020-08-26 10:33     ` Alexander Kanavin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.