--enable-all-static configure flag breaks examples
Issue #44
new
configuring with --enable-all-static puts -all-static into LDFLAGS. This is fine for building the MOAB libraries with libtool, but when used to build applications, as in the examples directory, it causes an error.
dnl Before configuring libtool check for --enable-all-static option
AC_ARG_ENABLE(all-static,
AS_HELP_STRING([--enable-all-static],
[Build completely static (standalone) binaries.]),
[
if ( test "x$enable_static" != "xno" ); then
if ( test "$enableval" = "yes" ); then
LDFLAGS="-all-static $LDFLAGS"
fi
else
AC_MSG_WARN([ Static linking disabled. Ignoring --enable-all-static option. Please add --enable-static also. ])
fi
])
Comments (2)
-
-
--all-static
is not on by default. Yes this will cause issues when dependencies don't have a static version of the library available in the system. And so I think the behavior is expected.As Iulian mentions, we introduced this specifically for BG/Q where adding this configure option was necessary to force the compilers to pick only the static libraries during linking.
- Log in to comment
I think that -all-static is supported fully on gnu compilers. Even on gnu compilers, its use can give errors, if we use it on different platforms than the dependent libraries were built.
Case in point: most moab dependencies were built on gnep, ubuntu 12 at the time. Using --enable-all-static on compute001, an ubuntu 14 machine, will prevent correct linking, with errors like
We added this option for BG/Q, but I think it should be disabled for other platforms. It will try to link statically everything.