[interprocess] ARM atomic operations problem.

Hi all. I've tried to test the boost IPC communication using: - boost::interprocess::shared_memory_object - boost::interprocess::mapped_region - boost::interprocess::interprocess_mutex - boost::interprocess::interprocess_condition So I created shared memory, and when the first process put the data into the shared memory, call the notify_one() method, to let the second process know, taht there are data in the shared memory. Everything is OK, when I'm using gcc 4.4.1 on linux. But when I tried to cross-compile the sources using arm-linux toolchain, which is based on gcc 3.3.2, I'm always geting error: "#error No atomic operations implemented for this platform, sorry!" I know, that if I will use gcc 4 and above, it will works. But is there any workaround or fix, how to compile boost::interprocess on gcc 3.3.2? Thank you for your advices. Dundee.

On 14/04/2010 14:35, Ivan Dundek wrote:
I know, that if I will use gcc 4 and above, it will works. But is there any workaround or fix, how to compile boost::interprocess on gcc 3.3.2? Thank you for your advices. Dundee.
If you only need those classes, maybe there is an unneeded dependency on atomic operations in those classes, so you could just try to break that dependency or implement some dummy atomic functions with assertions (just to notice if they are somehow called). The hard alternative is to implemente those atomic operations for ARM ;-) Best, Ion

Hi. Thank you for your advice. I've checked the header files, which I include in my code for dependency on atomic operations, and I found in boost/interprocess/sync/interprocess_condition.hpp and boost/interprocess/sync/interprocess_mutex.hpp conditional dependency on file boost/interprocess/detail/atomic.hpp. So I defined in my code BOOST_INTERPROCESS_POSIX_PROCESS_SHARED. Since this, I don't have the error about no atomic operations for this platform, but still have another errors concerning structure stat: In file included from /usr/local/arm-linux/arm-linux/include/boost/interprocess/shared_memory_object.hpp:21, from Server2.cpp:3: /usr/local/arm-linux/arm-linux/include/boost/interprocess/detail/os_file_functions.hpp: In function `bool boost::interprocess::detail::delete_subdirectories_recursive(const std::string&, const char*)': /usr/local/arm-linux/arm-linux/include/boost/interprocess/detail/os_file_functions.hpp:515: error: ` ::' does not have a class or union named `stat' In file included from Server2.cpp:4: /usr/local/arm-linux/arm-linux/include/boost/interprocess/mapped_region.hpp: In constructor `boost::interprocess::mapped_region::mapped_region(const MemoryMappable&, boost::interprocess::mode_t, long int, unsigned int, const void*)': /usr/local/arm-linux/arm-linux/include/boost/interprocess/mapped_region.hpp:444: error: ` ::' does not have a class or union named `stat' Structure stats is defined in bits/stat.h, which is included from sys/stat.h. Any help will be appreciated. Thanx. Dundee. On Wed, 2010-04-14 at 19:17 +0200, Ion Gaztañaga wrote:
On 14/04/2010 14:35, Ivan Dundek wrote:
I know, that if I will use gcc 4 and above, it will works. But is there any workaround or fix, how to compile boost::interprocess on gcc 3.3.2? Thank you for your advices. Dundee.
If you only need those classes, maybe there is an unneeded dependency on atomic operations in those classes, so you could just try to break that dependency or implement some dummy atomic functions with assertions (just to notice if they are somehow called). The hard alternative is to implemente those atomic operations for ARM ;-)
Best,
Ion
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (2)
-
Ion Gaztañaga
-
Ivan Dundek