[Bug] mlc_llm pacakge issue(Clang versionError) · Issue #2696 · mlc-ai/mlc-llm (original) (raw)

100%] Built target tvm_runtime
[100%] Linking CXX static library libmlc_llm.a
[100%] Built target mlc_llm_static
[100%] Building CXX object CMakeFiles/tvm4j_runtime_packed.dir/mlc-llm/3rdparty/tvm/jvm/native/src/main/native/org_apache_tvm_native_c_api.cc.o
In file included from /mlc-llm/3rdparty/tvm/jvm/native/src/main/native/org_apache_tvm_native_c_api.cc:25:
In file included from /mlc-llm/android/mlc4j/src/cpp/tvm_runtime.h:9:
In file included from /mlc-llm/android/mlc4j/../../3rdparty/tvm/src/runtime/c_runtime_api.cc:27:
In file included from /mlc-llm/android/mlc4j/../../3rdparty/tvm/include/tvm/runtime/device_api.h:28:
In file included from /mlc-llm/android/mlc4j/../../3rdparty/tvm/include/tvm/runtime/ndarray.h:28:
In file included from /mlc-llm/android/mlc4j/../../3rdparty/tvm/include/tvm/runtime/container/optional.h:29:
In file included from /mlc-llm/android/mlc4j/../../3rdparty/tvm/include/tvm/runtime/container/./base.h:29:
In file included from /mlc-llm/android/mlc4j/../../3rdparty/tvm/include/tvm/runtime/memory.h:26:
/mlc-llm/android/mlc4j/../../3rdparty/tvm/include/tvm/runtime/object.h:574:67: error: no template named 'is_base_of_v' in namespace 'std'; did you mean 'is_base_of'?
template <typename ObjectType, typename = std::enable_if_t<std::is_base_of_v<Object, ObjectType>>>
~~~~~^~~~~~~~~~~~
is_base_of
/home/mbuhyd/Android/Sdk/ndk/25.2.9519653/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/type_traits:1725:29: note: 'is_base_of' declared here
struct _LIBCPP_TEMPLATE_VIS is_base_of
^
In file included from /mlc-llm/3rdparty/tvm/jvm/native/src/main/native/org_apache_tvm_native_c_api.cc:25:
In file included from /mlc-llm/android/mlc4j/src/cpp/tvm_runtime.h:9:
In file included from /mlc-llm/android/mlc4j/../../3rdparty/tvm/src/runtime/c_runtime_api.cc:27:
In file included from /mlc-llm/android/mlc4j/../../3rdparty/tvm/include/tvm/runtime/device_api.h:28:
In file included from /mlc-llm/android/mlc4j/../../3rdparty/tvm/include/tvm/runtime/ndarray.h:28:
In file included from /mlc-llm/android/mlc4j/../../3rdparty/tvm/include/tvm/runtime/container/optional.h:29:
In file included from /mlc-llm/android/mlc4j/../../3rdparty/tvm/include/tvm/runtime/container/./base.h:29:
In file included from /mlc-llm/android/mlc4j/../../3rdparty/tvm/include/tvm/runtime/memory.h:26:
/mlc-llm/android/mlc4j/../../3rdparty/tvm/include/tvm/runtime/object.h:574:62: error: template argument for non-type template parameter must be an expression
template <typename ObjectType, typename = std::enable_if_t<std::is_base_of_v<Object, ObjectType>>>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/mbuhyd/Android/Sdk/ndk/25.2.9519653/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/type_traits:542:16: note: template parameter is declared here
template <bool _Bp, class _Tp = void> using enable_if_t = typename enable_if<_Bp, _Tp>::type;
^
In file included from /mlc-llm/3rdparty/tvm/jvm/native/src/main/native/org_apache_tvm_native_c_api.cc:25:
In file included from /mlc-llm/android/mlc4j/src/cpp/tvm_runtime.h:9:
In file included from /mlc-llm/android/mlc4j/../../3rdparty/tvm/src/runtime/c_runtime_api.cc:27:
In file included from /mlc-llm/android/mlc4j/../../3rdparty/tvm/include/tvm/runtime/device_api.h:28:
In file included from /mlc-llm/android/mlc4j/../../3rdparty/tvm/include/tvm/runtime/ndarray.h:28:
In file included from /mlc-llm/android/mlc4j/../../3rdparty/tvm/include/tvm/runtime/container/optional.h:29:
In file included from /mlc-llm/android/mlc4j/../../3rdparty/tvm/include/tvm/runtime/container/./base.h:29:
In file included from /mlc-llm/android/mlc4j/../../3rdparty/tvm/include/tvm/runtime/memory.h:26:
/mlc-llm/android/mlc4j/../../3rdparty/tvm/include/tvm/runtime/object.h:595:46: error: no template named 'is_base_of_v' in namespace 'std'; did you mean 'is_base_of'?
typename = std::enable_if_t<std::is_base_of_v<ObjectRef, ObjectRefType>>>
~~~~~^~~~~~~~~~~~
is_base_of
/home/mbuhyd/Android/Sdk/ndk/25.2.9519653/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/type_traits:1725:29: note: 'is_base_of' declared here
struct _LIBCPP_TEMPLATE_VIS is_base_of
^
In file included from /mlc-llm/3rdparty/tvm/jvm/native/src/main/native/org_apache_tvm_native_c_api.cc:25:
In file included from /mlc-llm/android/mlc4j/src/cpp/tvm_runtime.h:9:
In file included from /mlc-llm/android/mlc4j/../../3rdparty/tvm/src/runtime/c_runtime_api.cc:27:
In file included from /mlc-llm/android/mlc4j/../../3rdparty/tvm/include/tvm/runtime/device_api.h:28:
In file included from /mlc-llm/android/mlc4j/../../3rdparty/tvm/include/tvm/runtime/ndarray.h:28:
In file included from /mlc-llm/android/mlc4j/../../3rdparty/tvm/include/tvm/runtime/container/optional.h:29:
In file included from /mlc-llm/android/mlc4j/../../3rdparty/tvm/include/tvm/runtime/container/./base.h:29:
In file included from /mlc-llm/android/mlc4j/../../3rdparty/tvm/include/tvm/runtime/memory.h:26:
/mlc-llm/android/mlc4j/../../3rdparty/tvm/include/tvm/runtime/object.h:595:41: error: template argument for non-type template parameter must be an expression
typename = std::enable_if_t<std::is_base_of_v<ObjectRef, ObjectRefType>>>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/mbuhyd/Android/Sdk/ndk/25.2.9519653/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/type_traits:542:16: note: template parameter is declared here
template <bool _Bp, class _Tp = void> using enable_if_t = typename enable_if<_Bp, _Tp>::type;
^
In file included from /mlc-llm/3rdparty/tvm/jvm/native/src/main/native/org_apache_tvm_native_c_api.cc:25:
In file included from /mlc-llm/android/mlc4j/src/cpp/tvm_runtime.h:9:
In file included from /mlc-llm/android/mlc4j/../../3rdparty/tvm/src/runtime/c_runtime_api.cc:27:
In file included from /mlc-llm/android/mlc4j/../../3rdparty/tvm/include/tvm/runtime/device_api.h:28:
In file included from /mlc-llm/android/mlc4j/../../3rdparty/tvm/include/tvm/runtime/ndarray.h:30:
/mlc-llm/android/mlc4j/../../3rdparty/tvm/include/tvm/runtime/container/string.h:511:27: error: no matching member function for call to 'as'
if (const auto* str = a.as()) {
~~^~~~~~~~~~~~~
/mlc-llm/android/mlc4j/../../3rdparty/tvm/include/tvm/runtime/object.h:906:37: note: candidate template ignored: couldn't infer template argument ''
inline const ObjectType* ObjectRef::as() const {
^
/mlc-llm/android/mlc4j/../../3rdparty/tvm/include/tvm/runtime/container/optional.h:157:43: note: candidate template ignored: couldn't infer template argument ''
inline Optional ObjectRef::as() const {
^
In file included from /mlc-llm/3rdparty/tvm/jvm/native/src/main/native/org_apache_tvm_native_c_api.cc:25:
In file included from /mlc-llm/android/mlc4j/src/cpp/tvm_runtime.h:9:
In file included from /mlc-llm/android/mlc4j/../../3rdparty/tvm/src/runtime/c_runtime_api.cc:27:
In file included from /mlc-llm/android/mlc4j/../../3rdparty/tvm/include/tvm/runtime/device_api.h:28:
In file included from /mlc-llm/android/mlc4j/../../3rdparty/tvm/include/tvm/runtime/ndarray.h:30:
/mlc-llm/android/mlc4j/../../3rdparty/tvm/include/tvm/runtime/container/string.h:521:29: error: no matching member function for call to 'as'
if (const auto* str_a = a.as()) {
~~^~~~~~~~~~~~~
/mlc-llm/android/mlc4j/../../3rdparty/tvm/include/tvm/runtime/object.h:906:37: note: candidate template ignored: couldn't infer template argument ''
inline const ObjectType* ObjectRef::as() const {
^
/mlc-llm/android/mlc4j/../../3rdparty/tvm/include/tvm/runtime/container/optional.h:157:43: note: candidate template ignored: couldn't infer template argument ''
inline Optional ObjectRef::as() const {
^
In file included from /mlc-llm/3rdparty/tvm/jvm/native/src/main/native/org_apache_tvm_native_c_api.cc:25:
In file included from /mlc-llm/android/mlc4j/src/cpp/tvm_runtime.h:9:
In file included from /mlc-llm/android/mlc4j/../../3rdparty/tvm/src/runtime/c_runtime_api.cc:27:
In file included from /mlc-llm/android/mlc4j/../../3rdparty/tvm/include/tvm/runtime/device_api.h:28:
In file included from /mlc-llm/android/mlc4j/../../3rdparty/tvm/include/tvm/runtime/ndarray.h:30:
/mlc-llm/android/mlc4j/../../3rdparty/tvm/include/tvm/runtime/container/string.h:522:31: error: no matching member function for call to 'as'
if (const auto* str_b = b.as()) {
~~^~~~~~~~~~~~~
/mlc-llm/android/mlc4j/../../3rdparty/tvm/include/tvm/runtime/object.h:906:37: note: candidate template ignored: couldn't infer template argument ''
inline const ObjectType* ObjectRef::as() const {
^
/mlc-llm/android/mlc4j/../../3rdparty/tvm/include/tvm/runtime/container/optional.h:157:43: note: candidate template ignored: couldn't infer template argument ''
inline Optional ObjectRef::as() const {
^
In file included from /mlc-llm/3rdparty/tvm/jvm/native/src/main/native/org_apache_tvm_native_c_api.cc:25:
In file included from /mlc-llm/android/mlc4j/src/cpp/tvm_runtime.h:9:
In file included from /mlc-llm/android/mlc4j/../../3rdparty/tvm/src/runtime/c_runtime_api.cc:27:
In file included from /mlc-llm/android/mlc4j/../../3rdparty/tvm/include/tvm/runtime/device_api.h:29:
In file included from /mlc-llm/android/mlc4j/../../3rdparty/tvm/include/tvm/runtime/packed_func.h:28:
/mlc-llm/android/mlc4j/../../3rdparty/tvm/include/tvm/runtime/container/array.h:261:12: error: no template named 'bool_constant' in namespace 'std'; did you mean '_BoolConstant'?
: std::bool_constant<std::is_base_of_v<
~~~~~^~~~~~~~~~~~~
_BoolConstant
/home/mbuhyd/Android/Sdk/ndk/25.2.9519653/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/type_traits:459:1: note: '_BoolConstant' declared here
using _BoolConstant _LIBCPP_NODEBUG_TYPE = integral_constant<bool, _Val>;
^
In file included from /mlc-llm/3rdparty/tvm/jvm/native/src/main/native/org_apache_tvm_native_c_api.cc:25:
In file included from /mlc-llm/android/mlc4j/src/cpp/tvm_runtime.h:9:
In file included from /mlc-llm/android/mlc4j/../../3rdparty/tvm/src/runtime/c_runtime_api.cc:27:
In file included from /mlc-llm/android/mlc4j/../../3rdparty/tvm/include/tvm/runtime/device_api.h:29:
In file included from /mlc-llm/android/mlc4j/../../3rdparty/tvm/include/tvm/runtime/packed_func.h:28:
/mlc-llm/android/mlc4j/../../3rdparty/tvm/include/tvm/runtime/container/array.h:261:31: error: no template named 'is_base_of_v' in namespace 'std'; did you mean 'is_base_of'?
: std::bool_constant<std::is_base_of_v<
~~~~~^~~~~~~~~~~~
is_base_of
/home/mbuhyd/Android/Sdk/ndk/25.2.9519653/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/type_traits:1725:29: note: 'is_base_of' declared here
struct _LIBCPP_TEMPLATE_VIS is_base_of
^
In file included from /mlc-llm/3rdparty/tvm/jvm/native/src/main/native/org_apache_tvm_native_c_api.cc:25:
In file included from /mlc-llm/android/mlc4j/src/cpp/tvm_runtime.h:9:
In file included from /mlc-llm/android/mlc4j/../../3rdparty/tvm/src/runtime/c_runtime_api.cc:27:
In file included from /mlc-llm/android/mlc4j/../../3rdparty/tvm/include/tvm/runtime/device_api.h:29:
In file included from /mlc-llm/android/mlc4j/../../3rdparty/tvm/include/tvm/runtime/packed_func.h:28:
/mlc-llm/android/mlc4j/../../3rdparty/tvm/include/tvm/runtime/container/array.h:261:26: error: template argument for non-type template parameter must be an expression
: std::bool_constant<std::is_base_of_v<
^~~~~~~~~~~~~~~~~~
/home/mbuhyd/Android/Sdk/ndk/25.2.9519653/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/type_traits:458:16: note: template parameter is declared here
template
^
In file included from /mlc-llm/3rdparty/tvm/jvm/native/src/main/native/org_apache_tvm_native_c_api.cc:25:
In file included from /mlc-llm/android/mlc4j/src/cpp/tvm_runtime.h:9:
In file included from /mlc-llm/android/mlc4j/../../3rdparty/tvm/src/runtime/c_runtime_api.cc:27:
In file included from /mlc-llm/android/mlc4j/../../3rdparty/tvm/include/tvm/runtime/device_api.h:29:
In file included from /mlc-llm/android/mlc4j/../../3rdparty/tvm/include/tvm/runtime/packed_func.h:28:
/mlc-llm/android/mlc4j/../../3rdparty/tvm/include/tvm/runtime/container/array.h:268:1: warning: inline variables are a C++17 extension [-Wc++17-extensions]
inline constexpr bool is_valid_iterator_v = is_valid_iterator<T, IterType>::value;
^
/mlc-llm/android/mlc4j/../../3rdparty/tvm/include/tvm/runtime/container/array.h:650:43: error: no template named 'invoke_result_t' in namespace 'std'
template <typename F, typename U = std::invoke_result_t<F, T>>
~~~~~^
/mlc-llm/android/mlc4j/../../3rdparty/tvm/include/tvm/runtime/container/array.h:661:58: error: no template named 'is_same_v' in namespace 'std'; did you mean 'is_same'?
template <typename F, typename = std::enable_if_t<std::is_same_v<T, std::invoke_result_t<F, T>>>>
~~~~~^~~~~~~~~
is_same
/home/mbuhyd/Android/Sdk/ndk/25.2.9519653/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/type_traits:550:29: note: 'is_same' declared here
struct _LIBCPP_TEMPLATE_VIS is_same : _BoolConstant<__is_same(_Tp, _Up)> { };
^
In file included from /mlc-llm/3rdparty/tvm/jvm/native/src/main/native/org_apache_tvm_native_c_api.cc:25:
In file included from /mlc-llm/android/mlc4j/src/cpp/tvm_runtime.h:9:
In file included from /mlc-llm/android/mlc4j/../../3rdparty/tvm/src/runtime/c_runtime_api.cc:27:
In file included from /mlc-llm/android/mlc4j/../../3rdparty/tvm/include/tvm/runtime/device_api.h:29:
In file included from /mlc-llm/android/mlc4j/../../3rdparty/tvm/include/tvm/runtime/packed_func.h:28:
/mlc-llm/android/mlc4j/../../3rdparty/tvm/include/tvm/runtime/container/array.h:661:76: error: no member named 'invoke_result_t' in namespace 'std'
template <typename F, typename = std::enable_if_t<std::is_same_v<T, std::invoke_result_t<F, T>>>>
~~~~~^
/mlc-llm/android/mlc4j/../../3rdparty/tvm/include/tvm/runtime/container/array.h:661:92: error: 'F' does not refer to a value
template <typename F, typename = std::enable_if_t<std::is_same_v<T, std::invoke_result_t<F, T>>>>
^
/mlc-llm/android/mlc4j/../../3rdparty/tvm/include/tvm/runtime/container/array.h:661:22: note: declared here
template <typename F, typename = std::enable_if_t<std::is_same_v<T, std::invoke_result_t<F, T>>>>
^
/mlc-llm/android/mlc4j/../../3rdparty/tvm/include/tvm/runtime/container/array.h:661:99: error: expected member name or ';' after declaration specifiers
template <typename F, typename = std::enable_if_t<std::is_same_v<T, std::invoke_result_t<F, T>>>>
^
/mlc-llm/android/mlc4j/../../3rdparty/tvm/include/tvm/runtime/container/array.h:784:43: error: no template named 'invoke_result_t' in namespace 'std'
template <typename F, typename U = std::invoke_result_t<F, T>>
~~~~~^
/mlc-llm/android/mlc4j/../../3rdparty/tvm/include/tvm/runtime/container/array.h:792:47: error: no template named 'is_same_v' in namespace 'std'; did you mean 'is_same'?
constexpr bool is_same_output_type = std::is_same_v<T, U>;
~~~~~^~~~~~~~~
is_same
/home/mbuhyd/Android/Sdk/ndk/25.2.9519653/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/type_traits:550:29: note: 'is_same' declared here
struct _LIBCPP_TEMPLATE_VIS is_same : _BoolConstant<__is_same(_Tp, _Up)> { };
^
In file included from /mlc-llm/3rdparty/tvm/jvm/native/src/main/native/org_apache_tvm_native_c_api.cc:25:
In file included from /mlc-llm/android/mlc4j/src/cpp/tvm_runtime.h:9:
In file included from /mlc-llm/android/mlc4j/../../3rdparty/tvm/src/runtime/c_runtime_api.cc:27:
In file included from /mlc-llm/android/mlc4j/../../3rdparty/tvm/include/tvm/runtime/device_api.h:29:
In file included from /mlc-llm/android/mlc4j/../../3rdparty/tvm/include/tvm/runtime/packed_func.h:28:
/mlc-llm/android/mlc4j/../../3rdparty/tvm/include/tvm/runtime/container/array.h:792:62: error: expected '(' for function-style cast or type construction
constexpr bool is_same_output_type = std::is_same_v<T, U>;
~~~~~~~~~~~~~~~~~~~~^
/mlc-llm/android/mlc4j/../../3rdparty/tvm/include/tvm/runtime/container/array.h:794:8: warning: constexpr if is a C++17 extension [-Wc++17-extensions]
if constexpr (is_same_output_type) {
^
/mlc-llm/android/mlc4j/../../3rdparty/tvm/include/tvm/runtime/container/array.h:794:19: error: constexpr if condition is not a constant expression
if constexpr (is_same_output_type) {
^~~~~~~~~~~~~~~~~~~
/mlc-llm/android/mlc4j/../../3rdparty/tvm/include/tvm/runtime/container/array.h:794:19: note: initializer of 'is_same_output_type' is unknown
/mlc-llm/android/mlc4j/../../3rdparty/tvm/include/tvm/runtime/container/array.h:792:20: note: declared here
constexpr bool is_same_output_type = std::is_same_v<T, U>;
^
/mlc-llm/android/mlc4j/../../3rdparty/tvm/include/tvm/runtime/container/array.h:814:8: warning: constexpr if is a C++17 extension [-Wc++17-extensions]
if constexpr (compatible_types) {
^
/mlc-llm/android/mlc4j/../../3rdparty/tvm/include/tvm/runtime/container/array.h:876:1: warning: inline variables are a C++17 extension [-Wc++17-extensions]
inline constexpr bool is_tvm_array = false;
^
/mlc-llm/android/mlc4j/../../3rdparty/tvm/include/tvm/runtime/container/array.h:879:1: warning: inline variables are a C++17 extension [-Wc++17-extensions]
inline constexpr bool is_tvm_array = true;
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
5 warnings and 20 errors generated.
gmake[3]: *** [CMakeFiles/tvm4j_runtime_packed.dir/build.make:76: CMakeFiles/tvm4j_runtime_packed.dir/mlc-llm/3rdparty/tvm/jvm/native/src/main/native/org_apache_tvm_native_c_api.cc.o] Error 1
gmake[2]: *** [CMakeFiles/Makefile2:263: CMakeFiles/tvm4j_runtime_packed.dir/all] Error 2
gmake[1]: *** [CMakeFiles/Makefile2:270: CMakeFiles/tvm4j_runtime_packed.dir/rule] Error 2
gmake: *** [Makefile:203: tvm4j_runtime_packed] Error 2
Traceback (most recent call last):
File "/mlc-llm/android/mlc4j/prepare_libs.py", line 120, in
main(parsed.mlc_llm_source_dir)
File "/mlc-llm/android/mlc4j/prepare_libs.py", line 103, in main
run_cmake_build()
File "/mlc-llm/android/mlc4j/prepare_libs.py", line 66, in run_cmake_build
subprocess.run(cmd, check=True, env=os.environ)
File "/home/mbuhyd/anaconda3/envs/Jul26mlc/lib/python3.11/subprocess.py", line 571, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--target', 'tvm4j_runtime_packed', '--config', 'release', '-j8']' returned non-zero exit status 2.
Traceback (most recent call last):
File "", line 198, in _run_module_as_main
File "", line 88, in _run_code
File "/home/mbuhyd/anaconda3/envs/Jul26mlc/lib/python3.11/site-packages/mlc_llm/main.py", line 64, in
main()
File "/home/mbuhyd/anaconda3/envs/Jul26mlc/lib/python3.11/site-packages/mlc_llm/main.py", line 53, in main
cli.main(sys.argv[2:])
File "/home/mbuhyd/anaconda3/envs/Jul26mlc/lib/python3.11/site-packages/mlc_llm/cli/package.py", line 64, in main
package(
File "/home/mbuhyd/anaconda3/envs/Jul26mlc/lib/python3.11/site-packages/mlc_llm/interface/package.py", line 361, in package
build_android_binding(mlc_llm_source_dir, output)
File "/home/mbuhyd/anaconda3/envs/Jul26mlc/lib/python3.11/site-packages/mlc_llm/interface/package.py", line 275, in build_android_binding
subprocess.run([sys.executable, mlc4j_path / "prepare_libs.py"], check=True, env=os.environ)
File "/home/mbuhyd/anaconda3/envs/Jul26mlc/lib/python3.11/subprocess.py", line 571, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/home/mbuhyd/anaconda3/envs/Jul26mlc/bin/python', PosixPath('/mlc-llm/android/mlc4j/prepare_libs.py')]' returned non-zero exit status 1.