I'm using meson build on Ubuntu to compile a small project. I have the following setup:
project('cuda_project', 'cuda',
default_options: [
'cpp_std=c++17',
'cuda_ccbindir=/usr/bin/g++-11',
],
)
cuda_compiler = meson.get_compiler('cuda')
exe = executable(
'main.exe',
'main.cu',
link_args: '-fopenmp',
cuda_args: '-Xcompiler=-fopenmp',
)
test('simple_run', exe)
Everything works. Except, when I try to do meson test -c builddir
, meson gives me a:
FileNotFoundError: [Errno 2] No such file or directory: 'mono'
What does mono
have to do with running a simple test case on Linux?
I'm using meson build on Ubuntu to compile a small project. I have the following setup:
project('cuda_project', 'cuda',
default_options: [
'cpp_std=c++17',
'cuda_ccbindir=/usr/bin/g++-11',
],
)
cuda_compiler = meson.get_compiler('cuda')
exe = executable(
'main.exe',
'main.cu',
link_args: '-fopenmp',
cuda_args: '-Xcompiler=-fopenmp',
)
test('simple_run', exe)
Everything works. Except, when I try to do meson test -c builddir
, meson gives me a:
FileNotFoundError: [Errno 2] No such file or directory: 'mono'
What does mono
have to do with running a simple test case on Linux?
1 Answer
Reset to default 1The problem is that the executable file suffix is .exe
, while running on Linux. A quick and easy fix is to simply change the suffix to .bin
, for example:
exe = executable(
'main.bin', # Do not use .exe here
'main.cu',
link_args: '-fopenmp',
cuda_args: '-Xcompiler=-fopenmp',
)
test('simple_run', exe)
Should run perfectly well. The decision to try running an .exe
file with mono
while on Linux, comes from this exact line in meson.