[Mesa-dev] [PATCH v4 0/2] build system: Unify c++11 detection and used [was: configure+mesa/st:check -std=c++11 support and enable tests accordingly]

Chuck Atkins chuck.atkins at kitware.com
Mon Oct 16 14:31:06 UTC 2017


Hi Gert, Emil,

I think that using the -std=c++11 check should be good,


A few things to consider, neither of which is a deal breaker, I just want
to make sure they're not forgotten about:

   1. -std=c++ will cover many cases, but not all.  Many commercial
   compilers use a different set of options:
      - IBM XL: some versions use -std=c++11, others use
      -qlanglvl=extended0x
      - PGI: --c++11
      - Clang: older vertsions use -std=c++0x
      - Intel: Some versions use -std=c++, others use -std=c++11
   2. This only checks support for language suport, not std library
   support.  This can be problematic where your compiler doesn't have it's own
   standard library (i.e. Intel and PGI).  This puts you in a wierd spot where
   things like range-for loops work because they're a language feature but
   std::unique_ptr is not available because it's an std lib feature.

Both of these are managable, #1 by looping through possible flags to test
for and #2 by performing a test compile of C++ code using required library
features and the compiler flags accepted by #1.  I would even venture to
say they could be accounted for as needed, rather than dealt with apriori.
The use cases should not be forgotten though.  Neither of these are common
on a typical end-user linux desktop but they are the norm on HPC /
SuperComputing systems, where Mesa+llvmpipe or Mesa+swr are heavily relied
on for rendering in cpu-only compute clusters.

- Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20171016/278c9df2/attachment.html>


More information about the mesa-dev mailing list