最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Meson FileNotFoundError: [Errno 2] No such file or directory: 'mono' - Stack Overflow

programmeradmin3浏览0评论

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?

Share Improve this question asked Mar 15 at 21:40 tornikeotornikeo 9678 silver badges21 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

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

发布评论

评论列表(0)

  1. 暂无评论