MantisBT - CMake
View Issue Details
0014758CMakeCMakepublic2014-02-17 07:522016-06-10 14:31
Marcel Loose 
Kitware Robot 
normalmajoralways
closedmoved 
LinuxUbuntu13.10
CMake 2.8.11.2 
 
0014758: Delayed de-duplication of include directories may cause huge memory usage
Since CMake 2.8.8 de-duplication of include directories is postponed to the generation phase. This can cause serious problems if the number of duplicate entries grows large.

If I understand things correctly, this redesign was made in order to support generator expressions. Would it be possible to do immediate de-duplication of entries that don't contain a generator expression?
I haven't been able to create an easy to reproduce setup (yet). Any version of CMake >= 2.8.8 will exhibit this behaviour.
See the email thread http://cmake.3232098.n2.nabble.com/include-directories-versus-set-directory-properties-PROPERTIES-INCLUDE-DIRECTORIES-td7586636.html [^]

This issue is related to 0014094.
No tags attached.
related to 0014094closed Robert Maynard FindCUDA: Marco CUDA_WRAP_SRCS does not de-duplicate entries in CUDA_NVCC_INCLUDE_DIRECTORIES 
Issue History
2014-02-17 07:52Marcel LooseNew Issue
2014-02-19 11:14David ColeRelationship addedrelated to 0014094
2014-02-19 11:54David ColeNote Added: 0035153
2014-02-19 12:06David ColeNote Edited: 0035153bug_revision_view_page.php?bugnote_id=35153#r1392
2016-06-10 14:29Kitware RobotNote Added: 0042488
2016-06-10 14:29Kitware RobotStatusnew => resolved
2016-06-10 14:29Kitware RobotResolutionopen => moved
2016-06-10 14:29Kitware RobotAssigned To => Kitware Robot
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0035153)
David Cole   
2014-02-19 11:54   
(edited on: 2014-02-19 12:06)
Here is the git commit id that eliminated the "on input" INCLUDE_DIRECTORIES
de-duplication: 8adaee2b

It was a long and bloody battle as I recall, which we thought we won in the
end, with pure valor and dogged determination... But alas, now we use 14G of
RAM sometimes, and hang our heads in shame, as we thrash about, accumulating
the same string over and over and over again.

It all started here: edd53039 (Dec. 4, 2011) and was finally "done enough" to
be merged here: 8233636d (Feb. 22, 2012) (merged to a ninja-related
topic in bada88e8 (also Feb. 22, 2012), and then merged to master in
572994bd (Mar. 19, 2012))

Here are the commits of the topic that introduced the postponed
de-duplication:

gitk edd53039^..8233636d& # run this to view in a cmake git clone

https://github.com/Kitware/CMake/compare/edd53039%5E...8233636d [^]

  ( %5E is the URL encoding of "^" )

The 4th of 11 commits, 8adaee2b, "CMake: Eliminate
cmMakefile::IncludeDirectories" is the main culprit.

https://github.com/Kitware/CMake/commit/8adaee2b [^]

Specifically, this chunk:

https://github.com/Kitware/CMake/commit/8adaee2b#diff-bd9d4738a0e1e083076cdd95648333b4L1614 [^]

These are the commits of the ninja topic branch that the above branch was
merged into, before merging to master:

gitk edd53039...bada88e8 9987d952...572994bd&

https://github.com/Kitware/CMake/compare/9987d952...572994bd [^]

I have not had time (sorry) to dig into the code to try to *solve* the
problem yet, ... but I thought I would share these links and this info here
in case somebody else out there does have time to look into it further.

It's since been complicated by the fact that you can put generator
expressions into the property value now. It's not clear to me that
eliminating a duplicate with a generator expression in it is valid: may
they evaluate differently in different contexts?

Hope this helps at least put us a step closer to finding a solution.

(0042488)
Kitware Robot   
2016-06-10 14:29   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.