boost 1.47: gcc file dependency generation trips over BOOST_PARAMETER_MAX_ARITY
Hi, To take care of dependencies in my project using boost, I used to invoke gcc with the option -MM. However, since using boost 1.47, this does not work anymore. The precompiler aborts with the message: /usr/local/include/boost-1_47/boost/signals2/signal_type.hpp:29:2: error: #error This header requires BOOST_PARAMETER_MAX_ARITY to be defined as 7 or greater prior to including Boost.Parameter headers Because the macro BOOST_PARAMETER_MAX_ARITY plays no role whatsover in this invocation of gcc, I think that boost should solve their internal problem with the "arity" in some other way. In the mean time I define the macro in my make rules to generate the dependencies, but there it is obviously misplaced (any tips or tricks are welcome here). All the best, Ytsen.
No reactions or comments? -- View this message in context: http://boost.2283326.n4.nabble.com/boost-1-47-gcc-file-dependency-generation... Sent from the Boost - Users mailing list archive at Nabble.com.
on Mon Sep 05 2011, Ytsen de Boer
Hi,
To take care of dependencies in my project using boost, I used to invoke gcc with the option -MM.
What does -MM do?
However, since using boost 1.47, this does not work anymore. The precompiler aborts with the message:
/usr/local/include/boost-1_47/boost/signals2/signal_type.hpp:29:2: error: #error This header requires BOOST_PARAMETER_MAX_ARITY to be defined as 7 or greater prior to including Boost.Parameter headers
Because the macro BOOST_PARAMETER_MAX_ARITY plays no role whatsover in this invocation of gcc, I think that boost should solve their internal problem with the "arity" in some other way.
I don't know what you mean. It defaults to 5, but signals2 apparently needs support for 7 arguments.
In the mean time I define the macro in my make rules to generate the dependencies, but there it is obviously misplaced (any tips or tricks are welcome here).
I don't understand your problem, sorry. -- Dave Abrahams BoostPro Computing http://www.boostpro.com
Thank you for your response, please allow me to explain the problem
a bit clearer:
The -MM option in gcc does the following (from the man page on my
Linux system): "instead of outputting the result of preprocessing,
output a rule suitable for make describing the dependencies of the
main source file. The preprocessor outputs one make rule containing
the object file name for that source file, a colon, and the names of
all the included files, including those coming from -include or
-imacros command line options."
In projects using the gcc compiler, this is a preferred way to take
care of the dependencies. However, this does not work anymore with the
new boost version, because, unless the macro BOOST_PARAMETER_MAX_ARITY
is defined to no less than 7, the preprocessor aborts, whilst
figuring out the dependencies, due to the following lines in
signals2/signal_type.hpp:
#if !defined(BOOST_PARAMETER_MAX_ARITY)
#define BOOST_PARAMETER_MAX_ARITY 7
#else
#if BOOST_PARAMETER_MAX_ARITY < 7
#error This header requires BOOST_PARAMETER_MAX_ARITY to be defined as
7 or greater prior to including Boost.Parameter headers
#endif // BOOST_PARAMETER_MAX_ARITY < 7
#endif // !defined(BOOST_PARAMETER_MAX_ARITY)
This means that the gcc native way of figuring out dependencies, is
broken. I believe this cannot be intended.
Please let me know if the problem is still not understood, or if you
have a different view on this matter.
Kind regards,
Ytsen.
2011/9/13 Dave Abrahams
on Mon Sep 05 2011, Ytsen de Boer
wrote: Hi,
To take care of dependencies in my project using boost, I used to invoke gcc with the option -MM.
What does -MM do?
However, since using boost 1.47, this does not work anymore. The precompiler aborts with the message:
/usr/local/include/boost-1_47/boost/signals2/signal_type.hpp:29:2: error: #error This header requires BOOST_PARAMETER_MAX_ARITY to be defined as 7 or greater prior to including Boost.Parameter headers
Because the macro BOOST_PARAMETER_MAX_ARITY plays no role whatsover in this invocation of gcc, I think that boost should solve their internal problem with the "arity" in some other way.
I don't know what you mean. It defaults to 5, but signals2 apparently needs support for 7 arguments.
In the mean time I define the macro in my make rules to generate the dependencies, but there it is obviously misplaced (any tips or tricks are welcome here).
I don't understand your problem, sorry.
-- Dave Abrahams BoostPro Computing http://www.boostpro.com
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
----- "Ytsen de Boer"
Thank you for your response, please allow me to explain the problem a bit clearer:
(removed -MM explanation) I believe this has nothing to do with -MM. Does your code compile without dependency generation ? Obviously Boost.Signals2 needs this macro to be at least 7. You probably include another boost library before Signals2 that default it to less than 7. See: http://boost.2283326.n4.nabble.com/Accumulators-Signals2-Compilation-error-w... I think you should define this macro (to 7 or more) in your compiler command. Regards, Ivan
Thank you for your answer.
I believe we are not on the same page.
Obviously, when I define the max arity to a value of 7 or more, the
preprocessor will finish properly.
But the point I am trying to make is more subtle, namely, that the
generation of the project dependencies has not a thing to do with the
boost max arity. Therefore, the definition of that macro would be
terribly misplaced in the make rule for the dependencies, which has
only to do with the dependent files and nothing with the numeric
values of macros. At least, that is how it should be in my opinion.
I don't know what the boost max arity means or what its for, but it
seems to me that it is a run time variable. As such, it should be
handled by the code and not by preprocessor directives, surely not
with this side-effect. I hope this can be acknowledged.
Kind regards,
Ytsen.
2011/9/15 Ivan Le Lann
----- "Ytsen de Boer"
a écrit : Thank you for your response, please allow me to explain the problem a bit clearer:
(removed -MM explanation)
I believe this has nothing to do with -MM. Does your code compile without dependency generation ?
Obviously Boost.Signals2 needs this macro to be at least 7. You probably include another boost library before Signals2 that default it to less than 7.
See: http://boost.2283326.n4.nabble.com/Accumulators-Signals2-Compilation-error-w... I think you should define this macro (to 7 or more) in your compiler command.
Regards, Ivan _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (4)
-
Dave Abrahams
-
Ivan Le Lann
-
Y
-
Ytsen de Boer