Boost logo

Boost Users :

Subject: Re: [Boost-users] [interprocess] problem in HPUX
From: manish4gupta (manish_at_[hidden])
Date: 2009-10-01 14:17:24


I am installing the boost on itanium (64 bit red hat) machine. I am following
the three steps.
./bootstrap.sh --prefix=/usr/local
./bjam
./bjam install

After installation, libboost files are all located in
/usr/lib.

But i am trying to run one simple code.

#include <boost/interprocess/managed_shared_memory.hpp>
#include <boost/interprocess/allocators/allocator.hpp>
#include <boost/interprocess/containers/map.hpp>
#include <boost/interprocess/containers/string.hpp>
#include <iostream>

using namespace boost::interprocess;

//Typedefs of allocators and containers
typedef managed_shared_memory::segment_manager segment_manager_t;
typedef allocator<void, segment_manager_t> void_allocator;
typedef allocator<char, segment_manager_t> char_allocator;
typedef basic_string<char, std::char_traits<char>, char_allocator>
char_string;

//Definition of the map holding a string as key and complex_data as mapped
type
typedef std:air<const char_string, int> map_value_type;
typedef allocator<map_value_type, segment_manager_t>
map_value_type_allocator;
typedef map< char_string, int, std::less<char_string>,
map_value_type_allocator> complex_map_type;

int main ()
{
shared_memory_object::remove("MySharedMemory");

//Create shared memory
managed_shared_memory segment(create_only,"MySharedMemory", 65536);

//An allocator convertible to any allocator<T, segment_manager_t> type
void_allocator alloc_inst (segment.get_segment_manager());

//Construct the shared memory map and fill it
complex_map_type *mymap = segment.construct<complex_map_type>("MyMap")(std::
less<char_string>(), alloc_inst);
char_string cs("test", alloc_inst);

for(int i = 0; i < 100; ++i)
{
mymap->insert(std:air<char_string, int>(cs , i));
}
return 0;
}

My machine configuration is ia64 architecture with gcc 3.4.6 on
a Redhat Enterprise Linux 4 Update 5.

when i am trying to compile my program
 g++ -I /usr/local/include/boost-1_39 boostindex.cpp -lrt
and gettting the following error
  
In file included from
/usr/local/include/boost-1_39/boost/interprocess/sync/interprocess_mutex.hpp:47,
                 from
/usr/local/include/boost-1_39/boost/interprocess/mem_algo/rbtree_best_fit.hpp:27,
                 from
/usr/local/include/boost-1_39/boost/interprocess/detail/managed_memory_impl.hpp:22,
                 from
/usr/local/include/boost-1_39/boost/interprocess/managed_shared_memory.hpp:21,
                 from boostindex.cpp:1:
/usr/local/include/boost-1_39/boost/interprocess/detail/atomic.hpp:466:2:
#error No atomic operations implemented for this platform, sorry!
/usr/local/include/boost-1_39/boost/interprocess/detail/atomic.hpp:45:
warning: inline function `uint32_t
boost::interprocess::detail::atomic_cas32(volatile uint32_t*, uint32_t,
uint32_t)' used but never defined
/usr/local/include/boost-1_39/boost/interprocess/detail/atomic.hpp:36:
warning: inline function `void
boost::interprocess::detail::atomic_write32(volatile uint32_t*, uint32_t)'
used but never defined
/usr/local/include/boost-1_39/boost/interprocess/detail/atomic.hpp:31:
warning: inline function `uint32_t
boost::interprocess::detail::atomic_read32(volatile uint32_t*)' used but
never defined

Since you have already solved the pblm may i know what can i do solve this
pblm. I wll be really grateful to you.

Rui Pedro Fernandes wrote:
>
> 2009/9/2 Ion Gaztañaga <igaztanaga_at_[hidden]>:
>> Rui Pedro Fernandes escribió:
>>>
>>> Hi,
>>> I've been trying boost.interprocess v. 1.40 in a HP-UX 11.23 IA64
>>> machine.
>>>
>>> Firstly I tried a 64 bit compilation of the interprocess test with aCC
>>> compiler (v. A.06.15). It failed with error:  "No atomic operations
>>> implemented for this platform, sorry!".
>>
>> Yes, I would need to implement those operations in aCC assembler (or
>> maybe
>> the OS has some nice wrappers?).
>
> Couldn't find any...
>
>>
>>> Then I used gcc 4.1.2 and compilation did succeed.  Many tests got
>>> passed,
>>> however some failed with "boost::interprocess_exception::library_error".
>>> Here is an output example of both cases:
>>
>> Recent GCC versions have portable wrappers for atomic operations. I don't
>> have a machine to test HP-UX. Could you debug it with gdb and help me
>> discover the issue?
>
> In attachment I send you a snapshot of a gdb run.
>
> Regards,
> Rui
>
>>
>> Best,
>>
>> Ion
>> _______________________________________________
>> Boost-users mailing list
>> Boost-users_at_[hidden]
>> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>>
>
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>

-- 
View this message in context: http://www.nabble.com/-interprocess--problem-in-HPUX-tp25244956p25704083.html
Sent from the Boost - Users mailing list archive at Nabble.com.

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net