<div dir="ltr">Hi,<div><br></div><div>For a mainstream distro, I expect pkg-config and/or the buildbot toolchain to be set up to Just Work. Hopefully Dominik can look over what I will propose, to see if it looks suitable from his standpoint. We need a suitable find_package module (which we can contribute upstream), but otherwise we don't have to do and maintain the complex checking that we do for libxml2 and zlib now.</div><div><br></div><div>Mark</div></div><br><div class="gmail_quote"><div dir="ltr">On Thu, Feb 18, 2016 at 4:23 PM Szilárd Páll <<a href="mailto:pall.szilard@gmail.com">pall.szilard@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Thu, Feb 18, 2016 at 3:46 PM, Mark Abraham <<a href="mailto:mark.j.abraham@gmail.com" target="_blank">mark.j.abraham@gmail.com</a>> wrote:<br>
> Hi,<br>
><br>
> On Thu, Feb 18, 2016 at 3:28 PM Szilárd Páll <<a href="mailto:pall.szilard@gmail.com" target="_blank">pall.szilard@gmail.com</a>> wrote:<br>
>><br>
>> 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't there some symbols or exported<br>
>> functions only present when libxml2 is configured with zlib?<br>
><br>
><br>
> We could probably do that. If we adopt the tinyxml2 route, then I'd suggest<br>
> we leave such libxml2 management issues as TODOs for if/when we add other<br>
> code that requires functionality from libxml2.<br>
><br>
>> 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'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>
><br>
><br>
> If we don't end up needing libxml2 for anything else, then a bunch of code<br>
> that we apparently don't maintain well enough currently gets to disappear,<br>
> which is something.<br>
<br>
If you're referring tot he CMake code that's going to disappear,<br>
similar code (though perhaps more simple) will have to replace if we<br>
want to be distro-friendly.<br>
<br>
> Mark<br>
><br>
>> --<br>
>> Szilárd<br>
>><br>
>><br>
>> On Thu, Feb 18, 2016 at 2:39 PM, Mark Abraham <<a href="mailto:mark.j.abraham@gmail.com" target="_blank">mark.j.abraham@gmail.com</a>><br>
>> wrote:<br>
>> > Hi,<br>
>> ><br>
>> > Yes, perhaps that call to check_library_exists can be improved, e.g. by<br>
>> > setting CMAKE_REQUIRED_LIBRARIES for the check (see<br>
>> > <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>).<br>
>> > However,<br>
>> > it is awkward to do a good job here, because libxml2 only requires zlib<br>
>> > if<br>
>> > the former was configured that way, so we have a fairly large number of<br>
>> > conditions to handle in constructing our handling (shared/static,<br>
>> > whether<br>
>> > either was found, whether libxml2 needs zlib or not, whether test<br>
>> > binaries<br>
>> > need to be built, etc.).<br>
>> ><br>
>> > 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<br>
>> > if<br>
>> > it is related.<br>
>> ><br>
>> > Alternatively/also, since currently the only use for XML handling in<br>
>> > master<br>
>> > branch is for test reference data, I have uploaded<br>
>> > <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<br>
>> > a<br>
>> > bundled copy of tinyxml2, as part of<br>
>> > <a href="http://redmine.gromacs.org/issues/1908" rel="noreferrer" target="_blank">http://redmine.gromacs.org/issues/1908</a><br>
>> > so that we get rid of such problematic external dependencies. These have<br>
>> > been causing grief lately for users on BG/Q machines. I suggest we keep<br>
>> > libxml2 detection and handling present but inactive while the future of<br>
>> > various patches in Gerrit gets resolved.<br>
>> ><br>
>> > Mark<br>
>> ><br>
>> > On Wed, Feb 10, 2016 at 4:37 PM Szilárd Páll <<a href="mailto:pall.szilard@gmail.com" target="_blank">pall.szilard@gmail.com</a>><br>
>> > wrote:<br>
>> >><br>
>> >> Hi,<br>
>> >><br>
>> >> $ cmake -DGMX_PREFER_STATIC_LIBS=ON -DGMX_BUILD_UNITTESTS=ON<br>
>> >><br>
>> >> [...]<br>
>> >> -- Looking for zlibVersion in /usr/lib/x86_64-linux-gnu/libz.a<br>
>> >> -- Looking for zlibVersion in /usr/lib/x86_64-linux-gnu/libz.a - found<br>
>> >> -- Found LibXml2: /usr/lib/x86_64-linux-gnu/libxml2.a (found version<br>
>> >> "2.9.1")<br>
>> >> -- Looking for xmlTextWriterEndAttribute in<br>
>> >> /usr/lib/x86_64-linux-gnu/libxml2.a<br>
>> >> -- Looking for xmlTextWriterEndAttribute in<br>
>> >> /usr/lib/x86_64-linux-gnu/libxml2.a - not found<br>
>> >> [...]<br>
>> >> CMake Error at CMakeLists.txt:562 (message):<br>
>> >> Cannot build unit tests without libxml2. Either set<br>
>> >> GMX_BUILD_UNITTESTS=OFF or tell CMake how to find a working version<br>
>> >> of<br>
>> >> libxml2.<br>
>> >><br>
>> >> Even though both libz and libxml are detected, the<br>
>> >> xmlTextWriterEndAttribute lib test fails to link as the<br>
>> >> check_library_exists() does not pass -lz.<br>
>> >><br>
>> >> I vaguely remember some discussion around it so I thought I'd ask<br>
>> >> whether this is a known issue before filing a report.<br>
>> >><br>
>> >> Are there any simple workarounds for this? (I tried passing -lz in the<br>
>> >> linker flags, but that does not help).<br>
>> >> Could we provide a better hint in the error?<br>
>> >><br>
>> >> Cheers,<br>
>> >> --<br>
>> >> Szilárd<br>
>> >> --<br>
>> >> Gromacs Developers mailing list<br>
>> >><br>
>> >> * Please search the archive at<br>
>> >> <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>
>> >> posting!<br>
>> >><br>
>> >> * Can'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><br>
>> >> or<br>
>> >> send a mail to <a href="mailto:gmx-developers-request@gromacs.org" target="_blank">gmx-developers-request@gromacs.org</a>.<br>
>> ><br>
>> ><br>
>> > --<br>
>> > Gromacs Developers mailing list<br>
>> ><br>
>> > * Please search the archive at<br>
>> > <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>
>> > posting!<br>
>> ><br>
>> > * Can'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><br>
>> > or<br>
>> > 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<br>
>> <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>
>> posting!<br>
>><br>
>> * Can'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<br>
>> send a mail to <a href="mailto:gmx-developers-request@gromacs.org" target="_blank">gmx-developers-request@gromacs.org</a>.<br>
><br>
><br>
> --<br>
> Gromacs Developers mailing list<br>
><br>
> * Please search the archive at<br>
> <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>
> posting!<br>
><br>
> * Can'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<br>
> 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'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>