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">&lt;<a href="mailto:mirco.wahab@chemie.tu-freiberg.de">mirco.wahab@chemie.tu-freiberg.de</a>&gt;</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 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&#39;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 href="http://www.pcre.org/" target="_blank">http://www.pcre.org/</a>) would be just another<br>
   dependency, so better not ...<br>
<br>
- &lt;regex&gt; with Gcc (tr1, C++0x) won&#39;t work at all (not even<br>
   in 4.6.3), see<br>
<a 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>
- &lt;regex&gt; with VS 2010 (tr1) will work with only the<br>
   most simple expressions, anything moderate complicated<br>
   will crash it&#39;s engine on the initial regex compilation (*)<br>
<br>
- &lt;regex.h&gt; 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&#39;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 href="http://gitorious.org/boost/cmake">http://gitorious.org/boost/cmake</a> or <a 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&#39;m not sure how to create such a subset. The ryppl based one is supposed to support this but I&#39;m not sure how to do it. <a 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><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. </div>

<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 &#39;minimal boost tree&#39; 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 &#39;-with-external-boost&#39; or<br>
its CMake equivalent.<br>
<br>
my 0,02€<br>
<br>
Thanks &amp; 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 &lt;regex&gt; 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>
        &quot;\\A(\\w+)[^\\n\\r]*[\\r\\n]+&quot;<br>
        &quot;[ ]*(\\d+)[^\\n\\r]*[\\r\\n]+&quot;<br>
        &quot;[ ]*\\d+&quot;  &quot;[ ]*[-_\\w]+&quot;  &quot;[ ]*[-_\\w]+&quot;  &quot;[ ]*\\d+&quot;  &quot;[<br>
]*[\\d\\.]+&quot;  &quot;[ ]*[\\d\\.]+&quot;  &quot;[ ]*[\\d\\.]+&quot;<br>
     ;<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
gmx-developers mailing list<br>
<a href="mailto:gmx-developers@gromacs.org">gmx-developers@gromacs.org</a><br>
<a href="http://lists.gromacs.org/mailman/listinfo/gmx-developers" target="_blank">http://lists.gromacs.org/mailman/listinfo/gmx-developers</a><br>
Please don&#39;t post (un)subscribe requests to the list. Use the<br>
www interface or send it to <a 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 href="http://cmb.ornl.gov">cmb.ornl.gov</a><br>865-241-1537, ORNL PO BOX 2008 MS6309<br>
</div>