tvm icon indicating copy to clipboard operation
tvm copied to clipboard

Update C++ standard to C++17

Open kparzysz-quic opened this issue 2 years ago • 3 comments

LLVM has switched to C++17 in its development branch. Follow suit to be able to compile LLVM headers.

kparzysz-quic avatar Aug 08 '22 15:08 kparzysz-quic

LGTM! @kparzysz-quic do you mind also post an announcement thread? So people are aware

tqchen avatar Aug 08 '22 16:08 tqchen

LGTM! @kparzysz-quic do you mind also post an announcement thread? So people are aware

Sure, I'll just need to resolve the build failures. I'll post the announcement once the PR is ready to merge.

kparzysz-quic avatar Aug 08 '22 18:08 kparzysz-quic

Great news!

Just need to carefully check the installation documents as well. For example, update "C++ 14" to "C++ 17" in https://github.com/apache/tvm/blob/fbb7b5d1a0d82acb1f581dd2ec362b4dcad2638e/docs/install/from_source.rst

In the meantime, it might be better to specify the required minimal compiler versions as the coverage to C++17 standard varies a lot in different compiler versions.

For example, if we just want to pass the "-std=c++17" flag, then the required minimals can be:

  • gcc >= 5
  • clang >= 5
  • visual studio >= 2017 15.3

However, those initial version might poorly support some useful library features like std::filesystem. For example, gcc implements filesystems as a non-experimental library in gcc-8.

Since the motivation is to compiler newer versions of LLVM, maybe we can just follow LLVM's compiler constraints.

  • Clang 5.0
  • Apple Clang 9.3
  • GCC 7.1
  • Visual Studio 2019 16.7

cc: @junrushao1994 @tqchen

ganler avatar Aug 09 '22 00:08 ganler

I would love to second @ganler that we might want to provide clearer instruction on TVM official website to make TVM more approachable to new contributors. @kparzysz-quic @tqchen would either of you mind making such a change accordingly? I'm happy to submit a PR too if you guys prefer

junrushao avatar Aug 12 '22 00:08 junrushao

I created a https://github.com/apache/tvm/pull/12405 with docs update. Let me know if you want to have more information in it.

kparzysz-quic avatar Aug 12 '22 16:08 kparzysz-quic