Guys,

Can anybody help me with the below issues?
In solaris 9, the atomic operations are availabe only for kernel not for user code. However when using boost, the code tries to include /usr/include/sys/atomic.h and this can only be used by kernel.

I have tried the same code on solaris 10 ,RHEL 5.3 and HP-UX and everything works fine. Is there is way to force boost not use solaris atomic operations?

Regards,
DS

On Fri, Jun 26, 2009 at 5:28 PM, d s <dhiraj.reg@gmail.com> wrote:
I am using managed_shared_memory to implement a cache. However during compilation I get the following error -

g++ -o .build/CacheLib/cachebase.pic.o -c -fPIC -m64 -g -isystem /usr/local/include/c++/3.4.2 -isystem /usr/local/include/c++/3.4.2/sparc-sun-solaris2.9 -isystem /usr/include -isystem /usr/local/include-isystem /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.2/include -isystem /usr/include/sys -nostdinc -nostdinc++ -I/usr/local/include/boost-1_39 -I/geneva1/apps/IRB_2.2.30/2.2.30_CURRENT/include -I/oracle/product/9.2.0/rdbms/demo -I.build/CacheLib -Isrc/CacheLib -I/usr/local/include/log4cpp src/CacheLib/cachebase.cpp
In file included from /usr/local/include/boost-1_39/boost/interprocess/detail/managed_open_or_create_impl.hpp:20,
                 from /usr/local/include/boost-1_39/boost/interprocess/managed_mapped_file.hpp:20,
                 from src/CacheLib/cachebase.h:12,
                 from src/CacheLib/cachebase.cpp:8:
/usr/local/include/boost-1_39/boost/interprocess/detail/atomic.hpp: In function `boost::uint32_t boost::interprocess::detail::atomic_add32(volatile boost::uint32_t*, boost::uint32_t)':
/usr/local/include/boost-1_39/boost/interprocess/detail/atomic.hpp:331: error: `atomic_add_32_nv' undeclared (first use this function)
/usr/local/include/boost-1_39/boost/interprocess/detail/atomic.hpp:331: error: (Each undeclared identifier is reported only once for each function it appears in.)
/usr/local/include/boost-1_39/boost/interprocess/detail/atomic.hpp: In function `boost::uint32_t boost::interprocess::detail::atomic_cas32(volatile boost::uint32_t*, boost::uint32_t, boost::uint32_t)':
/usr/local/include/boost-1_39/boost/interprocess/detail/atomic.hpp:341: error: `atomic_cas_32' undeclared (first use this function)
/usr/local/include/boost-1_39/boost/interprocess/detail/atomic.hpp: In function `boost::uint32_t boost::interprocess::detail::atomic_inc32(volatile boost::uint32_t*)':
/usr/local/include/boost-1_39/boost/interprocess/detail/atomic.hpp:347: error: `atomic_add_32_nv' undeclared (first use this function)
/usr/local/include/boost-1_39/boost/interprocess/detail/atomic.hpp: In function `boost::uint32_t boost::interprocess::detail::atomic_dec32(volatile boost::uint32_t*)':
/usr/local/include/boost-1_39/boost/interprocess/detail/atomic.hpp:353: error: `atomic_add_32_nv' undeclared (first use this function)
scons: *** [.build/CacheLib/cachebase.pic.o] Error 1
scons: building terminated because of errors.


I am using gcc version 3.4.2 on solaris 9.
Reading specs from /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.2/specs
Configured with: ../configure --with-as=/usr/ccs/bin/as --with-ld=/usr/ccs/bin/ld --disable-nls
Thread model: posix
gcc version 3.4.2


Kindly advice what is the problem? Is there any way I can use pthread atomic operation instead to solaris atomic operations.

Note: The same code is working fine on RHEL Enterprise 5 and Hp-UX.