<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
On 15/03/2012 10:16 AM, Roland Schulz wrote:
<blockquote
cite="mid:CAO2TwbnPDNas2kpTkX_zudf_UkWsr8Mw3rXakPu3RkURnJYV8g@mail.gmail.com"
type="cite">Hi,
<div><br>
</div>
<div><br>
</div>
<div>
<div class="gmail_quote">On Wed, Mar 14, 2012 at 5:39 PM, Mirco
Wahab <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:mirco.wahab@chemie.tu-freiberg.de">mirco.wahab@chemie.tu-freiberg.de</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">There was
a short discussion on gerrit (gromacs-master) on how to<br>
consider regular expressions in selections in future
releases,<br>
eg. here:<br>
<a moz-do-not-send="true"
href="https://gerrit.gromacs.org/#/c/551/7/src/gromacs/selection/tests/selectioncollection.cpp"
target="_blank">https://gerrit.gromacs.org/#/c/551/7/src/gromacs/selection/tests/selectioncollection.cpp</a><br>
<br>
I'm inclined to start a new thread for this ;-) The problem<br>
here is, in my opinion, what would be the *best package*<br>
to rely on with the least possible amount of surprises<br>
in the future.<br>
<br>
The (my) [-] candidates:<br>
<br>
- PCRE (<a moz-do-not-send="true"
href="http://www.pcre.org/" target="_blank">http://www.pcre.org/</a>)
would be just another<br>
dependency, so better not ...<br>
<br>
- <regex> with Gcc (tr1, C++0x) won't work at all (not
even<br>
in 4.6.3), see<br>
<a moz-do-not-send="true"
href="http://gcc.gnu.org/onlinedocs/libstdc++/manual/status.html#id476343"
target="_blank">http://gcc.gnu.org/onlinedocs/libstdc++/manual/status.html#id476343</a><br>
<br>
- <regex> with VS 2010 (tr1) will work with only the<br>
most simple expressions, anything moderate complicated<br>
will crash it's engine on the initial regex compilation
(*)<br>
<br>
- <regex.h> is something GNU/GCC specific. A C-library
that provides<br>
(through regcomp()/regexec()) a basic matching and
searching<br>
functionality (which might be ok). It is included in the
glibc<br>
package (under /posix) and might not easily available for<br>
Win64 (if at all) .<br>
<br>
The (my) [+] candidates:<br>
<br>
- Boost<br>
</blockquote>
<div><br>
</div>
<div>I agree with your conclusion that boost would be the best
option. But...</div>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Boost is /already/ included somehow in master (for
smart_ptr,<br>
scoped_ptr?), despite the [Allowed C++ Features] ruling:<br>
/Don't use Boost, except parts that all developers have<br>
agreed to be essential. These parts will be copied to<br>
the Gromacs source tree./<br>
</blockquote>
<div><br>
</div>
<div>This is a problem. regex is not a header only library.
Thus different from the current libraries (exception and
smart_ptr (shared_ptr, scope_ptr)) which only have headers,
regex requires to be compiled. Someone would need to look
into how to best compile it. At least two options exist how
to compile a boost sub-selection included in Gromacs:</div>
<div>- use the standard method of bjam and also ship and
autocompile bjam. Copying bjam is supported by bcp.</div>
<div>- use cmake to compile. Either write the cmake files
yourself or use one of the existing cmake build scripts for
boost:<a moz-do-not-send="true"
href="http://gitorious.org/boost/cmake">http://gitorious.org/boost/cmake</a> or <a
moz-do-not-send="true"
href="http://ryppl.github.com/gettingstarted.html">http://ryppl.github.com/gettingstarted.html</a></div>
<div><br>
</div>
<div>Currently we use bcp to generate the subset of boost we
include (see src/external/boost/README). With the
cmake/boost on gitorious I'm not sure how to create such a
subset. The ryppl based one is supposed to support this but
I'm not sure how to do it. <a moz-do-not-send="true"
href="http://boost.2283326.n4.nabble.com/How-to-use-BCP-td3629743.html">http://boost.2283326.n4.nabble.com/How-to-use-BCP-td3629743.html</a> has
a bit more detail on the different options and problems. If
you could look into the issue of how to build boost-regex
within gromacs that would be great.</div>
</div>
</div>
</blockquote>
<br>
Boost has a header-only regex library: <a
href="http://www.boost.org/doc/libs/1_49_0/doc/html/xpressive.html">http://www.boost.org/doc/libs/1_49_0/doc/html/xpressive.html</a>
It can do both dynamic regex that are compiled at run time (good for
things like selections), and has a C++-language format for static
regexes (good for things like parsing input files). It does use some
parts of Boost mpl, which I gather is less than desirable, but I'm
not sure why.<br>
<br>
<blockquote
cite="mid:CAO2TwbnPDNas2kpTkX_zudf_UkWsr8Mw3rXakPu3RkURnJYV8g@mail.gmail.com"
type="cite">
<div>
<div class="gmail_quote">
<div><br>
</div>
<div>BTW: Being able to include linked boost libraries into
the included boost would help us not only help with regex. I
think we could benefit greatly from using Boost::MPI in
non-performance critical parts of the code
(e.g. bcast_ir_mtop and global_stat) to improve performance,
scaleability AND maintainability. <br>
</div>
</div>
</div>
</blockquote>
<br>
Hell yes.<br>
<br>
Mark<br>
<br>
<blockquote
cite="mid:CAO2TwbnPDNas2kpTkX_zudf_UkWsr8Mw3rXakPu3RkURnJYV8g@mail.gmail.com"
type="cite">
<div>
<div class="gmail_quote">
<div><br>
</div>
<div>Of course we could also not include boost regex into the
boost subselection we include in the Gromacs code. Then the
regex part would require boost to be available.</div>
<div><br>
</div>
<div>Roland</div>
<div><br>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Boost is, imho, the only ubiquitous package that works<br>
almost perfectly for complicated regexes in unix and<br>
windows environments. If it can be agreed upon copying<br>
the regex part into the 'minimal boost tree' of gromacs,<br>
this problem would have been solved.<br>
<br>
There could be, for exotic environments with their own boost<br>
already in place, some kind of '-with-external-boost' or<br>
its CMake equivalent.<br>
<br>
my 0,02€<br>
<br>
Thanks & Regards<br>
<br>
M.<br>
<br>
<br>
<br>
<br>
<br>
<br>
(*) - e.g., this will match against the contents of a
gromacs .gro<br>
file but crashes the VS2010 <regex> engine (but not
the Boost one):<br>
<br>
const char * MDATA::reg_gro =<br>
/*<br>
SOME_NAME<br>
1234<br>
1 ABC A100 1 44.455 32.113 39.983<br>
*/<br>
"\\A(\\w+)[^\\n\\r]*[\\r\\n]+"<br>
"[ ]*(\\d+)[^\\n\\r]*[\\r\\n]+"<br>
"[ ]*\\d+" "[ ]*[-_\\w]+" "[ ]*[-_\\w]+" "[
]*\\d+" "[<br>
]*[\\d\\.]+" "[ ]*[\\d\\.]+" "[ ]*[\\d\\.]+"<br>
;<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
gmx-developers mailing list<br>
<a moz-do-not-send="true"
href="mailto:gmx-developers@gromacs.org">gmx-developers@gromacs.org</a><br>
<a moz-do-not-send="true"
href="http://lists.gromacs.org/mailman/listinfo/gmx-developers"
target="_blank">http://lists.gromacs.org/mailman/listinfo/gmx-developers</a><br>
Please don't post (un)subscribe requests to the list.
Use the<br>
www interface or send it to <a moz-do-not-send="true"
href="mailto:gmx-developers-request@gromacs.org">gmx-developers-request@gromacs.org</a>.<br>
<br>
<br>
<br>
<br>
</font></span></blockquote>
</div>
<br>
<br clear="all">
<div><br>
</div>
-- <br>
ORNL/UT Center for Molecular Biophysics <a
moz-do-not-send="true" href="http://cmb.ornl.gov">cmb.ornl.gov</a><br>
865-241-1537, ORNL PO BOX 2008 MS6309<br>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
</blockquote>
<br>
</body>
</html>