Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hwloc xen topology v5 #3

Open
wants to merge 3 commits into
base: x86-common-for-xen
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ test-suite.log

/src/static-components.h
/src/*.lo
/src/libhwloc.la
/src/*.la
/src/libltdl/

/tests/wrapper.sh
Expand Down
31 changes: 31 additions & 0 deletions config/hwloc.m4
Original file line number Diff line number Diff line change
Expand Up @@ -914,6 +914,31 @@ EOF])
fi
# don't add LIBS/CFLAGS/REQUIRES yet, depends on plugins

# Xen support
hwloc_xen_happy=no
if test "x$enable_xen" != "xno"; then
hwloc_xen_happy=yes
AC_CHECK_HEADERS([xenctrl.h], [
AC_CHECK_LIB([xenctrl], [xc_topologyinfo_bounced], [HWLOC_XEN_LIBS="-lxenctrl"], [hwloc_xen_happy=no])
], [hwloc_xen_happy=no])
fi
AC_SUBST(HWLOC_XEN_LIBS)
# If we asked for xen support but couldn't deliver, fail
AS_IF([test "$enable_xen" = "yes" -a "$hwloc_xen_happy" = "no"],
[AC_MSG_WARN([Specified --enable-xen switch, but could not])
AC_MSG_WARN([find appropriate support])
AC_MSG_ERROR([Cannot continue])])
if test "x$hwloc_xen_happy" = "xyes"; then
AC_DEFINE([HWLOC_HAVE_XEN], [1], [Define to 1 if you have the `XEN' library.])
AC_SUBST([HWLOC_HAVE_XEN], [1])
hwloc_components="$hwloc_components xen"
hwloc_xen_component_maybeplugin=1
hwloc_xen=yes
else
AC_SUBST([HWLOC_HAVE_XEN], [0])
fi
# don't add LIBS/CFLAGS/REQUIRES yet, depends on plugins

# X11 support
AC_PATH_XTRA

Expand Down Expand Up @@ -1142,6 +1167,10 @@ EOF])
[HWLOC_LIBS="$HWLOC_LIBS $HWLOC_GL_LIBS"
HWLOC_CFLAGS="$HWLOC_CFLAGS $HWLOC_GL_CFLAGS"
HWLOC_REQUIRES="$HWLOC_GL_REQUIRES $HWLOC_REQUIRES"])
AS_IF([test "$hwloc_xen_component" = "static"],
[HWLOC_LIBS="$HWLOC_LIBS $HWLOC_XEN_LIBS"
HWLOC_CFLAGS="$HWLOC_CFLAGS $HWLOC_XEN_CFLAGS"
HWLOC_REQUIRES="$HWLOC_XEN_REQUIRES $HWLOC_REQUIRES"])
AS_IF([test "$hwloc_xml_libxml_component" = "static"],
[HWLOC_LIBS="$HWLOC_LIBS $HWLOC_LIBXML2_LIBS"
HWLOC_CFLAGS="$HWLOC_CFLAGS $HWLOC_LIBXML2_CFLAGS"
Expand Down Expand Up @@ -1257,13 +1286,15 @@ AC_DEFUN([HWLOC_DO_AM_CONDITIONALS],[
AM_CONDITIONAL([HWLOC_HAVE_X86_32], [test "x$hwloc_x86_32" = "xyes"])
AM_CONDITIONAL([HWLOC_HAVE_X86_64], [test "x$hwloc_x86_64" = "xyes"])
AM_CONDITIONAL([HWLOC_HAVE_X86_CPUID], [test "x$hwloc_have_x86_cpuid" = "xyes"])
AM_CONDITIONAL([HWLOC_HAVE_XEN], [test "x$hwloc_xen" = "xyes"])

AM_CONDITIONAL([HWLOC_HAVE_PLUGINS], [test "x$hwloc_have_plugins" = "xyes"])
AM_CONDITIONAL([HWLOC_PCI_BUILD_STATIC], [test "x$hwloc_pci_component" = "xstatic"])
AM_CONDITIONAL([HWLOC_OPENCL_BUILD_STATIC], [test "x$hwloc_opencl_component" = "xstatic"])
AM_CONDITIONAL([HWLOC_CUDA_BUILD_STATIC], [test "x$hwloc_cuda_component" = "xstatic"])
AM_CONDITIONAL([HWLOC_NVML_BUILD_STATIC], [test "x$hwloc_nvml_component" = "xstatic"])
AM_CONDITIONAL([HWLOC_GL_BUILD_STATIC], [test "x$hwloc_gl_component" = "xstatic"])
AM_CONDITIONAL([HWLOC_XEN_BUILD_STATIC], [test "x$hwloc_xen_component" = "xstatic"])
AM_CONDITIONAL([HWLOC_XML_LIBXML_BUILD_STATIC], [test "x$hwloc_xml_libxml_component" = "xstatic"])

AM_CONDITIONAL([HWLOC_HAVE_CXX], [test "x$hwloc_have_cxx" = "xyes"])
Expand Down
6 changes: 6 additions & 0 deletions config/hwloc_internal.m4
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ AC_DEFUN([HWLOC_DEFINE_ARGS],[
AS_HELP_STRING([--disable-nvml],
[Disable the NVML device discovery]))

# Xen?
AC_ARG_ENABLE([xen],
AS_HELP_STRING([--disable-xen],
[Disable Xen system discovery from dom0]))

# GL/Display
AC_ARG_ENABLE([gl],
AS_HELP_STRING([--disable-gl],
Expand Down Expand Up @@ -417,6 +422,7 @@ int foo(void) {
hwloc_config_prefix[tests/ports/topology-netbsd.c]:hwloc_config_prefix[src/topology-netbsd.c]
hwloc_config_prefix[tests/ports/topology-hpux.c]:hwloc_config_prefix[src/topology-hpux.c]
hwloc_config_prefix[tests/ports/topology-bgq.c]:hwloc_config_prefix[src/topology-bgq.c]
hwloc_config_prefix[tests/ports/topology-xen.c]:hwloc_config_prefix[src/topology-xen.c]
hwloc_config_prefix[tests/ports/topology-opencl.c]:hwloc_config_prefix[src/topology-opencl.c]
hwloc_config_prefix[tests/ports/topology-cuda.c]:hwloc_config_prefix[src/topology-cuda.c]
hwloc_config_prefix[tests/ports/topology-nvml.c]:hwloc_config_prefix[src/topology-nvml.c]
Expand Down
11 changes: 11 additions & 0 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,17 @@ if HWLOC_HAVE_X86_CPUID
sources += topology-x86.c
endif HWLOC_HAVE_X86_CPUID

if HWLOC_HAVE_XEN
if HWLOC_XEN_BUILD_STATIC
sources += topology-xen.c
else
plugins_LTLIBRARIES += hwloc_xen.la
hwloc_xen_la_SOURCES = topology-xen.c
hwloc_xen_la_CFLAGS = $(AM_CFLAGS) $(HWLOC_XEN_CFLAGS) -DHWLOC_INSIDE_PLUGIN
hwloc_xen_la_LDFLAGS = $(plugins_ldflags) $(HWLOC_XEN_LIBS)
endif
endif HWLOC_HAVE_XEN

if HWLOC_HAVE_GCC
ldflags += -no-undefined
endif HWLOC_HAVE_GCC
Expand Down
Loading