Troubling building Boost for Borland C++ Builder 6

When building Boost for C++ Builder 6 and Boost 1.32, the serialization libray fails to build. The reason for this is that it attempts to use the latest Spirit header files and this does not support C++ Builder 6. What makes this doubly annoying is that the only reason that serialization needs to use Spirit is to support XML serialization. So even if I will never be using serialization for XML serialization, but will use it for the more mainstream binary serialization, I can not use this library with C++ Builder 6. Clearly this is a case for a built library to be split up into sub-libraries, so that there would be a built serialization library supporting binary serialization, which would not be dependent on Spirit, and a built serialization library supporting XML serialization, which would be dependent on Spirit. In this case I would be able to build the library that did not depend on Spirit for C++ Builder and I would not care, if I never used XML serialization, whether or not the library that was built to support XML serialization could be built for C++ Builder 6. In the serialization documentation it says that one can build serialization so that it can be used with C++ Builder 6 by downloading the standalone version of Spirit 1.6, installing that, and setting the SPIRIT_ROOT environment variable to the directory where Spirit 1.6 is installed. Despite having done this, any attempt to build serialization for C++ Builder 6 ends with error messages showing that header files for Spirit in the main Boost directory, rather in the Spirit 1.6 directory, are being used in the process to build the serialization library. The error message comes from spirit/core/config.hpp in my Boost 1.32 directory tree that C++ Builder 6 is not supported. In the Spirit 1.6 distribution there is no spirit/core/config.h. While I understand that a particular library may not want to support a particular compiler/version because that compiler is deficient in the C++ standard requirments to support that library, I feel that if a library is marked as supporting a compiler/version it should do so. In the case of serialization in Boost 1.32 it is marked as supporting C++ Builder 6 when clearly it does not according to my efforts.

Edward Diener
When building Boost for C++ Builder 6 and Boost 1.32, the serialization libray fails to build. The reason for this is that it attempts to use the latest Spirit header files and this does not support C++ Builder 6.
It's always a good idea to cite the library whose author's attention you need in the subject line. www.boost-consulting.com/boost/more/discussion_policy.htm#effective -- Dave Abrahams Boost Consulting www.boost-consulting.com

David Abrahams wrote:
Edward Diener
writes: When building Boost for C++ Builder 6 and Boost 1.32, the serialization libray fails to build. The reason for this is that it attempts to use the latest Spirit header files and this does not support C++ Builder 6.
It's always a good idea to cite the library whose author's attention you need in the subject line.
I did previously, twice, and I received no response from anyone. One I posted on this NG and another I posted on the Boost developer NG.

Edward Diener
David Abrahams wrote:
Edward Diener
writes: When building Boost for C++ Builder 6 and Boost 1.32, the serialization libray fails to build. The reason for this is that it attempts to use the latest Spirit header files and this does not support C++ Builder 6.
It's always a good idea to cite the library whose author's attention you need in the subject line.
I did previously, twice, and I received no response from anyone. One I posted on this NG and another I posted on the Boost developer NG.
Just trying to help; take it or leave it. -- Dave Abrahams Boost Consulting www.boost-consulting.com

Edward Diener wrote:
Clearly this is a case for a built library to be split up into sub-libraries, so that there would be a built serialization library supporting binary serialization, which would not be dependent on Spirit, and a built serialization library supporting XML serialization, which would be dependent on Spirit. In this case I would be able to build the library that did not depend on Spirit for C++ Builder and I would not care, if I never used XML serialization, whether or not the library that was built to support XML serialization could be built for C++ Builder 6.
I can sympathize here. But the serialization library is already split into two libraries. Combining this with auto-linking turns out to complicate things. Making into four libraries would be even worse.
In the serialization documentation it says that one can build serialization so that it can be used with C++ Builder 6 by downloading the standalone version of Spirit 1.6, installing that, and setting the SPIRIT_ROOT environment variable to the directory where Spirit 1.6 is installed. Despite having done this, any attempt to build serialization for C++ Builder 6 ends with error messages showing that header files for Spirit in the main Boost directory, rather in the Spirit 1.6 directory, are being used in the process to build the serialization library. The error message comes from spirit/core/config.hpp in my Boost 1.32 directory tree that C++ Builder 6 is not supported. In the Spirit 1.6 distribution there is no spirit/core/config.h.
While I understand that a particular library may not want to support a particular compiler/version because that compiler is deficient in the C++ standard requirments to support that library, I feel that if a library is marked as supporting a compiler/version it should do so. In the case of serialization in Boost 1.32 it is marked as supporting C++ Builder 6 when clearly it does not according to my efforts.
All I can say it that this has worked from me as well as the testers in our matrix. I do have a good fix for you though. You can comment out the xml_*.cpp files in the Jamfile that builds the library. This will exclude these modules from the library. This should permit one to build and use all the other types of archives. There is another option as well, for some applications (e.g. those that want to do global optimization) it might be more convenient to skip the library step altogether and just included the *.cpp files for the archives that are to be used. This seems less attractive to me - but it might be an option for some people. Robert Ramey

Robert Ramey wrote:
Edward Diener wrote:
Clearly this is a case for a built library to be split up into sub-libraries, so that there would be a built serialization library supporting binary serialization, which would not be dependent on Spirit, and a built serialization library supporting XML serialization, which would be dependent on Spirit. In this case I would be able to build the library that did not depend on Spirit for C++ Builder and I would not care, if I never used XML serialization, whether or not the library that was built to support XML serialization could be built for C++ Builder 6.
I can sympathize here. But the serialization library is already split into two libraries. Combining this with auto-linking turns out to complicate things. Making into four libraries would be even worse.
In the serialization documentation it says that one can build serialization so that it can be used with C++ Builder 6 by downloading the standalone version of Spirit 1.6, installing that, and setting the SPIRIT_ROOT environment variable to the directory where Spirit 1.6 is installed. Despite having done this, any attempt to build serialization for C++ Builder 6 ends with error messages showing that header files for Spirit in the main Boost directory, rather in the Spirit 1.6 directory, are being used in the process to build the serialization library. The error message comes from spirit/core/config.hpp in my Boost 1.32 directory tree that C++ Builder 6 is not supported. In the Spirit 1.6 distribution there is no spirit/core/config.h.
While I understand that a particular library may not want to support a particular compiler/version because that compiler is deficient in the C++ standard requirments to support that library, I feel that if a library is marked as supporting a compiler/version it should do so. In the case of serialization in Boost 1.32 it is marked as supporting C++ Builder 6 when clearly it does not according to my efforts.
All I can say it that this has worked from me as well as the testers in our matrix.
I have discovered the reason for the problem. It has to do with the form of
#include in the Spirit 1.6x headers. The headers erroneously use, in some
places, the form:
#include "boost/..."
rather than
#include
I do have a good fix for you though. You can comment out the xml_*.cpp files in the Jamfile that builds the library. This will exclude these modules from the library. This should permit one to build and use all the other types of archives.
OK, but I prefer to fix the Spirit headers locally.
There is another option as well, for some applications (e.g. those that want to do global optimization) it might be more convenient to skip the library step altogether and just included the *.cpp files for the archives that are to be used. This seems less attractive to me - but it might be an option for some people.
That is a solution but it is as unattractive to me as it is to you.

Edward Diener wrote:
I do not believe that Bcb6 was tested using the SPIRIT_ROOT technique or else the test would have shown the same problem which I have discovered.
I can't tell you for a fact I test bcb 5.64 and bcb 5.51 regularly - in fact I'm doing it on my own machine as we speak !!. However, we might get different results for a couple of reasons. a) I'm using spirit 1.61 for this. I doubt this is an issue but its possble it might have an impact. (now that I think about it, I didn't realize there was a later version than 1.61. Using this might fix my problem with borland 5.51 - all the libraries build but the XML tests fail. b) My command line might be different. Anyway - I'm glad you're off and running. Robert Ramey

Robert Ramey wrote:
Edward Diener wrote:
I do not believe that Bcb6 was tested using the SPIRIT_ROOT technique or else the test would have shown the same problem which I have discovered.
I can't tell you for a fact I test bcb 5.64 and bcb 5.51 regularly - in fact I'm doing it on my own machine as we speak !!.
However, we might get different results for a couple of reasons.
a) I'm using spirit 1.61 for this. I doubt this is an issue but its possble it might have an impact. (now that I think about it, I didn't realize there was a later version than 1.61. Using this might fix my problem with borland 5.51 - all the libraries build but the XML tests fail.
b) My command line might be different.
If you are not compiling anything from the Boost root directory the error will not show up. If you try to build Boost libraries, and naturally start in the Boost root directory as specified in the Build instructions, the error should most certainly show up. I doubt if it has anything to do with Spirit 1.6.1 versus Spirit 1.6.2 unless the Spirit developers changed the header file includes to the erroneous form from Spirit 1.6.1 to Spirit 1.6.2 for some arcane reason.

Edward Diener
All I can say it that this has worked from me as well as the testers in our matrix.
I have discovered the reason for the problem. It has to do with the form of #include in the Spirit 1.6x headers. The headers erroneously use, in some places, the form:
#include "boost/..."
rather than
#include
It's not "erroneously" exactly. Whether to include with quotes or angles has been a source of contention among Boost developers and there has been no agreement. I am in the latter camp, myself, but others seem to thing that the former is the only correct way. -- Dave Abrahams Boost Consulting www.boost-consulting.com

David Abrahams wrote:
Edward Diener
writes: All I can say it that this has worked from me as well as the testers in our matrix.
I have discovered the reason for the problem. It has to do with the form of #include in the Spirit 1.6x headers. The headers erroneously use, in some places, the form:
#include "boost/..."
rather than
#include
It's not "erroneously" exactly. Whether to include with quotes or angles has been a source of contention among Boost developers and there has been no agreement. I am in the latter camp, myself, but others seem to thing that the former is the only correct way.
One I changed the include for the Spirit 1.6.2 headers to use angles instead of quotes, the build worked correctly as expected. In the case of Boost, the only reason to use the former would be if one were specifically compiling from the Boost root directory and did not include the root directory in the compiler's path. I think this is a pretty rare case for using quotes. Whereas it kills the use of an alternative version of a library, in a separate directory, for a particular compiler, such as Spirit 1.6.2 for Borland while one uses the Boost directory for other libraries. I think it is "erroneous" in the sense that it is not needed since one can always add the Boost root directory to the include path. Also the latest Spirit uses all angle brackets and not quotes, so they must have realized the importance of doing so themselves. I think the Boost source and header files should always use angle brackets for all Boost headers, and the bug in correctly building the serialization libraries for Borland is a good example why. Not that every test suite can be totally thorough, but this situation, of building serialization by using SPIRIT_ROOT to point to a Spirit distribution outside the Boost tree, was very probably never tested else it would have been discovered previously.

Edward Diener
David Abrahams wrote:
Edward Diener
writes: All I can say it that this has worked from me as well as the testers in our matrix.
I have discovered the reason for the problem. It has to do with the form of #include in the Spirit 1.6x headers. The headers erroneously use, in some places, the form:
#include "boost/..."
rather than
#include
It's not "erroneously" exactly. Whether to include with quotes or angles has been a source of contention among Boost developers and there has been no agreement. I am in the latter camp, myself, but others seem to thing that the former is the only correct way.
One I changed the include for the Spirit 1.6.2 headers to use angles instead of quotes, the build worked correctly as expected.
In the case of Boost, the only reason to use the former would be if one were specifically compiling from the Boost root directory and did not include the root directory in the compiler's path.
No, there are other reasons that people argue quotes are right. Please search the archives if you want the details. All this stuff about where the compiler searches is almost entirely implementation-dependent. There is no standard, not even a de-facto one, for how quotes and angles will behave. -- Dave Abrahams Boost Consulting www.boost-consulting.com

David Abrahams wrote:
Edward Diener
writes: David Abrahams wrote:
Edward Diener
writes: All I can say it that this has worked from me as well as the testers in our matrix.
I have discovered the reason for the problem. It has to do with the form of #include in the Spirit 1.6x headers. The headers erroneously use, in some places, the form:
#include "boost/..."
rather than
#include
It's not "erroneously" exactly. Whether to include with quotes or angles has been a source of contention among Boost developers and there has been no agreement. I am in the latter camp, myself, but others seem to thing that the former is the only correct way.
One I changed the include for the Spirit 1.6.2 headers to use angles instead of quotes, the build worked correctly as expected.
In the case of Boost, the only reason to use the former would be if one were specifically compiling from the Boost root directory and did not include the root directory in the compiler's path.
No, there are other reasons that people argue quotes are right. Please search the archives if you want the details.
Granted there are other reasons, the main fact is that the use of an older version of Spirit ( or any other Boost library ) in a separate directory structure, along with Boost versions in the main Boost directory structure, will not work when quotes are used instead of brackets with Borland's compilers. I also believe that most compilers follow the Borland example of having quotes mean that the when header file search is done the current directory is searched first followed by the include directories, while having angles means that only the include directories are searched. This would mean that the situation given in the previous paragraph will not work for most other compilers also. Given the above I think that angles should always be used instead of quotes when including Boost header files within the Boost directory tree.
All this stuff about where the compiler searches is almost entirely implementation-dependent. There is no standard, not even a de-facto one, for how quotes and angles will behave.
I do know that. Nonetheless most compilers appear to follow the order given above. Mr. Guzman has agreed to make the changes in the Spirit 1.6.2 header files.

Edward Diener wrote:
When building Boost for C++ Builder 6 and Boost 1.32, the serialization libray fails to build. The reason for this is that it attempts to use the latest Spirit header files and this does not support C++ Builder 6.
FWIW, in our installation of 1.32, we deleted boost\spirit.hpp from
boost and also boost\spirit directory and then replaced them with
spirit-1.6x so that we can still do:
#include
participants (4)
-
David Abrahams
-
Edward Diener
-
Robert Ramey
-
Russell Hind