<div dir="ltr">Hi,<br><br><div class="gmail_quote"><div dir="ltr">On Thu, Feb 18, 2016 at 3:28 PM Szilárd Páll &lt;<a href="mailto:pall.szilard@gmail.com">pall.szilard@gmail.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
Thanks for looking into this!<br>
<br>
I was not aware that zlib is only required if libxml2 was configured<br>
with it. Unless there is an easy way to check for the libxml2<br>
dependencies before the xmlTextWriterEndAttribute test is performed, I<br>
have no better suggestion. Aren&#39;t there some symbols or exported<br>
functions only present when libxml2 is configured with zlib?<br></blockquote><div><br></div><div>We could probably do that. If we adopt the tinyxml2 route, then I&#39;d suggest we leave such libxml2 management issues as TODOs for if/when we add other code that requires functionality from libxml2.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Replacing libxml2 external dependency for this particular use-case<br>
sounds useful, although it does add some code complexity and<br>
maintenenace burden. However, I&#39;m not sure the alternative requires<br>
less code (especially if the BG/Q issue is a very different one than<br>
what I ran into).<br></blockquote><div><br></div><div>If we don&#39;t end up needing libxml2 for anything else, then a bunch of code that we apparently don&#39;t maintain well enough currently gets to disappear, which is something.</div><div><br></div><div>Mark</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
--<br>
Szilárd<br>
<br>
<br>
On Thu, Feb 18, 2016 at 2:39 PM, Mark Abraham &lt;<a href="mailto:mark.j.abraham@gmail.com" target="_blank">mark.j.abraham@gmail.com</a>&gt; wrote:<br>
&gt; Hi,<br>
&gt;<br>
&gt; Yes, perhaps that call to check_library_exists can be improved, e.g. by<br>
&gt; setting CMAKE_REQUIRED_LIBRARIES for the check (see<br>
&gt; <a href="https://cmake.org/cmake/help/v3.0/module/CheckLibraryExists.html" rel="noreferrer" target="_blank">https://cmake.org/cmake/help/v3.0/module/CheckLibraryExists.html</a>). However,<br>
&gt; it is awkward to do a good job here, because libxml2 only requires zlib if<br>
&gt; the former was configured that way, so we have a fairly large number of<br>
&gt; conditions to handle in constructing our handling (shared/static, whether<br>
&gt; either was found, whether libxml2 needs zlib or not, whether test binaries<br>
&gt; need to be built, etc.).<br>
&gt;<br>
&gt; Roland suggested <a href="https://gerrit.gromacs.org/#/c/5630/2" rel="noreferrer" target="_blank">https://gerrit.gromacs.org/#/c/5630/2</a> but I am not sure if<br>
&gt; it is related.<br>
&gt;<br>
&gt; Alternatively/also, since currently the only use for XML handling in master<br>
&gt; branch is for test reference data, I have uploaded<br>
&gt; <a href="https://gerrit.gromacs.org/#/c/5653/" rel="noreferrer" target="_blank">https://gerrit.gromacs.org/#/c/5653/</a> to replace this use of libxml2 with a<br>
&gt; bundled copy of tinyxml2, as part of <a href="http://redmine.gromacs.org/issues/1908" rel="noreferrer" target="_blank">http://redmine.gromacs.org/issues/1908</a><br>
&gt; so that we get rid of such problematic external dependencies. These have<br>
&gt; been causing grief lately for users on BG/Q machines. I suggest we keep<br>
&gt; libxml2 detection and handling present but inactive while the future of<br>
&gt; various patches in Gerrit gets resolved.<br>
&gt;<br>
&gt; Mark<br>
&gt;<br>
&gt; On Wed, Feb 10, 2016 at 4:37 PM Szilárd Páll &lt;<a href="mailto:pall.szilard@gmail.com" target="_blank">pall.szilard@gmail.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; Hi,<br>
&gt;&gt;<br>
&gt;&gt; $ cmake -DGMX_PREFER_STATIC_LIBS=ON -DGMX_BUILD_UNITTESTS=ON<br>
&gt;&gt;<br>
&gt;&gt; [...]<br>
&gt;&gt; -- Looking for zlibVersion in /usr/lib/x86_64-linux-gnu/libz.a<br>
&gt;&gt; -- Looking for zlibVersion in /usr/lib/x86_64-linux-gnu/libz.a - found<br>
&gt;&gt; -- Found LibXml2: /usr/lib/x86_64-linux-gnu/libxml2.a (found version<br>
&gt;&gt; &quot;2.9.1&quot;)<br>
&gt;&gt; -- Looking for xmlTextWriterEndAttribute in<br>
&gt;&gt; /usr/lib/x86_64-linux-gnu/libxml2.a<br>
&gt;&gt; -- Looking for xmlTextWriterEndAttribute in<br>
&gt;&gt; /usr/lib/x86_64-linux-gnu/libxml2.a - not found<br>
&gt;&gt; [...]<br>
&gt;&gt; CMake Error at CMakeLists.txt:562 (message):<br>
&gt;&gt;   Cannot build unit tests without libxml2.  Either set<br>
&gt;&gt;   GMX_BUILD_UNITTESTS=OFF or tell CMake how to find a working version of<br>
&gt;&gt;   libxml2.<br>
&gt;&gt;<br>
&gt;&gt; Even though both libz and libxml are detected, the<br>
&gt;&gt; xmlTextWriterEndAttribute lib test fails to link as the<br>
&gt;&gt; check_library_exists() does not pass -lz.<br>
&gt;&gt;<br>
&gt;&gt; I vaguely remember some discussion around it so I thought I&#39;d ask<br>
&gt;&gt; whether this is a known issue before filing a report.<br>
&gt;&gt;<br>
&gt;&gt; Are there any simple workarounds for this? (I tried passing -lz in the<br>
&gt;&gt; linker flags, but that does not help).<br>
&gt;&gt; Could we provide a better hint in the error?<br>
&gt;&gt;<br>
&gt;&gt; Cheers,<br>
&gt;&gt; --<br>
&gt;&gt; Szilárd<br>
&gt;&gt; --<br>
&gt;&gt; Gromacs Developers mailing list<br>
&gt;&gt;<br>
&gt;&gt; * Please search the archive at<br>
&gt;&gt; <a href="http://www.gromacs.org/Support/Mailing_Lists/GMX-developers_List" rel="noreferrer" target="_blank">http://www.gromacs.org/Support/Mailing_Lists/GMX-developers_List</a> before<br>
&gt;&gt; posting!<br>
&gt;&gt;<br>
&gt;&gt; * Can&#39;t post? Read <a href="http://www.gromacs.org/Support/Mailing_Lists" rel="noreferrer" target="_blank">http://www.gromacs.org/Support/Mailing_Lists</a><br>
&gt;&gt;<br>
&gt;&gt; * For (un)subscribe requests visit<br>
&gt;&gt; <a href="https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-developers" rel="noreferrer" target="_blank">https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-developers</a> or<br>
&gt;&gt; send a mail to <a href="mailto:gmx-developers-request@gromacs.org" target="_blank">gmx-developers-request@gromacs.org</a>.<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; Gromacs Developers mailing list<br>
&gt;<br>
&gt; * Please search the archive at<br>
&gt; <a href="http://www.gromacs.org/Support/Mailing_Lists/GMX-developers_List" rel="noreferrer" target="_blank">http://www.gromacs.org/Support/Mailing_Lists/GMX-developers_List</a> before<br>
&gt; posting!<br>
&gt;<br>
&gt; * Can&#39;t post? Read <a href="http://www.gromacs.org/Support/Mailing_Lists" rel="noreferrer" target="_blank">http://www.gromacs.org/Support/Mailing_Lists</a><br>
&gt;<br>
&gt; * For (un)subscribe requests visit<br>
&gt; <a href="https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-developers" rel="noreferrer" target="_blank">https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-developers</a> or<br>
&gt; send a mail to <a href="mailto:gmx-developers-request@gromacs.org" target="_blank">gmx-developers-request@gromacs.org</a>.<br>
--<br>
Gromacs Developers mailing list<br>
<br>
* Please search the archive at <a href="http://www.gromacs.org/Support/Mailing_Lists/GMX-developers_List" rel="noreferrer" target="_blank">http://www.gromacs.org/Support/Mailing_Lists/GMX-developers_List</a> before posting!<br>
<br>
* Can&#39;t post? Read <a href="http://www.gromacs.org/Support/Mailing_Lists" rel="noreferrer" target="_blank">http://www.gromacs.org/Support/Mailing_Lists</a><br>
<br>
* For (un)subscribe requests visit<br>
<a href="https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-developers" rel="noreferrer" target="_blank">https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-developers</a> or send a mail to <a href="mailto:gmx-developers-request@gromacs.org" target="_blank">gmx-developers-request@gromacs.org</a>.</blockquote></div></div>