Yes, I would need to implement those operations in aCC assembler (or
maybe the OS has some nice wrappers?).
> 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?
Best,
Ion
_______________________________________________
Boost-users mailing list
Boost...@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users
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
I see that open is throwing and that seems strange. Could you debug a
bit more deeper into Interprocess to the place where the exception is
launched?
I'm new in Boost and I need a code to start.
I want to create a Graph with following features:
1. In every vertex has 4 integers, 4 doubles and 2 bools.
2. Directed Graph
3. At most 9 Out edges for every Vertex and I should know which one is
the first one.
Could any one help me to start.
Regards
http://www.google.com/#hl=en&safe=off&num=100&newwindow=1&q=c%2B%2B+boost+graph&aq=f&aqi=g1&oq=&fp=3aa7f458acaa2672
http://www.google.com/#hl=en&safe=off&num=100&newwindow=1&q=c%2B%2B+boost+graph+tutorial&aq=f&aqi=&oq=&fp=3aa7f458acaa2672
The tutorial is a pretty good starting place if you have not read
through those examples yet.
-Steve
From the gdb output you sent, I can't deduce why is falling in HPUX,
because sem_open is failing but I can't see the errno value and that
errno is not a value that can be translated to standardized interprocess
values. Let's see if the value of errno after sem_open fails can give us
any hint.
Regarding the atomic library, it's beyond my skills to port it properly
and requires a support that I can't provide. If you feel confident you
can port it and fill the few functions needed in
interprocess/detail/atomic.hpp to support aCC, supposing aCC is C++
standard compliant enough to compler the rest of interprocess and its
dependencies.
>From the gdb output you sent, I can't deduce why is falling in HPUX, because sem_open is failing but I can't see the errno value and that errno is not a value that can be translated to standardized interprocess values. Let's see if the value of errno after sem_open fails can give us any hint.
Regarding the atomic library, it's beyond my skills to port it properly and requires a support that I can't provide. If you feel confident you can port it and fill the few functions needed in interprocess/detail/atomic.hpp to support aCC,
supposing aCC is C++ standard compliant enough to compler the rest of interprocess and its dependencies.
I don't have much time for this, but it seems that seeing:
http://docs.hp.com/en/B9106-90009/sem_open.2.html
[EINVAL]
"The name argument does not begin with "/" or contains "." or ".." as a
pathname component."
and...
"The name argument points to a string referring to a semaphore. It
should begin with a "/" and shall conform to pathname rules except that
no path component should be "." or ".."."
Whereas for shm_open:
http://docs.hp.com/en/B9106-90009/shm_open.2.html
"The name argument points to the shared memory object name, and must
conform to the general construction rules for a pathname."
Interprocess supposes that if shm_open needs path-based names(POSIX
allows that), sem_open also needs them, so try to comment this line in
inteprocess/detail/workaround.hpp:
#ifdef BOOST_INTERPROCESS_POSIX_NAMED_SEMAPHORES
#if defined(BOOST_INTERPROCESS_FILESYSTEM_BASED_POSIX_RESOURCES)
//THIS-> #define BOOST_INTERPROCESS_FILESYSTEM_BASED_POSIX_SEMAPHORES
#endif
#endif
And let's see if simple "/name" names are what hpux needs for sems.
The most likely cause is that you are compiling with optimizations turned on.
Interprocess supposes that if shm_open needs path-based names(POSIX allows that), sem_open also needs them, so try to comment this line in inteprocess/detail/workaround.hpp:
#ifdef BOOST_INTERPROCESS_POSIX_NAMED_SEMAPHORES
#if defined(BOOST_INTERPROCESS_FILESYSTEM_BASED_POSIX_RESOURCES)
//THIS-> #define BOOST_INTERPROCESS_FILESYSTEM_BASED_POSIX_SEMAPHORES
#endif
#endif
And let's see if simple "/name" names are what hpux needs for sems.
2009/9/13 Ion Gaztañaga <igazt...@gmail.com>
Interprocess supposes that if shm_open needs path-based names(POSIX allows that), sem_open also needs them, so try to comment this line in inteprocess/detail/workaround.hpp:
#ifdef BOOST_INTERPROCESS_POSIX_NAMED_SEMAPHORES
#if defined(BOOST_INTERPROCESS_FILESYSTEM_BASED_POSIX_RESOURCES)
//THIS-> #define BOOST_INTERPROCESS_FILESYSTEM_BASED_POSIX_SEMAPHORES
#endif
#endif
And let's see if simple "/name" names are what hpux needs for sems.This solved the problem. Thank you!
Based on this information I solved the problem by adding this line to file Jamfile.v2, after line 29:<host-os>hpux,<toolset>gcc:<linkflags>"-Wl,+as,mpas"
I will integrate them and try to include them for the next boost version.
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.
--
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.