[Boost.Test] Compiling on Mac OS X

Hi, We have run into problems trying to compile Boost.Test on a Mac OS X 10.3 system using GCC version 3.3 (details below). We are using the "included" implementation of Boost.Test in a shared library that we build using our own build system. This works fine on various different platforms and compilers, however part of Boost.Test fails to compile on Mac OS X. We are including Boost.Test in our shared library in the following way: // Define this to declare all Boost.Test symbols as __declspec(dllexport) // rather than __declspec(dllimport). #define BOOST_TEST_SOURCE #define BOOST_TEST_DYN_LINK #include <boost/test/included/unit_test.hpp> The compiler errors (see below) indicate that some symbols related to signal handling are undefined. Either, some required system headers are not included, or these symbols are not portable and not available on Mac OS X (10.3). Has this problem been encountered before? Is there an easy workaround for it, such as defining certain symbols before including the Boost.Test headers? Could it be somehow related to the way we are building Boost.Test? Furthermore, it would be interesting for us to know what the status of Boost.Test on Mac OS X is in general. Unfortunately, the "Portability" section in the documentation http://www.boost.org/doc/libs/1_35_0/libs/test/doc/portability.html as well as the rest of the documentation do not provide a lot of information regarding support for different platforms. Below, you will find the error messages that we got, as well as some information about our system and the version of Boost.Test that we used. Thanks in advance for any help. Best regards, Florian *Boost Version* 1.35.0 *System* MacOSX 10.3 *Compiler* g++ (GCC) 3.3 20030304 (Apple Computer, Inc. build 1666) Copyright (C) 2002 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *Errors* In file included from <...>/boost/test/included/unit_test.hpp:22, from <...>:18: <...>/boost/test/impl/execution_monitor.ipp: In member function `void boost::detail::system_signal_exception::report() const': <...>/boost/test/impl/execution_monitor.ipp:286: error: `ILL_ILLOPN' undeclared (first use this function) <...>/boost/test/impl/execution_monitor.ipp:286: error: (Each undeclared identifier is reported only once for each function it appears in.) <...>/boost/test/impl/execution_monitor.ipp:291: error: `ILL_ILLADR' undeclared (first use this function) <...>/boost/test/impl/execution_monitor.ipp:306: error: `ILL_PRVREG' undeclared (first use this function) <...>/boost/test/impl/execution_monitor.ipp:311: error: `ILL_COPROC' undeclared (first use this function) <...>/boost/test/impl/execution_monitor.ipp:316: error: `ILL_BADSTK' undeclared (first use this function) <...>/boost/test/impl/execution_monitor.ipp:326: error: `FPE_INTDIV' undeclared (first use this function) <...>/boost/test/impl/execution_monitor.ipp:331: error: `FPE_INTOVF' undeclared (first use this function) <...>/boost/test/impl/execution_monitor.ipp:361: error: `FPE_FLTSUB' undeclared (first use this function) <...>/boost/test/impl/execution_monitor.ipp:391: error: `BUS_ADRERR' undeclared (first use this function) <...>/boost/test/impl/execution_monitor.ipp:396: error: `BUS_OBJERR' undeclared (first use this function)

Florian Winter <fw <at> motama.com> writes:
Hi,
We have run into problems trying to compile Boost.Test on a Mac OS X 10.3
(details below). We are using the "included" implementation of Boost.Test in a shared library that we build using our own build system. This works fine on various different
system using GCC version 3.3 platforms and compilers, however
part of Boost.Test fails to compile on Mac OS X. We are including Boost.Test in our shared library in the following way:
// Define this to declare all Boost.Test symbols as __declspec(dllexport) // rather than __declspec(dllimport). #define BOOST_TEST_SOURCE
#define BOOST_TEST_DYN_LINK #include <boost/test/included/unit_test.hpp>
Though this particular setup was never tested (I recommend linking to shared library instead) and quite possibly will fail since library is not intended ot be used this way, I believe the particular error you see now is fixed in svn recently. Gennadiy

Gennadiy Rozental wrote:
Though this particular setup was never tested (I recommend linking to shared library instead) and quite possibly will fail since library is not intended ot be used this way, I believe the particular error you see now is fixed in svn recently.
Thank you for pointing this out. So far, our setup works fine on Windows and Linux using completely different toolchains. The compilation problem that we get doesn't seem to be related to the way we build Boost.Test at first glance, but feel free to tell me I am wrong. Apparently, the compilation problem that we had is already known, even though our particular setup was never tested. Is the problem a general problem on Mac OS X 10.3, i.e. will we also run into this problem when compiling the latest release of Boost.Test the standard way? Or is the problem related to our setup in particular? This would be important for us to know because it determines the next step we take to solve the problem, which would be either upgrade to a newer SVN version or try to build Boost.Test the standard way. Thanks in advance. Best regards, Florian

Florian Winter <fw <at> motama.com> writes:
Thank you for pointing this out. So far, our setup works fine on Windows and Linux using completely different toolchains. The compilation problem that we get doesn't seem to be related to the way we build Boost.Test at first glance, but feel free to tell me I am wrong.
You may find it breaking once you do a step away from situation where it works. Why don't you like using shared library?
Is the problem a general problem on Mac OS X 10.3, i.e. will we also run into this problem when compiling the latest release of Boost.Test the standard way? Or is the problem related to our setup in particular?
No. The problem was in general on Mac.
This would be important for us to know because it determines the next step we take to solve the problem, which would be either upgrade to a newer SVN version or try to build Boost.Test the standard way.
Try svn. You can see the status of platform build on corresponding regression test page. Gennadiy

Hi, The reason we are not using the shared library version of Boost.Test is simply that we find it more convenient to build a shared Boost.Test library on all platforms using our own build system. There is no other reason for it, and so far our way of using the library did not cause any problems. Our method of linking Boost.Test is also transparent to applications, because if we ever run into problems, we can still build a shared Boost.Test library in the standard way and link our shared library against it (instead of including the Boost.Test implementation). We were able to fix the compilation problem on Mac OS X by removing the #define of BOOST_HAVE_SIGACTION in macos.hpp . I hope this is a valid fix or workaround that will not cause any problems other than making error reporting in case of a signal less verbose on Mac OS X ... Thank you for your help so far. best regards, Florian Gennadiy Rozental wrote:
Florian Winter <fw <at> motama.com> writes:
Thank you for pointing this out. So far, our setup works fine on Windows and Linux using completely different toolchains. The compilation problem that we get doesn't seem to be related to the way we build Boost.Test at first glance, but feel free to tell me I am wrong.
You may find it breaking once you do a step away from situation where it works. Why don't you like using shared library?
Is the problem a general problem on Mac OS X 10.3, i.e. will we also run into this problem when compiling the latest release of Boost.Test the standard way? Or is the problem related to our setup in particular?
No. The problem was in general on Mac.
This would be important for us to know because it determines the next step we take to solve the problem, which would be either upgrade to a newer SVN version or try to build Boost.Test the standard way.
Try svn. You can see the status of platform build on corresponding regression test page.
Gennadiy
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
-- Florian Winter Software-Entwickler

Florian Winter <fw <at> motama.com> writes:
We were able to fix the compilation problem on Mac OS X by removing the #define of BOOST_HAVE_SIGACTION in macos.hpp . I hope this is a valid fix or workaround that will not cause any problems other than making error reporting in case of a signal less verbose on Mac OS X ...
You can try to re-enable signal catching once I fix the compilation issues Gennadiy
participants (2)
-
Florian Winter
-
Gennadiy Rozental