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