CMake, modular Boost, and other stories
It's been quiet lately, so it must be time for another CMake discussion. As you know, Boost 1.70 installs CMake configuration files on `b2 install`, and we've started to receive feedback, some of which more interesting than what doesn't work. At present, `b2 install --with-filesystem` for example installs a configuration file boost_filesystem-config.cmake, which enables CMake users to issue the command `find_package(boost_filesystem)` and then use Boost.Filesystem. This mimics what an ordinary, independent library that happened to be called "boost_filesystem" would do. It also installs an umbrella BoostConfig.cmake file, which enables the alternative use of `find_package(Boost COMPONENTS filesystem)`, which treats Filesystem as a component of the package Boost, rather than as a standalone library. This is compatible with the existing, pre-1.70 use of FindBoost.cmake to locate Boost from CMake. Brad King (from Kitware, who should know) argues that installing separate configuration files for all the libraries is wrong. He says that the preferred practice is to only support the second use, with Boost as the package, and the libraries as components, not accessible as packages on their own. (The discussion is here: https://gitlab.kitware.com/cmake/cmake/issues/19186) The reason I went with installing separate configuration files was that I expected that (a) this would be our preferred future approach when, or if, we switch to building with CMake and (b) even if not, this seemed like a step in the right, "modular", direction where libraries are treated as independent rather than parts of the monolithic package Boost. I'm having second thoughts though. It looks to me that Brad is right, and that the various library configuration files should be implementation details of a single Boost package (in the CMake sense) and not be user-visible. That is, only support find_package(Boost COMPONENTS filesystem) and drop find_package(boost_filesystem) Thoughts?
On 2019-04-23 12:40 p.m., Peter Dimov via Boost wrote:
It's been quiet lately, so it must be time for another CMake discussion.
As you know, Boost 1.70 installs CMake configuration files on `b2 install`, and we've started to receive feedback, some of which more interesting than what doesn't work.
At present, `b2 install --with-filesystem` for example installs a configuration file boost_filesystem-config.cmake, which enables CMake users to issue the command `find_package(boost_filesystem)` and then use Boost.Filesystem. This mimics what an ordinary, independent library that happened to be called "boost_filesystem" would do.
It also installs an umbrella BoostConfig.cmake file, which enables the alternative use of `find_package(Boost COMPONENTS filesystem)`, which treats Filesystem as a component of the package Boost, rather than as a standalone library. This is compatible with the existing, pre-1.70 use of FindBoost.cmake to locate Boost from CMake.
Brad King (from Kitware, who should know) argues that installing separate configuration files for all the libraries is wrong. He says that the preferred practice is to only support the second use, with Boost as the package, and the libraries as components, not accessible as packages on their own. (The discussion is here: https://gitlab.kitware.com/cmake/cmake/issues/19186)
The reason I went with installing separate configuration files was that I expected that (a) this would be our preferred future approach when, or if, we switch to building with CMake and (b) even if not, this seemed like a step in the right, "modular", direction where libraries are treated as independent rather than parts of the monolithic package Boost.
I'm having second thoughts though. It looks to me that Brad is right, and that the various library configuration files should be implementation details of a single Boost package (in the CMake sense) and not be user-visible. That is, only support
find_package(Boost COMPONENTS filesystem)
and drop
find_package(boost_filesystem)
Thoughts?
I don't quite understand how you frame the discussion. The fundamental question is not about how to make proper use of CMake idioms, but whether we consider Boost to be one project (with one package, etc.), or an umbrella organization that hosts multiple projects. And until we have figured that out we shouldn't even consider technical details such as how to spell `find_package()` invocations to find Boost libraries. And just to spell it out loud and clear: I'm very much in favour of the latter, i.e. Boost as an umbrella org. Stefan -- ...ich hab' noch einen Koffer in Berlin...
On Tue, Apr 23, 2019 at 12:41 PM Peter Dimov wrote:
Brad King (from Kitware, who should know) argues that installing separate configuration files for all the libraries is wrong. He says that the preferred practice is to only support the second use, with Boost as the package, and the libraries as components, not accessible as packages on their own. (The discussion is here: https://gitlab.kitware.com/cmake/cmake/issues/19186) [...] I'm having second thoughts though. It looks to me that Brad is right, and that the various library configuration files should be implementation details of a single Boost package (in the CMake sense) and not be user-visible. That is, only support
find_package(Boost COMPONENTS filesystem)
and drop
find_package(boost_filesystem)
I'm in favor of this.
the various library configuration files should be implementation details of a single Boost package
Do they need to live in the library, or is more idiomatic for these too to reside within (and be maintained as part of) a separate sub-module repository that also houses the one CMakeLists.txt? Glen
Glen Fernandes wrote:
the various library configuration files should be implementation details of a single Boost package
Do they need to live in the library, or is more idiomatic for these too to reside within (and be maintained as part of) a separate sub-module repository that also houses the one CMakeLists.txt?
These files are generated by `b2 install`, they don't reside in a repo. The difference is that at the moment they are generated in separate CMake-accessible directories so that `find_package` can find them, whereas if we drop that, they'll only need to be accessible to BoostConfig.cmake, probably in subdirectories below it.
On Tue, 23 Apr 2019 at 18:41, Peter Dimov via Boost
It's been quiet lately, so it must be time for another CMake discussion.
As you know, Boost 1.70 installs CMake configuration files on `b2 install`, and we've started to receive feedback, some of which more interesting than what doesn't work.
At present, `b2 install --with-filesystem` for example installs a configuration file boost_filesystem-config.cmake, which enables CMake users to issue the command `find_package(boost_filesystem)` and then use Boost.Filesystem. This mimics what an ordinary, independent library that happened to be called "boost_filesystem" would do.
It also installs an umbrella BoostConfig.cmake file, which enables the alternative use of `find_package(Boost COMPONENTS filesystem)`, which treats Filesystem as a component of the package Boost, rather than as a standalone library. This is compatible with the existing, pre-1.70 use of FindBoost.cmake to locate Boost from CMake.
Brad King (from Kitware, who should know) argues that installing separate configuration files for all the libraries is wrong. He says that the preferred practice is to only support the second use, with Boost as the package, and the libraries as components, not accessible as packages on their own. (The discussion is here: https://gitlab.kitware.com/cmake/cmake/issues/19186)
The reason I went with installing separate configuration files was that I expected that (a) this would be our preferred future approach when, or if, we switch to building with CMake and (b) even if not, this seemed like a step in the right, "modular", direction where libraries are treated as independent rather than parts of the monolithic package Boost.
I'm having second thoughts though. It looks to me that Brad is right, and that the various library configuration files should be implementation details of a single Boost package (in the CMake sense) and not be user-visible. That is, only support
find_package(Boost COMPONENTS filesystem)
^^ this is compatible with every existing c++ program that includes boost via cmake
and drop
find_package(boost_filesystem)
^^ speaking as someone who has been a very active consumer of boost and CMake for the past 6 years, in cross-platform environments, this will be a package dependency management nightmare. Please do drop it. In CMake, boost libraries are COMPONENTS of Boost. It's clean, teachable and maintainable.
Thoughts?
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
-- Richard Hodges hodges.r@gmail.com office: +442032898513 home: +376841522 mobile: +376380212
On Tue, Apr 23, 2019 at 11:41 AM Peter Dimov via Boost < boost@lists.boost.org> wrote:
It's been quiet lately, so it must be time for another CMake discussion.
It's not just a CMake discussion you are attempting. You are just using CMake as the hand-grenade ;-)
I'm having second thoughts though. It looks to me that Brad is right, and that the various library configuration files should be implementation details of a single Boost package (in the CMake sense) and not be user-visible. That is, only support
find_package(Boost COMPONENTS filesystem)
and drop
find_package(boost_filesystem)
Thoughts?
I disagree. In my ideal world the "Boost" package wouldn't exist at all and you would only install/use/find the individual Boost libraries. Anything else is either living in the past or a convenient transitional method. -- -- Rene Rivera -- Grafik - Don't Assume Anything -- Robot Dreams - http://robot-dreams.net
On Tue, Apr 23, 2019 at 3:38 PM Rene Rivera via Boost
I disagree. In my ideal world the "Boost" package wouldn't exist at all and you would only install/use/find the individual Boost libraries. Anything else is either living in the past or a convenient transitional method.
One look at https://pdimov.github.io/boostdep-report/develop/module-overview.html is convincing enough to me that there are far too many dependencies to consider boost anything except a single packaged, versioned entity with many components. Until C++ has package management that's as easy to use and the dependencies are better managed with a tool and distribution system as powerful as, say, python's pip - I don't see that changing. Given cmake already provides a find_package(Boost COMPONENTS ...), do we need anything other than ensuring the dependencies in the FindBoost.cmake are correct? We could provide the list of dependencies (perhaps we do?) to cmake so they are correct, or perhaps cmake could make it so those dependencies could be loaded from a data file that the boost build provides? - Jim
On Tue, Apr 23, 2019 at 3:00 PM James E. King III
On Tue, Apr 23, 2019 at 3:38 PM Rene Rivera via Boost
wrote: I disagree. In my ideal world the "Boost" package wouldn't exist at all
and
you would only install/use/find the individual Boost libraries. Anything else is either living in the past or a convenient transitional method.
One look at https://pdimov.github.io/boostdep-report/develop/module-overview.html is convincing enough to me that there are far too many dependencies to consider boost anything except a single packaged, versioned entity with many components.
You are being confused by the chaff. The important aspect to consider are the cycles in the dependencies. When we hit zero cycles it means that making Boost truly modular becomes a trivial problem. And we are making good strides in lowering that number. As you can see here < https://grafikrobot.github.io/boost_lib_stats/#_dependency_cycles>. Only down to two! We can do it! We can do it! Yes, we, can! Until C++ has package management that's as easy
to use and the dependencies are better managed with a tool and distribution system as powerful as, say, python's pip - I don't see that changing.
That is a chicken and egg argument. And we already have many chickens and eggs. Enough to suit many different styles of dependency and package management. -- -- Rene Rivera -- Grafik - Don't Assume Anything -- Robot Dreams - http://robot-dreams.net
On 2019-04-23 4:00 p.m., James E. King III via Boost wrote:
On Tue, Apr 23, 2019 at 3:38 PM Rene Rivera via Boost
wrote: I disagree. In my ideal world the "Boost" package wouldn't exist at all and you would only install/use/find the individual Boost libraries. Anything else is either living in the past or a convenient transitional method.
One look at https://pdimov.github.io/boostdep-report/develop/module-overview.html is convincing enough to me that there are far too many dependencies to consider boost anything except a single packaged, versioned entity with many components.
That's a strange statement to make, as it suggests a false dichotomy. We haven't even talked about the granularity of the "modules" yet ! I understand there are many strongly interconnected libraries in Boost. However, there are also quite a few that no other Boost library depends on, and which therefore could easily be considered stand-alone. Stefan -- ...ich hab' noch einen Koffer in Berlin...
On Tue, Apr 23, 2019, 12:41 PM Peter Dimov via Boost
That is, only support
find_package(Boost COMPONENTS filesystem)
and drop
find_package(boost_filesystem)
Thoughts?
+1. Aside from the other benefits mentioned: - for better or worse this is the already established Boost CMake user API. If we make a second, competing API both will need to be effectively supported forever. Doesn't seem worth it. - while some have proposed that Boost become simply an award we attach to libraries that are good enough, that certainly isn't what we have now or will have in the foreseeable future. Boost is a thing you can download, install, and use. Components are a great fit for Boost.
On 2019-04-26 5:58 p.m., David Sankel via Boost wrote:
On Tue, Apr 23, 2019, 12:41 PM Peter Dimov via Boost
wrote: That is, only support
find_package(Boost COMPONENTS filesystem)
and drop
find_package(boost_filesystem)
Thoughts?
+1. Aside from the other benefits mentioned:
- for better or worse this is the already established Boost CMake user API. If we make a second, competing API both will need to be effectively supported forever. Doesn't seem worth it.
- while some have proposed that Boost become simply an award we attach to libraries that are good enough, that certainly isn't what we have now or will have in the foreseeable future. Boost is a thing you can download, install, and use. Components are a great fit for Boost.
With that kind of attitude we are never going to make any progress. :-( Stefan -- ...ich hab' noch einen Koffer in Berlin...
On Fri, Apr 26, 2019, 6:09 PM Stefan Seefeld
On 2019-04-26 5:58 p.m., David Sankel via Boost wrote:
On Tue, Apr 23, 2019, 12:41 PM Peter Dimov via Boost
wrote: That is, only support
find_package(Boost COMPONENTS filesystem)
and drop
find_package(boost_filesystem)
Thoughts?
+1. Aside from the other benefits mentioned:
- for better or worse this is the already established Boost CMake user API. If we make a second, competing API both will need to be effectively supported forever. Doesn't seem worth it.
- while some have proposed that Boost become simply an award we attach to libraries that are good enough, that certainly isn't what we have now or will have in the foreseeable future. Boost is a thing you can download, install, and use. Components are a great fit for Boost.
With that kind of attitude we are never going to make any progress. :-(
What am I missing Stefan?
participants (7)
-
David Sankel
-
Glen Fernandes
-
James E. King III
-
Peter Dimov
-
Rene Rivera
-
Richard Hodges
-
Stefan Seefeld