[cmake-developers] Can we please require TR1 to build CMake?

Daniel Pfeifer daniel at pfeifer-mail.de
Tue Apr 25 16:33:30 EDT 2017


On Mon, Jan 9, 2017 at 8:30 PM, Brad King <brad.king at kitware.com> wrote:

> On 01/09/2017 05:46 AM, Daniel Pfeifer wrote:
> > start using TR1/C++11 library features, namely std::function, std::bind,
> > std::placeholders, std::shared_ptr, std::make_shared.
>
> I'd love to be able to start using those too, but last time I checked
> they are not supported everywhere CMake builds, at least in the standard
> libraries (see below).
>
> > AIX-7.1_IBM-12.1 reports that __IBMCPP_TR1__ must be defined to use TR1.
>
> Hopefully, but that would take some investigation.
>
> > Xcode 2.1 and 3.2 fail. These builds are not marked as "expected".
>
> I'd be okay with dropping these.
>
> > This leaves HP-UX.11iv2.ia64-aCC and Solaris-10-8.11_Oracle-12.3.
>
> IIUC the Oracle compiler supports C++11 when told to use the proper
> stdlib.  However, I don't think there is a solution on HP-UX with its
> standard library.
>
> > * Explicitly require SP1 for Visual Studio 2008.
>
> Okay.  For hosting CMake's own build we could even consider requiring
> VS 2010.  One blocker for that on Kitware's side is updating our
> dashboard machines as needed to be able to host CMake builds even if
> testing generators for older versions.  I'm not sure when I'll have
> time to do that.
>
> > * Disallow compiling in C++98 mode if compiler is capable of C++11.
>
> Okay.
>
> > * Require TR1 by all means. This may require setting up Boost.TR1
> >   on a very small number of exotic platforms.
>
> IIRC there is a tool to extract a subset of boost.  Please see how
> small it can get.  We can even remove the config headers for the
> platforms we don't need to use it, perhaps manually.
>

I have pushed an updated branch to
https://gitlab.kitware.com/cmake/cmake/merge_requests/760/diffs

The necessary subset of boost can be generated with:

```
mkdir -p cm_boost
bcp --boost=</path/to/boost> \
  boost/bind.hpp \
  boost/function.hpp \
  boost/mem_fn.hpp \
  boost/ref.hpp \
  boost/unordered_map.hpp \
  boost/unordered_set.hpp \
  boost/shared_ptr.hpp \
  boost/weak_ptr.hpp \
  boost/enable_shared_from_this.hpp \
  cm_boost
```

The resulting directory is 6.5 MB, 2.6 MB of which are preprocessed headers
for Boost.MPL.
When we remove them, we get the size down to 3.9 MB.
Removing individual config headers is tedious and does not save much.

Cheers, Daniel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20170425/4f7080d3/attachment.html>


More information about the cmake-developers mailing list