Bug #1844

Build system does not respect GMX_EXTERNAL_BOOST=OFF

Added by Teemu Murtola over 4 years ago. Updated over 4 years ago.

build system
Target version:
Affected version - extra info:
Affected version:


At least on OS X, having boost installed in /opt/local/include (together with some other dependencies), setting GMX_EXTERNAL_BOOST=OFF still uses the external boost, even though gmx --version in the final version claims that internal boost was used (the version number is still from the external version).

I really cannot understand why this does not work, or whether this is the same on all platforms. The include directory for the internal boost is the first on the compiler command line, and uses -isystem.

Associated revisions

Revision 411d1811 (diff)
Added by Teemu Murtola over 4 years ago

Use include_directories(SYSTEM ...) consistently

Apparently, at least some compilers treat -isystem differently from -I
in that no matter what the order on the command line is, -I always takes
precedence. This means that some of the
include_directories(BEFORE SYSTEM ...)
did not work correctly, and in particular GMX_EXTERNAL_BOOST=OFF was
broken. Likely also #1539 was (again) broken.

Make all includes that come from outside the source tree use SYSTEM, so
that the include directory for internal boost still takes precedence
over them.

Fixes #1844.

Change-Id: Ib536c24a0d13c6538f78daac145dc8d38135819d


#1 Updated by Teemu Murtola over 4 years ago

  • Affected version changed from 5.x to 5.1

This seems to be caused by the use of -isystem instead of -I. -I takes precedence over -isystem, no matter what the include order is. Not sure whether there is some meaningful workaround, or what all compilers are affected. So it was broken by the last-minute merge of Idcdf3872b5a169e8690721bbe83922a4ab280da8 before 5.1, and so 5.1.x is affected.

#2 Updated by Teemu Murtola over 4 years ago

Probably the fix will be to use include_directories(SYSTEM ...) for everything that comes from outside our source tree.

#3 Updated by Teemu Murtola over 4 years ago

  • Status changed from New to Fix uploaded
  • Assignee set to Teemu Murtola
  • Target version set to 5.1.1

#4 Updated by Gerrit Code Review Bot over 4 years ago

Gerrit received a related patchset '1' for Issue #1844.
Uploader: Teemu Murtola ()
Change-Id: Ib536c24a0d13c6538f78daac145dc8d38135819d
Gerrit URL:

#5 Updated by Teemu Murtola over 4 years ago

  • Status changed from Fix uploaded to Resolved

#6 Updated by Mark Abraham over 4 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF