Project

General

Profile

Feature #1956

Add support for building against external tinyxml2

Added by Dominik Mierzejewski over 3 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
build system
Target version:
Difficulty:
uncategorized
Close

Description

libxml2 support was removed in favour of bundled tinyxml2 (3.0.0), but there's no support for building against a system version of the tinyxml2 library. Please add it.

Associated revisions

Revision 013ca6eb (diff)
Added by Mark Abraham over 3 years ago

Re-add support for linking against external TinyXML-2

I always intended this support, to permit convenient packaging of
GROMACS by distributions, but it got lost from gerrit while rebasing
from patch set 4 to 5 of I6153136.

Fixes #1956

Change-Id: Ie76dc9e8c6116814439d813d5a9555c5bfb7bfc5

History

#1 Updated by Gerrit Code Review Bot over 3 years ago

Gerrit received a related patchset '1' for Issue #1956.
Uploader: Mark Abraham ()
Change-Id: Ie76dc9e8c6116814439d813d5a9555c5bfb7bfc5
Gerrit URL: https://gerrit.gromacs.org/5862

#2 Updated by Mark Abraham over 3 years ago

  • Status changed from New to Fix uploaded
  • Assignee set to Mark Abraham
  • Target version set to 2016

Sorry, I always intended to have this support, but it got lost in a rebase and forgotten in getting TinyXML-2 support sufficiently functional.

#3 Updated by Mark Abraham over 3 years ago

Dominik can you verify whether https://gerrit.gromacs.org/#/c/5862/ is a suitable approach for you, please?

#4 Updated by Dominik Mierzejewski over 3 years ago

Thanks for your quick response, Mark. Yes, that approach is basically what I need for Fedora. However, the current patch fails to find system tinyxml2. If I remove the QUIET flags, I get this output:

-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1") 
-- Checking for module 'tinyxml2'
--   Found tinyxml2, version 3.0.0
-- Could NOT find TinyXML2 (missing:  TinyXML2_INCLUDE_DIR TinyXML2_LINKS_OK) 

So it looks like it finds the library just fine, but doesn't set the include dir variable.
The library is in /usr/lib(64) and the headers are in /usr/include. Any idea? I'm not very well versed in cmake.

Edit: it works if I add -DTinyXML2_INCLUDE_DIR=/usr/include to cmake call.

Edit2: still fails to compile:

[...]
[ 87%] Building CXX object src/testutils/CMakeFiles/testutils.dir/refdata-xml.cpp.o
cd /builddir/build/BUILD/gromacs-d44d7d6bebdb7fa52090b744854d49f34099e044/openmpi/src/testutils && /usr/bin/c++   -DGMX_DOUBLE=0 -DHAVE_CONFIG_H -isystem /builddir/build/BUILD/gromacs-d44d7d6bebdb7fa52090b744854d49f34099e044/src/external/gmock-1.7.0/gtest/include -isystem /builddir/build/BUILD/gromacs-d44d7d6bebdb7fa52090b744854d49f34099e044/src/external/gmock-1.7.0/include -I/builddir/build/BUILD/gromacs-d44d7d6bebdb7fa52090b744854d49f34099e044/openmpi/src -I/builddir/build/BUILD/gromacs-d44d7d6bebdb7fa52090b744854d49f34099e044/src/external/thread_mpi/include -I/builddir/build/BUILD/gromacs-d44d7d6bebdb7fa52090b744854d49f34099e044/src -isystem /usr/include/openmpi-x86_64  -msse2   -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic  -std=c++0x  -Wundef -Wextra -Wno-missing-field-initializers -Wpointer-arith -Wall -Wno-unused-function  -DNDEBUG -funroll-all-loops -fexcess-precision=fast  -Wno-array-bounds     -Wno-comment -Wno-unused-variable -fno-delete-null-pointer-checks -o CMakeFiles/testutils.dir/refdata-xml.cpp.o -c /builddir/build/BUILD/gromacs-d44d7d6bebdb7fa52090b744854d49f34099e044/src/testutils/refdata-xml.cpp
/builddir/build/BUILD/gromacs-d44d7d6bebdb7fa52090b744854d49f34099e044/src/testutils/refdata-xml.cpp:47:40: fatal error: external/tinyxml2/tinyxml2.h: No such file or directory
 #include "external/tinyxml2/tinyxml2.h" 
                                        ^
compilation terminated.
src/testutils/CMakeFiles/testutils.dir/build.make:185: recipe for target 'src/testutils/CMakeFiles/testutils.dir/refdata-xml.cpp.o' failed
[...]

#5 Updated by Mark Abraham over 3 years ago

Thanks Dominik, my first effort was a bit hasty. I've updated the patch to fix these issues. Can you try again?

If we've got the principle established, then doing something similar for lmfit becomes easier.

#6 Updated by Dominik Mierzejewski over 3 years ago

Patch aaf0fed5dccb53333ff2706be608be9c327707ea works fine with system tinyxml2-3.0.0 just fine, thank you!

#7 Updated by Mark Abraham over 3 years ago

  • Status changed from Fix uploaded to Resolved

#8 Updated by Mark Abraham over 3 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF