Skip to content

Commit 4a35214

Browse files
committed
HWLOC/Libevent: Handle non-pkg-config LIBS
Better handle setting the wrapper compiler LIBS for hwloc and libevent when they are co-built and pkg-config is not available. Previously, we would try to add the .la files to the wrapper compilers, which is probably not what we wanted. Signed-off-by: Brian Barrett <bbarrett@amazon.com>
1 parent afa7058 commit 4a35214

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

config/opal_config_hwloc.m4

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,10 @@ AC_DEFUN([OPAL_CONFIG_HWLOC], [
9292
[opal_hwloc_WRAPPER_LDFLAGS="$pkg_config_ldflags"
9393
opal_hwloc_WRAPPER_LIBS="$pkg_config_libs"],
9494
[# guess that what we have from compiling OMPI is good enough
95-
opal_hwloc_WRAPPER_LDFLAGS="$opal_hwloc_LDFLAGS"
96-
opal_hwloc_WRAPPER_LIBS="$opal_hwloc_LIBS"])
95+
AS_IF([test -z "$opal_hwloc_WRAPPER_LDFLAGS"],
96+
[opal_hwloc_WRAPPER_LDFLAGS="$opal_hwloc_LDFLAGS"])
97+
AS_IF([test -z "$opal_hwloc_WRAPPER_LIBS"],
98+
[opal_hwloc_WRAPPER_LIBS="$opal_hwloc_LIBS"])])
9799
98100
OPAL_WRAPPER_FLAGS_ADD([LDFLAGS], [$opal_hwloc_WRAPPER_LDFLAGS])
99101
OPAL_WRAPPER_FLAGS_ADD([LIBS], [$opal_hwloc_WRAPPER_LIBS])
@@ -199,6 +201,7 @@ AC_DEFUN([_OPAL_CONFIG_HWLOC_INTERNAL], [
199201
# our tree and in the mean time are referenced by their .la
200202
# files.
201203
opal_hwloc_LIBS="$OMPI_TOP_BUILDDIR/$internal_hwloc_location/hwloc/libhwloc.la"
204+
opal_hwloc_WRAPPER_LIBS="-lhwloc"
202205
203206
opal_hwloc_header="$OMPI_TOP_BUILDDIR/$internal_hwloc_location/include/hwloc.h"
204207

config/opal_config_libevent.m4

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,10 @@ AC_DEFUN([OPAL_CONFIG_LIBEVENT], [
103103
opal_libevent_WRAPPER_LIBS="$pkg_config_pthreads_libs"
104104
OPAL_FLAGS_APPEND_MOVE([opal_libevent_WRAPPER_LIBS], [$pkg_config_core_libs])],
105105
[# guess that what we have from compiling OMPI is good enough
106-
opal_libevent_WRAPPER_LDFLAGS="$opal_libevent_LDFLAGS"
107-
opal_libevent_WRAPPER_LIBS="$opal_libevent_LIBS"])
106+
AS_IF([test -z "$opal_libevent_WRAPPER_LDFLAGS"],
107+
[opal_libevent_WRAPPER_LDFLAGS="$opal_libevent_LDFLAGS"])
108+
AS_IF([test -z "$opal_libevent_WRAPPER_LIBS"],
109+
[opal_libevent_WRAPPER_LIBS="$opal_libevent_LIBS"])])
108110
109111
OPAL_WRAPPER_FLAGS_ADD([LDFLAGS], [$opal_libevent_WRAPPER_LDFLAGS])
110112
OPAL_WRAPPER_FLAGS_ADD([LIBS], [$opal_libevent_WRAPPER_LIBS])
@@ -239,6 +241,7 @@ AC_DEFUN([_OPAL_CONFIG_LIBEVENT_INTERNAL], [
239241
# our tree and in the mean time are referenced by their .la
240242
# files.
241243
opal_libevent_LIBS="$OMPI_TOP_BUILDDIR/$internal_libevent_location/libevent_core.la $OMPI_TOP_BUILDDIR/$internal_libevent_location/libevent_pthreads.la"
244+
opal_libevent_WRAPPER_LIBS="-levent_core -levent_pthreads"
242245
243246
opal_libevent_header="$OMPI_TOP_BUILDDIR/$internal_libevent_location/event.h"
244247

0 commit comments

Comments
 (0)