[MPL][Config] Can no longer pre-generate headers for MPL-containers with more than 50 elements.
Hello everyone, While playing around with the current Boost release-candidate (1.58.0-RC3) I noticed that pre-generating MPL-headers for MPL-containers with more than 50 Elements seems no longer possible. Up till at least Boost 1.55.0 I was able to pre-generate these MPL-headers using the python-scripts from Boost-source ([1]) with the help of a bash-script which I already described here [2]. Internally, these python-scripts seem to use GCC to generate these MPL-headers. They also seem to partially circumvent Boost.Config by using custom user.hpp files located in subdirectories of [3] and defining BOOST_NO_CONFIG and some other macros therein. However, this does not seem to please Boost.Config so that compiler-errors ([4]) occur. Defining the macro BOOST_CONFIG_ALLOW_DEPRECATED as [4] suggests seems not to help. It just silences the warnings but does not generate proper files. (It actually erases the content of almost all header-files in subdirectories of [5].) Does anyone know how to workaround or better fix this? Or does anyone know who to talk to, to get these problems fixed? Also, I would suggest, that documentation for these python-scripts are added to the documentation of Boost.MPL. Best regards, Deniz References: [1] ${BOOST_SOURCE}/libs/mpl/preprocessed/ [2] http://stackoverflow.com/a/20660264/3115457 [3] ${BOOST_SOURCE}/libs/mpl/preprocessed/include/ [4] #error "You are using a compiler which lacks features which are now a minimum requirement in order to use Boost, define BOOST_CONFIG_ALLOW_DEPRECATED if you want to continue at your own risk!!!" [5] ${BOOST_SOURCE}/boost/mpl/aux_/preprocessed/
Does anyone know how to workaround or better fix this? Or does anyone know who to talk to, to get these problems fixed? Also, I would suggest, that documentation for these python-scripts are added to the documentation of Boost.MPL.
I couldn't get your bash script to work for me with cygwin - and you're correct that these should be much better documented! However, using Boost.Config with BOOST_NO_CONFIG works just fine for me, the only thing that would trip it up would be if BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION is defined - as support for this is now removed from Boost. Looking at the scripts I suspect it's generating headers for a variety of compilers in one go? And it looks like some of those are old ones no longer supported. Try this: in the python files are a number of lists which include "no_ctps", "msvc60", "msvc70". Try removing these from the lists and run again. If that works, can you file a pull request on Github? HTH, John.
Does anyone know how to workaround or better fix this? Or does anyone know who to talk to, to get these problems fixed? Also, I would suggest, that documentation for these python-scripts are added to the documentation of Boost.MPL.
I couldn't get your bash script to work for me with cygwin - and you're correct that these should be much better documented!
I do not have cygwin and therefore cannot check that. (I am using Linux.) However, I realized that for the python-scripts it is crucial that the path to Boost's source-directory is an absolute path. I adjusted the bash-script accordingly and also extended it with some additional functionality. (For Boost up to 1.55.0 it should work.) Please give it a try ([1]). (Try to call the script with a value of '30' for the optional second argument.)
However, using Boost.Config with BOOST_NO_CONFIG works just fine for me, the only thing that would trip it up would be if BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION is defined - as support for this is now removed from Boost. Looking at the scripts I suspect it's generating headers for a variety of compilers in one go?
I would guess so, too.
And it looks like some of those are old ones no longer supported.
Try this: in the python files are a number of lists which include "no_ctps", "msvc60", "msvc70". Try removing these from the lists and run again.
You are right. The "user.hpp" files for these three compilers in the corresponding subdirectories in [2] each contain the macro-definition of BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION. When removing the entries from the lists in the python-scripts as you suggest, no warnings or errors occur during generation. However, the resulting files in subdirectories of [3] (for the corresponding compilers) are all empty. Somehow, generation still fails.
If that works, can you file a pull request on Github?
Sadly, it did not work. It just prevented a lot of errors but did not generate proper files. (Also, I must first check, how to file a pull request on Github. :-) ) Deniz References: [1] http://stackoverflow.com/a/20660264/3115457 [2] ${BOOST_SOURCE}/libs/mpl/preprocessed/include/ [3] ${BOOST_SOURCE}/boost/mpl/aux_/preprocessed/
On 10/04/2015 12:35, Deniz Bahadir wrote:
Does anyone know how to workaround or better fix this? Or does anyone know who to talk to, to get these problems fixed? Also, I would suggest, that documentation for these python-scripts are added to the documentation of Boost.MPL.
I couldn't get your bash script to work for me with cygwin - and you're correct that these should be much better documented!
I do not have cygwin and therefore cannot check that. (I am using Linux.) However, I realized that for the python-scripts it is crucial that the path to Boost's source-directory is an absolute path.
I adjusted the bash-script accordingly and also extended it with some additional functionality. (For Boost up to 1.55.0 it should work.) Please give it a try ([1]). (Try to call the script with a value of '30' for the optional second argument.)
OK, I've got it working on Xubuntu (still no joy in cygwin). I can confirm that it works in 1.55 but is broken in 1.56. Also that the breakage is somewhere in the MPL headers. I've tried reverting one change at a time (see https://github.com/boostorg/mpl/compare/boost-1.55.0...boost-1.56.0), but for some reason still couldn't narrow it down. Anyone any ideas? John.
Am 10.04.2015 um 20:03 schrieb John Maddock:
OK, I've got it working on Xubuntu (still no joy in cygwin).
I can confirm that it works in 1.55 but is broken in 1.56. Also that the breakage is somewhere in the MPL headers.
I've tried reverting one change at a time (see https://github.com/boostorg/mpl/compare/boost-1.55.0...boost-1.56.0), but for some reason still couldn't narrow it down. Anyone any ideas?
I was able to hunt the error down. (More further down.) *Short Excursus* For convenience I converted my bash-script ([1]) into a python-script ([2]) and extended it with some more functionality. I suppose, it should work on all platforms (even Windows ;-)) that have a working python environment enabled. (I would recommend, that this script will be incorporated into Boost.MPL.) This new python-script helped me a lot in understanding what is going on and why the pre-processing started failing from Boost 1.56 on. *Problem* The problem seems to be that some helper python-script ([3]) relies on the format of input headers, which seems to have changed during the migration from SVN to Git. SVN seemed to put some information about author, change-date and file-name ([4]) in the header-comments of each Boost source/header file. Nowadays, these header-comments are empty and [3] is therefore unable to determine which part to process/copy. (The interesting regex can be found in line 148 of [3].) *Possible Solution* A simple solution would be to manually add at least the filename in the header-comments of files [5] and [6]. However, a better and cleaner approach would be, if Git would automatically add this information (or [3] could be changed in such a way that it determines the beginning of the correct file by some other means.) *Conclusion* For the first, simple solution I could make the changes myself and make a pull-request. (Thereby, I would also provide my new python helper-script ([2])). However, for the better, cleaner approach someone else should do these changes. Any suggestions? Deniz References: [1] http://stackoverflow.com/a/20660264/3115457 [2] http://stackoverflow.com/a/29627158/3115457 [3] ${BOOST_SOURCE}/libs/mpl/preprocessed/pp.py [4] "// $Id: list50.cpp 49268 2008-10-11 06:26:17Z agurtovoy $" [5] ${BOOST_SOURCE}/boost/mpl/${CONTAINER}/${CONTAINER}${NUM}.hpp [6] ${BOOST_SOURCE}/boost/mpl/${CONTAINER}/${CONTAINER}${NUM}_c.hpp
I added a bug-ticket in Trac [1] and already provided the solution, also as pull-request [2]. I hope, someone feels responsible to review and integrate it. Best regards, Deniz References: [1] https://svn.boost.org/trac/boost/ticket/11224 [2] https://github.com/boostorg/mpl/pull/20 Am 14.04.2015 um 15:21 schrieb Deniz Bahadir:
Am 10.04.2015 um 20:03 schrieb John Maddock:
OK, I've got it working on Xubuntu (still no joy in cygwin).
I can confirm that it works in 1.55 but is broken in 1.56. Also that the breakage is somewhere in the MPL headers.
I've tried reverting one change at a time (see https://github.com/boostorg/mpl/compare/boost-1.55.0...boost-1.56.0), but for some reason still couldn't narrow it down. Anyone any ideas?
I was able to hunt the error down. (More further down.)
*Short Excursus*
For convenience I converted my bash-script ([1]) into a python-script ([2]) and extended it with some more functionality. I suppose, it should work on all platforms (even Windows ;-)) that have a working python environment enabled. (I would recommend, that this script will be incorporated into Boost.MPL.)
This new python-script helped me a lot in understanding what is going on and why the pre-processing started failing from Boost 1.56 on.
*Problem*
The problem seems to be that some helper python-script ([3]) relies on the format of input headers, which seems to have changed during the migration from SVN to Git. SVN seemed to put some information about author, change-date and file-name ([4]) in the header-comments of each Boost source/header file.
Nowadays, these header-comments are empty and [3] is therefore unable to determine which part to process/copy. (The interesting regex can be found in line 148 of [3].)
*Possible Solution*
A simple solution would be to manually add at least the filename in the header-comments of files [5] and [6].
However, a better and cleaner approach would be, if Git would automatically add this information (or [3] could be changed in such a way that it determines the beginning of the correct file by some other means.)
*Conclusion*
For the first, simple solution I could make the changes myself and make a pull-request. (Thereby, I would also provide my new python helper-script ([2])). However, for the better, cleaner approach someone else should do these changes.
Any suggestions?
Deniz
References:
[1] http://stackoverflow.com/a/20660264/3115457 [2] http://stackoverflow.com/a/29627158/3115457 [3] ${BOOST_SOURCE}/libs/mpl/preprocessed/pp.py [4] "// $Id: list50.cpp 49268 2008-10-11 06:26:17Z agurtovoy $" [5] ${BOOST_SOURCE}/boost/mpl/${CONTAINER}/${CONTAINER}${NUM}.hpp [6] ${BOOST_SOURCE}/boost/mpl/${CONTAINER}/${CONTAINER}${NUM}_c.hpp
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users -- BENOCS GmbH Dipl.-Inform. Deniz Bahadir Winterfeldtstr. 21 10781 Berlin Germany Phone: +49 - 30 / 577 0004-22 Email: deniz.bahadir@benocs.com www.benocs.com
Board of Management: Michael Wolz, Dr.-Ing. Oliver Holschke, Dr.-Ing. Ingmar Poese Commercial Register: Amtsgericht Bonn HRB 19378
participants (3)
-
Deniz Bahadir
-
Deniz Bahadir
-
John Maddock