Olaf Peter | 25 May 2013 20:14
Picon
Picon

variant visitor using SFINAE problem

Hi,

attached my code to show my problem. It seems to work (partially) so 
far, but not the vector<int> where I get a compile error. This is my 
first try with SFINAE in that way. Are the conditions correct and robust 
enough? How to compile it? Did I forgot one use case? Using this small 
helper would simplify some post processing.

Thanks,
Olaf
Attachment (variant_visitor.cpp): text/x-c++src, 3492 bytes
_______________________________________________
Boost-users mailing list
Boost-users <at> lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users
Jérémy Coulon | 25 May 2013 13:06
Picon
Favicon

[ublas] Linkage problems in assignment.hpp

Hello,

Is there any chance for the following bug to be fixed in 1.54 ?
https://svn.boost.org/trac/boost/ticket/6010

Thanks.
Jérémy
lizy10b | 25 May 2013 02:33
Favicon

boost 1.53 parallel graph samples build or test failure on windows

Hi there,
 
I am a windows user and facing the similar problem as decribled in an archived thread posted by
Jeremiah Willcock in 2010, but with no practical solutions:
"Result statuses for run failures of MPI tests"
 
My environment: Boost 1.53, Win7 x64, mpich2-1.3.2p1-win-ia32, Python 2.66 x86, VS2010 SP1
The content of the user-cofig.jam file used to compile boost is:
using python : 2.6 : C:\\Python266 ;
using mpi : :
    <find-static-library>mpi
    <library-path>"D:\\Program Files (x86)\\MPICH2\\lib"
    <include>"D:\\Program Files (x86)\\MPICH2\\include"
  :
    "\"D:\\Program Files (x86)\\MPICH2\\bin\\mpiexec\""
;
 
and the bjam command is:
bjam --prefix=E:\boost_1_53_0\debug32 stage toolset=msvc-10.0 variant=debug link=static address-model=32 threading=multi
 
I did not use the bjam self-test to test all the parallel graph samples, but only picked some samples and build them in VS2010 and try to run. The dependencies linked in VS2010 when build these samples are:
mpi.lib
libboost_graph-vc100-mt-gd-1_53.lib
libboost_graph_parallel-vc100-mt-gd-1_53.lib
libboost_mpi-vc100-mt-gd-1_53.lib
libboost_mpi_python-vc100-mt-gd-1_53.lib
mpi-vc100-mt-gd-1_53.lib
 
Testing results:
No.   Sample Name                    Build            1 proc test       2 proc test                              
--------------------------------------------------------------------
1     adjlist_redist_test.cpp        Passed          No Error          No Error
-----------------------------------------------------------------------
2     adjlist_build_test.cpp          Passed          Error               Error
Error Message:
 Building graph with add_edge from everywhere...application called MPI_Abort(MPI_COMM_WORLD, -1) - process 0
application called MPI_Abort(MPI_COMM_WORLD, -1) - process 1
job aborted:
rank: node: exit code[: error message]
0: lee-win7-x64: -1: process 0 exited without calling finalize
1: lee-win7-x64: -1: process 1 exited without calling finalize
-----------------------------------------------------------------------------
3      breadth_first_search.cpp     Error              --                --
Error Message:
error LNK2019: unresolved external symbol "void __cdecl boost::detail::bfs_helper<class boost::adjacency_list<struct boost::vecS...
------------------------------------------------------------------------------
4      dijkstra_shortest_paths.cpp  Passed      No Error         No Error
-------------------------------------------------------------------------------
5      distributed_csr_test.cpp      18 Errors        --                --
 Error Messags (3 of 18):
Error 5 error C2039: 'key_type' : is not a member of 'boost::property_traits<PA>' e:\boost\boost_1_53_0\debug32\include\boost-1_53\boost\graph\distributed\compressed_sparse_row_graph.hpp 1904 1 boost_test_1
Error 6 error C2146: syntax error : missing ';' before identifier 'local_key_type' e:\boost\boost_1_53_0\debug32\include\boost-1_53\boost\graph\distributed\compressed_sparse_row_graph.hpp 1904 1 boost_test_1
Error 12 error C2602: 'boost::property_map<Graph,Property,Enable>::value_type' is not a member of a base class of 'boost::property_map<Graph,Property,Enable>' e:\boost\boost_1_53_0\debug32\include\boost-1_53\boost\graph\distributed\compressed_sparse_row_graph.hpp 1906 1 boost_test_1
-----------------------------------------------------------------------------------------
 
So where is the problem?
Any help is appreciated.
Thanks
 
Zhiyu Li
Student
China
 
2013-05-25
lizy10b
_______________________________________________
Boost-users mailing list
Boost-users <at> lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users
Daniele Barzotti | 24 May 2013 15:35

[Test] How to span tests into multiply files

Hi,

I want to divide my test suites into multiply files.
I follow this example:
http://stackoverflow.com/questions/2906095/boost-test-looking-for-a-working-non-trivial-test-suite-example-tutorial

testmain.cpp
-----------------
#define BOOST_TEST_DYN_LINK
#define BOOST_TEST_MODULE Main
#include <boost/test/unit_test.hpp>

testConfigClass.cpp
-----------------
BOOST_AUTO_TEST_SUITE(ConfigClass_TestSuite)
BOOST_AUTO_TEST_CASE(testConfigClass) {
...
}
BOOST_AUTO_TEST_SUITE_END()

testDispatcherClass.cpp
-----------------

BOOST_AUTO_TEST_SUITE(DispatcherClass_TestSuite)
BOOST_AUTO_TEST_CASE(testDispatcherClass) {
...
}
BOOST_AUTO_TEST_SUITE_END()

Maybe in the testConfigClass I have some problems, which I cannot figure
out.
When the test ends, the program terminate with:

Exception first-chance a 0x7569c41f in TestSuite.exe: Exception of
Microsoft C++: boost::execution_exception into memory position  0x0034dda4..

In this scenario, where can I found the 'main' to debug deeply?

BR,
Daniele.
Igor R | 23 May 2013 12:08
Picon

[SmartPtr] shared_ptr as a default value in function template

Hello,

In the wake of one of recent SO posts... The following doesn't compile
in MSVC10 (Boost 1.53):

#include <boost/shared_ptr.hpp>
#include <boost/make_shared.hpp>

template<class T>
void f(T item, boost::shared_ptr<int> name = boost::make_shared<int>())
{
}

int main()
{
  f(0);
}

Is it a bug in make_shared or the above violates some Standard paragraph?

Thanks.
samriti katoch | 22 May 2013 23:11
Picon

[msm] Manually setting next state

Thanks for the reply Christophe.

I had considered this alternative, but adding a transition in every state to the initial state, when

Error -> Ok

defeats the purpose of having an orthogonal region, which I added to basically reduce transitions on an Error.

-Samriti
_______________________________________________
Boost-users mailing list
Boost-users <at> lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users
Jordan H. | 22 May 2013 17:10

Compile errors including boost/regex.hpp


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

When I try to compile a file that includes <boost/regex.hpp> I get the
following error:

# /home/me/Projects/myproject> make
# /usr/bin/make  all-am
# make[1]: Entering directory `/home/me/Projects/myproject'
# compiling main.cpp (g++)
# In file included from
/usr/local/include/boost/regex/regex_traits.hpp:27:0,
#                  from /usr/local/include/boost/regex/v4/regex.hpp:39,
#                  from /usr/local/include/boost/regex.hpp:31,
#                  [ ... more traceback ... ]
#
# /usr/local/include/boost/regex/v4/regex_traits.hpp:87:1: error: macro
"test" passed 2 arguments, but
# takes just 1
# In file included from /usr/local/include/boost/regex/v4/regex.hpp:79:0,
#                  from /usr/local/include/boost/regex.hpp:31,
#                  [ ... more traceback ... ]
#
# /usr/local/include/boost/regex/v4/regex_format.hpp:849:1: error: macro
"test" passed 2 arguments, but
# takes just 1
# In file included from
/usr/local/include/boost/regex/regex_traits.hpp:27:0,
#                  from /usr/local/include/boost/regex/v4/regex.hpp:39,
#                  from /usr/local/include/boost/regex.hpp:31,
#                  [ ... more traceback ... ]
#
# /usr/local/include/boost/regex/v4/regex_traits.hpp:87:1: error:
template declaration of ‘char (&
# boost::re_detail::test)[2]’
# /usr/local/include/boost/regex/v4/regex_traits.hpp:87:1: error:
expected unqualified-id before ‘...’
# token
# /usr/local/include/boost/regex/v4/regex_traits.hpp:87:1: error:
expected ‘)’ before ‘...’ token
# /usr/local/include/boost/regex/v4/regex_traits.hpp:87:1: error:
expected ‘)’ before ‘...’ token
# /usr/local/include/boost/regex/v4/regex_traits.hpp:87:1: error:
expected unqualified-id before ‘(’
# token
# In file included from /usr/local/include/boost/regex/v4/regex.hpp:79:0,
#                  from /usr/local/include/boost/regex.hpp:31,
#                  [ ... more traceback ... ]
#
# /usr/local/include/boost/regex/v4/regex_format.hpp:849:1: error:
template declaration of ‘char (&
# boost::re_detail::test)[2]’
# /usr/local/include/boost/regex/v4/regex_format.hpp:849:1: error:
expected unqualified-id before ‘...’
# token
# /usr/local/include/boost/regex/v4/regex_format.hpp:849:1: error:
expected ‘)’ before ‘...’ token
# /usr/local/include/boost/regex/v4/regex_format.hpp:849:1: error:
expected ‘)’ before ‘...’ token
# /usr/local/include/boost/regex/v4/regex_format.hpp:849:1: error:
expected unqualified-id before ‘(’
# token
# make[1]: *** [myproject-main.o] Error 1
# make[1]: Leaving directory `/home/me/Projects/myproject'
# make: *** [all] Error 2
# *** Failure: Exit code 2 ***

This is how I'm compiling:

# g++ -DHAVE_CONFIG_H -I.  `mysql_config --include` `mysql_config
--cflags` -std=c++0x   -g -O2 -MT
# myproject-main.o -MD -MP -MF .deps/myproject-main.Tpo -c -o
myproject-main.o `test -f 'src/main.cpp'
# || echo './'`src/main.cpp

Basically, the compile errors trace back to when I include boost/regex.hpp:
|    #include <boost/regex.hpp>

Any ideas why this occurs? Maybe it's because I'm not including
-lbooost_regex as a compile option? I specified it as my
"myproject_LDADD" macro in Makefile.am so I assume g++ knows when to use it.

Thanks. Sorry for the lengthy email.
-----BEGIN PGP SIGNATURE-----

iQEcBAEBCgAGBQJRnN/nAAoJEOT99oqiSuRNim0H/1U+xgx+TCwOtDiGfC5FH6yR
1HwZYwTb0F/7CwldOBsPoDMfjSJmptH4a4s84PR0xDHFrhvgDkjDvzYkoWPLR7gf
eSAMHzQG3kvJawvHiJNSu/eTZivVfkCE14+zoE+cVriCJicJUJg1g8hp5Cydk6D3
OM9WtOY/GCVHD8lK84UX5HMqnjeX4nPLEA7nJGd1u2+5PkHxpQMF2RO+EWnlNm0e
eTUdZBlGLc/RGHMgl2uF1q3b+qCRrC/Wwn/4OtkDUn0Y3V879LbkYej06oB94zWD
9kKHAnTFOisQJDUmkHr9BiEGgJ9UNO2JCVkHlzrjVgfwKe1r6FIaZmTGNpIme0c=
=Av+g
-----END PGP SIGNATURE-----

_______________________________________________
Boost-users mailing list
Boost-users <at> lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users
Michael Powell | 22 May 2013 17:04
Picon

[atomic] When to load/store

Hello,

I have some thread synchronization to do, probably will end up using
some sort of internally synchronized cancelation or other state to
message between parent and child thread.

If the state uses boost::atomic<bool> _canceled, for instance, how do
I go about setting/getting the value? I am assuming that we do
something like this:

//To get the value.
return _canceled.load(boost::memory_order::memory_order_acq_rel);

//To set the value.
_canceled.store(canceled, boost::memory_order::memory_order_acq_rel);

Using acquire/release to get in, do what we need with the value, and
get out, type thing.

Also bearing in mind this is targeting ARM architecture (ARM5 I think).

Also, how complex a value can be protected? Are we talking primitive
types only? Basic data types like bool, int, float, that sort of
thing?

Thank you...

Regards,

Michael Powell
samriti katoch | 22 May 2013 16:12
Picon

[msm] Manually setting next state


Hi,

Is there a way to manually set the next state for the state machine.
I have an orthogonal region defined for handling errors, where Error is an interruptible state.

----------               -------------
|         | ----------->| Error    |
|   Ok  |              |            |
----------               -------------

This is similar to the example here : http://svn.boost.org/svn/boost/trunk/libs/msm/doc/HTML/examples/Orthogonal-deferred.cpp

Once the state machine recovers from the error, I would like to start from the initial state again in the main orthogonal region.

Is there a way to do this ?

Thanks!
Samriti
_______________________________________________
Boost-users mailing list
Boost-users <at> lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users
nicolas.danet | 22 May 2013 09:03
Picon
Favicon
Gravatar

[Atomic] / PPC / error: impossible constraint in 'asm'


Hello, 

I get the error below compiling with (Xcode 2.5 / OS X 10.4.11) only for PPC arch. 

boost_1_53_0/boost/atomic/detail/gcc-ppc.hpp:1204: error: impossible constraint in 'asm'

The related code is:

static boost::atomic<long> messageCount_(0);
number_ = messageCount_.fetch_add(1, boost::memory_order_relaxed);

Is this a known bug ? Is there any way to fix it ?

Thanks.
Michael Powell | 21 May 2013 23:58
Picon

[thread] "almost works" clarification

Hello,

Okay, so without starting a flame war, because that is not my
intention... Also bear in mind, I am coming from an informed C# .NET
frame of mind having worked with .NET threading, synchronization,
events, and so forth.

I ran across this article, which although a bit dated, is a pretty
good sketch of what I would consider a fairly robust thread runner
abstraction, which if you read past the frustration, makes good sense,
at least in my opinion:
http://peter.bourgon.org/blog/2008/12/12/boost-thread-kindof-sucks.html.

Nothing against the author, I might turn that around and couch it
instead: boost-thread-almost-works: in the sense that, while there are
indeed a rich set of primitives provided to hide the details of
pthread, Win32 threading, or what have you, it stops just short of
providing that abstraction layer for what Peter and I (probably just
he and I) consider a robust runner, monitor, and worker. The
ingredients are there, though, and with a little bit of persuading,
can compose a fairly robust little set of threaded runners.

Okay, with that said, am I correct in understanding, the combination
of condition and mutex facilitates the analog to C# .NET
AutoResetEvent or ManualResetEvent (loosely, ResetEvent) type thing?
In other words, thread keeps-on-a-runnin' until condition is notified,
at which point thread loop(s) know to stop working when they check in
with their conditioned mutex?

In other words, mechanically speaking, a worker-bee that starts
obtains a lock on the mutex. While the worker is running, on-lookers
may poll the monitor for thread completion (which times out as long as
the worker-bee is running and has a scoped lock), or otherwise signal
the thread to complete through the notify mechanism (which tells the
worker-bee to return, which clears the lock). The worker-bee runs
until it is completed or its conditioned mutex has been notified
(whichever comes first).

In another rendition, I was actually using the thread-interruption
mechanism, which I may still do, is another way of signaling a thread
that it should stop what it's doing. However, seems a bit less
graceful than routing requests through a formalized abstraction layer
I think, except through creative use of interrupt disabled (which I
was also using), but is something else to consider.

Anywho, food for thought. Comments, critiques welcome. Thank you...

Regards,

Michael Powell

Gmane