mesonbuild / mesonbuild/meson

Cuda CI image builder fails to detect nvcc as a working compiler

Open
#12,486 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

CI language:cuda
Dominant language
Python
Stars
6.6k
Forks
1.9k
Avg merge
2d 6h
Merged PRs (30d)
33

Description

```
========================================= cuda: 16 multistd ========================================

Failed during: configure
Reason: Generating the build system failed.

(inprocess) $ setup --prefix /usr --libdir lib 'test cases/cuda/16 multistd' '/meson/b 59b67b5a57' --backend=ninja
Included file /meson/b 59b67b5a57/meson-logs/meson-log.txt:
Build started at 2023-11-06T22:20:27.362738
Main binary: /usr/sbin/python3
Build Options: -Dprefix=/usr -Dlibdir=lib -Dbackend=ninja
Python system: Linux
The Meson build system
Version: 1.3.0.rc2
Source dir: /meson/test cases/cuda/16 multistd
Build dir: /meson/b 59b67b5a57
Build type: native build
Project name: C++-CUDA multi-std
Project version: 1.0.0
-----------
Detecting compiler via: `c++ --version` -> 0
stdout:
c++ (GCC) 13.2.1 20230801
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-----------
Running command: c++ -E -dM -
-----
-----------
Detecting linker via: `c++ -Wl,--version` -> 0
stdout:
GNU ld (GNU Binutils) 2.41.0
Copyright (C) 2023 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later version.
This program has absolutely no warranty.
-----------
stderr:
collect2 version 13.2.1 20230801
/usr/sbin/ld -plugin /usr/lib/gcc/x86_64-pc-linux-gnu/13.2.1/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-pc-linux-gnu/13.2.1/lto-wrapper -plugin-opt=-fresolution=/tmp/cc798qd5.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --build-id --eh-frame-hdr --hash-style=gnu -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie /usr/lib/gcc/x86_64-pc-linux-gnu/13.2.1/../../../../lib/Scrt1.o /usr/lib/gcc/x86_64-pc-linux-gnu/13.2.1/../../../../lib/crti.o /usr/lib/gcc/x86_64-pc-linux-gnu/13.2.1/crtbeginS.o -L/usr/lib/gcc/x86_64-pc-linux-gnu/13.2.1 -L/usr/lib/gcc/x86_64-pc-linux-gnu/13.2.1/../../../../lib -L/lib/../lib -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-pc-linux-gnu/13.2.1/../../.. --version -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-pc-linux-gnu/13.2.1/crtendS.o /usr/lib/gcc/x86_64-pc-linux-gnu/13.2.1/../../../../lib/crtn.o
-----------
Sanity testing C++ compiler: c++
Is cross compiler: False.
Sanity check compiler command line: c++ sanitycheckcpp.cc -o sanitycheckcpp.exe -D_FILE_OFFSET_BITS=64
Sanity check compile stdout:

-----
Sanity check compile stderr:

-----
Running test binary command: '/meson/b 59b67b5a57/meson-private/sanitycheckcpp.exe'
C++ compiler for the host machine: c++ (gcc 13.2.1 "c++ (GCC) 13.2.1 20230801")
C++ linker for the host machine: c++ ld.bfd 2.41.0
-----------
Detecting linker via: `gcc-ar --version` -> 0
stdout:
GNU ar (GNU Binutils) 2.41.0
Copyright (C) 2023 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) any later version.
This program has absolutely no warranty.
-----------
-----------
Detecting compiler via: `nvcc --version` -> 0
stdout:
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2023 NVIDIA Corporation
Built on Fri_Sep__8_19:17:24_PDT_2023
Cuda compilation tools, release 12.3, V12.3.52
Build cuda_12.3.r12.3/compiler.33281558_0
-----------
-----------
Detecting compiler via: `c++ --version` -> 0
stdout:
c++ (GCC) 13.2.1 20230801
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-----------
Running command: c++ -E -dM -
-----
-----------
Detecting linker via: `c++ -Wl,--version` -> 0
stdout:
GNU ld (GNU Binutils) 2.41.0
Copyright (C) 2023 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later version.
This program has absolutely no warranty.
-----------
stderr:
collect2 version 13.2.1 20230801
/usr/sbin/ld -plugin /usr/lib/gcc/x86_64-pc-linux-gnu/13.2.1/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-pc-linux-gnu/13.2.1/lto-wrapper -plugin-opt=-fresolution=/tmp/ccf69I3b.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --build-id --eh-frame-hdr --hash-style=gnu -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie /usr/lib/gcc/x86_64-pc-linux-gnu/13.2.1/../../../../lib/Scrt1.o /usr/lib/gcc/x86_64-pc-linux-gnu/13.2.1/../../../../lib/crti.o /usr/lib/gcc/x86_64-pc-linux-gnu/13.2.1/crtbeginS.o -L/usr/lib/gcc/x86_64-pc-linux-gnu/13.2.1 -L/usr/lib/gcc/x86_64-pc-linux-gnu/13.2.1/../../../../lib -L/lib/../lib -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-pc-linux-gnu/13.2.1/../../.. --version -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-pc-linux-gnu/13.2.1/crtendS.o /usr/lib/gcc/x86_64-pc-linux-gnu/13.2.1/../../../../lib/crtn.o
-----------
Sanity testing Cuda compiler: nvcc
Is cross compiler: False.
Sanity check compiler command line: nvcc -w -cudart static /meson/b 59b67b5a57/meson-private/sanitycheckcuda.cu -o /meson/b 59b67b5a57/meson-private/sanitycheckcuda.exe
Sanity check compile stdout:

-----
Sanity check compile stderr:
/usr/include/bits/floatn.h(86): error: invalid combination of type specifiers
typedef __float128 _Float128;
^

/usr/include/bits/floatn-common.h(214): error: invalid combination of type specifiers
typedef float _Float32;
^

/usr/include/bits/floatn-common.h(251): error: invalid combination of type specifiers
typedef double _Float64;
^

/usr/include/bits/floatn-common.h(268): error: invalid combination of type specifiers
typedef double _Float32x;
^

/usr/include/bits/floatn-common.h(285): error: invalid combination of type specifiers
typedef long double _Float64x;
^

5 errors detected in the compilation of "/meson/b 59b67b5a57/meson-private/sanitycheckcuda.cu".

-----

test cases/cuda/16 multistd/meson.build:1:0: ERROR: Compiler nvcc cannot compile programs.

Traceback (most recent call last):
File "/meson/run_tests.py", line 325, in run_configure_inprocess
returncode = mesonmain.run(commandlist, get_meson_script())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/meson/mesonbuild/mesonmain.py", line 285, in run
return CommandLineParser().run(args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/meson/mesonbuild/mesonmain.py", line 196, in run
return errorhandler(e, command)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/meson/mesonbuild/mesonmain.py", line 40, in errorhandler
raise e
File "/meson/mesonbuild/mesonmain.py", line 194, in run
return options.run_func(options)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/meson/mesonbuild/msetup.py", line 358, in run
app.generate()
File "/meson/mesonbuild/msetup.py", line 181, in generate
return self._generate(env, capture, vslite_ctx)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/meson/mesonbuild/msetup.py", line 203, in _generate
intr = interpreter.Interpreter(b, user_defined_options=user_defined_options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/meson/mesonbuild/interpreter/interpreter.py", line 331, in __init__
self.parse_project()
File "/meson/mesonbuild/interpreterbase/interpreterbase.py", line 132, in parse_project
self.evaluate_codeblock(self.ast, end=1)
File "/meson/mesonbuild/interpreterbase/interpreterbase.py", line 198, in evaluate_codeblock
raise e
File "/meson/mesonbuild/interpreterbase/interpreterbase.py", line 190, in evaluate_codeblock
self.evaluate_statement(cur)
File "/meson/mesonbuild/interpreterbase/interpreterbase.py", line 204, in evaluate_statement
return self.function_call(cur)
^^^^^^^^^^^^^^^^^^^^^^^
File "/meson/mesonbuild/interpreterbase/interpreterbase.py", line 530, in function_call
res = func(node, func_args, kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/meson/mesonbuild/interpreterbase/decorators.py", line 260, in wrapper
return f(*nargs, **wrapped_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/meson/mesonbuild/interpreterbase/decorators.py", line 579, in wrapper
return f(*wrapped_args, **wrapped_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/meson/mesonbuild/interpreter/interpreter.py", line 1308, in func_project
self.add_languages(proj_langs, True, MachineChoice.HOST)
File "/meson/mesonbuild/interpreter/interpreter.py", line 1476, in add_languages
success = self.add_languages_for(args, required, for_machine)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/meson/mesonbuild/interpreter/interpreter.py", line 1519, in add_languages_for
comp = compilers.detect_compiler_for(self.environment, lang, for_machine, skip_sanity_check)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/meson/mesonbuild/compilers/detect.py", line 121, in detect_compiler_for
comp.sanity_check(env.get_scratch_dir(), env)
File "/meson/mesonbuild/compilers/cuda.py", line 560, in sanity_check
raise EnvironmentException(f'Compiler {self.name_string()} cannot compile programs.')
mesonbuild.utils.universal.EnvironmentException: Compiler nvcc cannot compile programs.
```

/cc @SoapGentoo @obilaniu

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in mesonbuild/compilers/cuda.py and reproduce with test cases/cuda/16 multistd/meson.build, using the logged nvcc sanity-check failure as the entry point. Trace the CUDA compiler sanity check around the reported system-header errors and verify the affected test case. Done means this test configures successfully with the affected nvcc environment.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system, compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.