[vtk-developers] Plan to make CMake 3.3 and C++11 required

David Gobbi david.gobbi at gmail.com
Tue Jan 17 11:52:02 EST 2017


There's definitely a place for std::unique_ptr in VTK, however.  There's
lots of code that does local allocation with new/delete that could be
cleaned up.

Event binding is one place where we should detect the use of shared_ptr,
i.e. the templated vtkObject::AddObserver method.

I believe that the main thing holding us back from more widespread use of
smart pointers is our rule for using forward declarations in VTK headers,
rather than including other headers.   And it's a rule that I don't want to
see changed.

 - David


On Tue, Jan 17, 2017 at 9:04 AM, Robert Maynard <robert.maynard at kitware.com>
wrote:

> Hi,
>
> I believe that the VTK object reference counting model is not well
> suited to a transition to c++11 shared pointer design. It would
> require a redesign of how everyone constructs VTK classes ( New,
> ShallowCopy, etc ) with no clear gain. VTK already uses an atomic ref
> count, and we don't need the shared_ptr overhead of holding the
> destructor.
>
> I do see value in VTK providing pre-made destructors for
> std::shared_ptr, etc so that you can safely mix the two different
> types of reference counting.
>
> On Mon, Jan 16, 2017 at 4:47 PM, Alexis Girault
> <alexis.girault at kitware.com> wrote:
> > Awesome! Will there be any interest to transition to the c++11 smart
> > pointers (shared, weak, unique)?
> >
> > Alexis
> >
> > On Mon, Jan 9, 2017 at 5:18 PM, Robert Maynard <
> robert.maynard at kitware.com>
> > wrote:
> >>
> >> We have merged in the branch to require CMake 3.3 today. So I will be
> >> keeping an eye on the dashboard machines and updating machines over
> >> the next couple of days.
> >>
> >> I also expect to have a MR open end of this week that will explicitly
> >> enable C++11 with a goal to have that merged in on Monday Jan 16.
> >>
> >> On Wed, Jan 4, 2017 at 2:06 PM, Robert Maynard
> >> <robert.maynard at kitware.com> wrote:
> >> > As we start a new year, it is time to announce that we are planning on
> >> > rolling out a series of updates to VTK that are starting with the
> update
> >> > of the minimum required CMake version.
> >> >
> >> > We have chosen CMake 3.3 as the minimum required version for numerous
> >> > reasons,
> >> > the most important of those reasons being:
> >> >
> >> > - It is the first CMake release that offers C++11 support for all four
> >> > major
> >> >   compilers ( GCC / MSVC / Clang / XCode ). [1]
> >> >
> >> > - The CMake version is sufficiently new enough that it allows for a
> >> > cleaning
> >> >   of the existing CMake infrastructure. The current CMake minimum
> >> > version
> >> >   requires VTK to maintain forks of numerous FindPackages and Modules
> >> > that are
> >> >   part of newer CMake versions.
> >> >
> >> > - Supports HTTPS downloads, with all the official binaries come with
> >> > support.
> >> >   Allowing for migration of external data to a HTTPS only server.
> >> > Something we
> >> >   are going to require in the near future. [2]
> >> >
> >> > As mentioned above this year we have a series of upgrades planned to
> VTK
> >> > which
> >> > require moving the minimum CMake version to 3.3. The most significant
> >> > of these changes to all developers is the requirement of a C++11
> capable
> >> > compiler.
> >> >
> >> > Yes you heard that correct, VTK is going to soon require a C++11
> capable
> >> > compiler. To be more exact we are going to require a compiler that
> >> > understands
> >> > the significant majority of the C++11 language and runtime additions.
> >> > The exact
> >> > versions for each compiler have not been set in stone, but a rough
> >> > estimation
> >> > would be:
> >> >   - GCC 4.8+
> >> >   - Clang 3.3+
> >> >   - XCode 5.0+
> >> >   - MSVC 2013+
> >> > As we progress through the year, I expect a more concrete list of
> >> > supported
> >> > compilers will be determined and documented.
> >> >
> >> > Now the roll out for C++11 support is going to happen in multiple
> stages
> >> > with an initial plan being:
> >> >
> >> > Stage 1: We require CMake 3.3, upgrade all dashboards, work through
> >> > developer
> >> >          reported issues with the version bump
> >> >
> >> > Stage 2: Explicitly enable C++11 compiler flags during CMake
> >> > configuration. Again
> >> >          we will have to upgrade/retire dashboards, work through
> >> > developer
> >> >          reported issues.
> >> >
> >> > Stage 3: Update the VTK Coding Standards for C++11.
> >> >
> >> > Stage 4: Allow C++11 to be used in VTK ( outside currently permitted
> >> > usage ).
> >> >
> >> > Notes:
> >> >
> >> > 1 - If you are using a different compiler vendor than one of those
> >> > listed above
> >> >     please see if it is currently supported
> >> >     (
> >> > https://cmake.org/cmake/help/v3.7/manual/cmake-compile-
> features.7.html ).
> >> >     If the vendor is not explicitly listed please contact me, so we
> can
> >> > discuss
> >> >     what options are available.
> >> >
> >> > 2 - https://data.kitware.com is transitioning to be the location for
> all
> >> >     external data, and requires a SSL connection.
> >> _______________________________________________
> >> Powered by www.kitware.com
> >>
> >> Visit other Kitware open-source projects at
> >> http://www.kitware.com/opensource/opensource.html
> >>
> >> Search the list archives at: http://markmail.org/search/?q=
> vtk-developers
> >>
> >> Follow this link to subscribe/unsubscribe:
> >> http://public.kitware.com/mailman/listinfo/vtk-developers
> >>
> >
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/
> opensource/opensource.html
>
> Search the list archives at: http://markmail.org/search/?q=vtk-developers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtk-developers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20170117/12ccb526/attachment-0001.html>


More information about the vtk-developers mailing list