apache / apache/tvm

[Bug] build CXX standard conflicts: tvm-ffi expects cxx_std_17 while tvm now upgraded to 20

Open
#20,042 5 comments 0 reactions 0 assignees View on GitHub
needs-triage type: bug
Dominant language
Python
Stars
13.7k
Forks
4k
Avg merge
2d 1h
Merged PRs (30d)
112

Description

Encounter below error during `pip install .`
```
In file included from ....tvm/3rdparty/tvm-ffi/src/ffi/extra/structural_visit.cc:23:
In file included from ....tvm/3rdparty/tvm-ffi/include/tvm/ffi/container/array.h:29:
In file included from ....tvm/3rdparty/tvm-ffi/include/tvm/ffi/any.h:27:
In file included from ....tvm/3rdparty/tvm-ffi/include/tvm/ffi/string.h:28:
In file included from ....tvm/3rdparty/tvm-ffi/include/tvm/ffi/error.h:29:
In file included from ....tvm/3rdparty/tvm-ffi/include/tvm/ffi/memory.h:26:
In file included from ....tvm/3rdparty/tvm-ffi/include/tvm/ffi/object.h:28:
In file included from ....tvm/3rdparty/tvm-ffi/include/tvm/ffi/type_traits.h:29:

/usr/lib/gcc/x86_64-linux-gnu/16/../../../../include/c++/16/optional:900:7: error: satisfaction of constraint 'is_constructible_v<_Tp, _Up>' depends on itself
900 | && is_constructible_v<_Tp, _Up>
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/gcc/x86_64-linux-gnu/16/../../../../include/c++/16/type_traits:3683:70: note: while checking constraint satisfaction for template 'optional &>' required here
3683 | inline constexpr bool is_constructible_v = __is_constructible(_Tp, _Args...);
| ^~~~~
/usr/lib/gcc/x86_64-linux-gnu/16/../../../../include/c++/16/type_traits:3683:70: note: while substituting deduced template arguments into function template 'optional' [with _Up = const tvm::ffi::Optional &]
/usr/lib/gcc/x86_64-linux-gnu/16/../../../../include/c++/16/optional:900:7: note: in instantiation of variable template specialization 'std::is_constructible_v &>' requested here
900 | && is_constructible_v<_Tp, _Up>
| ^
/usr/lib/gcc/x86_64-linux-gnu/16/../../../../include/c++/16/optional:900:7: note: while substituting template arguments into constraint expression here
900 | && is_constructible_v<_Tp, _Up>
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/gcc/x86_64-linux-gnu/16/../../../../include/c++/16/type_traits:3718:41: note: while checking constraint satisfaction for template 'optional &>' required here
3718 | = __is_trivially_constructible(_Tp, __add_lval_ref_t);
| ^~~~~~~~~~~~~~~~
/usr/lib/gcc/x86_64-linux-gnu/16/../../../../include/c++/16/type_traits:3718:41: note: while substituting deduced template arguments into function template 'optional' [with _Up = const tvm::ffi::Optional &]
/usr/lib/gcc/x86_64-linux-gnu/16/../../../../include/c++/16/optional:499:12: note: in instantiation of variable template specialization 'std::is_trivially_copy_constructible_v>' requested here
499 | bool = is_trivially_copy_constructible_v<_Tp>,
| ^
/usr/lib/gcc/x86_64-linux-gnu/16/../../../../include/c++/16/optional:806:15: note: in instantiation of default argument for '_Optional_base>' required here
806 | : private _Optional_base<_Tp>,
| ^~~~~~~~~~~~~~~~~~~
....tvm/3rdparty/tvm-ffi/include/tvm/ffi/function.h:678:40: note: in instantiation of template class 'std::optional>' requested here
678 | if (auto val = result.template try_cast()) {
| ^
....tvm/3rdparty/tvm-ffi/include/tvm/ffi/extra/structural_visit.h:195:36: note: in instantiation of function template specialization 'tvm::ffi::Function::CallExpected, tvm::ffi::StructuralVisitorObj *, tvm::ffi::AnyView &>' requested here
195 | return attr.cast().CallExpected>(this, value);
| ^
2 errors generated.
```

### Environment

Ubuntu 26.04 LTS (Linux 7.0.0-28-generic 28-Ubuntu SMP PREEMPT_DYNAMIC Sun Jun 21 01:01:36 UTC 2026 x86_64 GNU/Linux)
- AMD Ryzen AI 9 HX 370
- conda virtual environment [python 3.12.13]
- cuda-toolkit 13.0.3.0
- ROCM 7.14

```
USE_CUDA = "ON"
USE_ROCM = "ON"
USE_LLVM = "ON"
# USE_CUBLAS = "ON"
# USE_HIPBLAS = "ON"
# USE_CUDNN = "ON"
CMAKE_C_COMPILER = "/opt/rocm/llvm/bin/clang"
CMAKE_CXX_COMPILER = "/opt/rocm/llvm/bin/clang++"
```

```
/usr/include/x86_64-linux-gnu/c++$ ll
total 20
drwxr-xr-x 5 root root 4096 Jul 21 23:41 ./
drwxr-xr-x 7 root root 4096 Jul 28 06:39 ../
drwxr-xr-x 4 root root 4096 Jul 17 22:13 11/
drwxr-xr-x 6 root root 4096 Jul 17 22:13 15/
drwxr-xr-x 4 root root 4096 Jul 21 23:41 16/
```
* needs-triage

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with 3rdparty/tvm-ffi/include/tvm/ffi/function.h at line 678 and 3rdparty/tvm-ffi/include/tvm/ffi/extra/structural_visit.h at line 195, then inspect the CMake C++ standard settings for tvm-ffi and TVM. Reproduce the failure with pip install . using the reported Clang/LLVM and GCC environment; done means the build completes without the C++ standard conflict.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.