You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by so...@apache.org on 2016/09/27 19:37:54 UTC
[trafficserver] branch make_hwloc_required created (now 08dc491)
This is an automated email from the ASF dual-hosted git repository.
sorber pushed a change to branch make_hwloc_required
in repository https://git-dual.apache.org/repos/asf/trafficserver.git.
at 08dc491 Checkpoint
This branch includes the following new commits:
new ec0d7b6 TS-4821: Make hwloc a required dependency
new 2cc9fbd TS-4821: Accept alternate location for hwloc
new 08dc491 Checkpoint
The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "adds" were already present in the repository and have only
been added to this reference.
--
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>'].
[trafficserver] 01/03: TS-4821: Make hwloc a required dependency
Posted by so...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
sorber pushed a commit to branch make_hwloc_required
in repository https://git-dual.apache.org/repos/asf/trafficserver.git
commit ec0d7b6a196385a4669469d1fa18059179b01e0a
Author: Phil Sorber <so...@apache.org>
AuthorDate: Wed Sep 7 11:15:59 2016 -0600
TS-4821: Make hwloc a required dependency
---
cmd/traffic_layout/traffic_layout.cc | 1 -
configure.ac | 66 +++++++++++---------------------
iocore/aio/AIO.cc | 2 -
iocore/eventsystem/UnixEventProcessor.cc | 10 -----
lib/ts/ink_config.h.in | 1 -
lib/ts/ink_defs.cc | 16 --------
lib/ts/ink_defs.h | 4 --
7 files changed, 22 insertions(+), 78 deletions(-)
diff --git a/cmd/traffic_layout/traffic_layout.cc b/cmd/traffic_layout/traffic_layout.cc
index ce5ed22..87e01fe 100644
--- a/cmd/traffic_layout/traffic_layout.cc
+++ b/cmd/traffic_layout/traffic_layout.cc
@@ -93,7 +93,6 @@ produce_features(bool json)
print_feature("TS_USE_TPROXY", TS_USE_TPROXY, json);
print_feature("TS_HAS_SO_MARK", TS_HAS_SO_MARK, json);
print_feature("TS_HAS_IP_TOS", TS_HAS_IP_TOS, json);
- print_feature("TS_USE_HWLOC", TS_USE_HWLOC, json);
print_feature("TS_USE_TLS_NPN", TS_USE_TLS_NPN, json);
print_feature("TS_USE_TLS_ALPN", TS_USE_TLS_ALPN, json);
print_feature("TS_USE_TLS_SNI", TS_USE_TLS_SNI, json);
diff --git a/configure.ac b/configure.ac
index 0ad92be..701c3f0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -289,17 +289,6 @@ AC_ARG_ENABLE([posix-cap],
AC_MSG_RESULT([$enable_posix_cap])
#
-# use hwloc library when possible (can be disabled)
-#
-AC_MSG_CHECKING([whether to use hwloc library])
-AC_ARG_ENABLE([hwloc],
- [AS_HELP_STRING([--disable-hwloc],[Don't use the hwloc library])],
- [],
- [enable_hwloc="yes"]
-)
-AC_MSG_RESULT([$enable_hwloc])
-
-#
# Enble ccache explicitly (it's disabled by default, because of build problems in some cases)
#
AC_MSG_CHECKING([whether to enable ccache])
@@ -1322,43 +1311,32 @@ AC_MSG_RESULT([$enable_linux_native_aio])
TS_ARG_ENABLE_VAR([use], [linux_native_aio])
# Check for hwloc library.
-# If we don't find it, disable checking for header.
-use_hwloc=0
-AS_IF([test "x$enable_hwloc" = "xyes"], [
- # Use pkg-config, because some distros (*cough* Ubuntu) put hwloc in unusual places.
- PKG_CHECK_MODULES([HWLOC], [hwloc], [
- SAVE_LIBS="$LIBS"
- LIBS="-lhwloc"
- AC_LANG_PUSH([C++])
- AC_MSG_CHECKING([for hwloc C++ linking])
- AC_LINK_IFELSE([
- AC_LANG_PROGRAM([#include <hwloc.h>],[hwloc_topology_t t; hwloc_topology_init(&t); hwloc_get_type_depth(t, HWLOC_OBJ_SOCKET);])],[
- use_hwloc=1
- AC_SUBST([HWLOC_CFLAGS])
- AC_SUBST([HWLOC_LIBS])
- AC_MSG_RESULT([yes])
- # Old versions of libhwloc don't have HWLOC_OBJ_PU.
- AC_CHECK_DECL(HWLOC_OBJ_PU,
- [AC_DEFINE(HAVE_HWLOC_OBJ_PU, 1, [Whether HWLOC_OBJ_PU is available])], [],
- [#include <hwloc.h>]
- )
- ], [
- AC_MSG_RESULT([no])
- AC_MSG_WARN([hwloc not linkable, try --disable-hwloc])
- AC_SUBST([HWLOC_CFLAGS],[""])
- AC_SUBST([HWLOC_LIBS],[""])
- ])
- AC_LANG_POP()
- LIBS="$SAVE_LIBS"
+# Use pkg-config, because some distros (*cough* Ubuntu) put hwloc in unusual places.
+PKG_CHECK_MODULES([HWLOC], [hwloc], [
+ SAVE_LIBS="$LIBS"
+ LIBS="-lhwloc"
+ AC_LANG_PUSH([C++])
+ AC_MSG_CHECKING([for hwloc C++ linking])
+ AC_LINK_IFELSE([
+ AC_LANG_PROGRAM([#include <hwloc.h>],[hwloc_topology_t t; hwloc_topology_init(&t); hwloc_get_type_depth(t, HWLOC_OBJ_SOCKET);])],[
+ AC_SUBST([HWLOC_CFLAGS])
+ AC_SUBST([HWLOC_LIBS])
+ AC_MSG_RESULT([yes])
+ # Old versions of libhwloc don't have HWLOC_OBJ_PU.
+ AC_CHECK_DECL(HWLOC_OBJ_PU,
+ [AC_DEFINE(HAVE_HWLOC_OBJ_PU, 1, [Whether HWLOC_OBJ_PU is available])], [],
+ [#include <hwloc.h>]
+ )
], [
- AC_MSG_WARN([hwloc not found, try --disable-hwloc])
- AC_SUBST([HWLOC_CFLAGS],[""])
- AC_SUBST([HWLOC_LIBS],[""])
+ AC_MSG_RESULT([no])
+ AC_MSG_ERROR([hwloc not linkable])
])
+ AC_LANG_POP()
+ LIBS="$SAVE_LIBS"
+], [
+ AC_MSG_ERROR([hwloc not found])
])
-AC_SUBST(use_hwloc)
-
#
# Check for Maxmind APIs / includes. TODO: Long term, it might make sense to support
# GeoIP as a "helper" plugin, which other plugins can then use. Such a plugin could
diff --git a/iocore/aio/AIO.cc b/iocore/aio/AIO.cc
index 2404b8f..e41c456 100644
--- a/iocore/aio/AIO.cc
+++ b/iocore/aio/AIO.cc
@@ -189,10 +189,8 @@ struct AIOThreadInfo : public Continuation {
{
(void)event;
(void)e;
-#if TS_USE_HWLOC
hwloc_set_membind_nodeset(ink_get_topology(), hwloc_topology_get_topology_nodeset(ink_get_topology()), HWLOC_MEMBIND_INTERLEAVE,
HWLOC_MEMBIND_THREAD);
-#endif
aio_thread_main(this);
delete this;
return EVENT_DONE;
diff --git a/iocore/eventsystem/UnixEventProcessor.cc b/iocore/eventsystem/UnixEventProcessor.cc
index 49476e4..b9cd595 100644
--- a/iocore/eventsystem/UnixEventProcessor.cc
+++ b/iocore/eventsystem/UnixEventProcessor.cc
@@ -23,12 +23,10 @@
#include "P_EventSystem.h" /* MAGIC_EDITING_TAG */
#include <sched.h>
-#if TS_USE_HWLOC
#if HAVE_ALLOCA_H
#include <alloca.h>
#endif
#include <hwloc.h>
-#endif
#include "ts/ink_defs.h"
#include "ts/hugepages.h"
@@ -162,7 +160,6 @@ EventProcessor::start(int n_event_threads, size_t stacksize)
}
n_threads_for_type[ET_CALL] = n_event_threads;
-#if TS_USE_HWLOC
int affinity = 1;
REC_ReadConfigInteger(affinity, "proxy.config.exec_thread.affinity");
hwloc_obj_t obj;
@@ -201,11 +198,8 @@ EventProcessor::start(int n_event_threads, size_t stacksize)
obj_count = hwloc_get_nbobjs_by_type(ink_get_topology(), obj_type);
Debug("iocore_thread", "Affinity: %d %ss: %d PU: %d", affinity, obj_name, obj_count, ink_number_of_processors());
-#endif
for (i = 0; i < n_ethreads; i++) {
ink_thread tid;
-
-#if TS_USE_HWLOC
if (obj_count > 0) {
// Get our `obj` instance with index based on the thread number we are on.
obj = hwloc_get_obj_by_type(ink_get_topology(), obj_type, i % obj_count);
@@ -247,10 +241,6 @@ EventProcessor::start(int n_event_threads, size_t stacksize)
} else {
Warning("hwloc returned an unexpected value -- CPU affinity disabled");
}
-#else
- // Lets ignore tid if we don't link with HWLOC
- (void)tid;
-#endif // TS_USE_HWLOC
}
Debug("iocore_thread", "Created event thread group id %d with %d threads", ET_CALL, n_event_threads);
diff --git a/lib/ts/ink_config.h.in b/lib/ts/ink_config.h.in
index 9e93687..8248eff 100644
--- a/lib/ts/ink_config.h.in
+++ b/lib/ts/ink_config.h.in
@@ -69,7 +69,6 @@
#define TS_USE_TPROXY @use_tproxy@
#define TS_HAS_SO_MARK @has_so_mark@
#define TS_HAS_IP_TOS @has_ip_tos@
-#define TS_USE_HWLOC @use_hwloc@
#define TS_USE_TLS_NPN @use_tls_npn@
#define TS_USE_TLS_ALPN @use_tls_alpn@
#define TS_USE_TLS_SNI @use_tls_sni@
diff --git a/lib/ts/ink_defs.cc b/lib/ts/ink_defs.cc
index 712df08..449d6e0 100644
--- a/lib/ts/ink_defs.cc
+++ b/lib/ts/ink_defs.cc
@@ -42,8 +42,6 @@
int off = 0;
int on = 1;
-#if TS_USE_HWLOC
-
#include <hwloc.h>
// Little helper to initialize the hwloc topology, once.
@@ -66,8 +64,6 @@ ink_get_topology()
return topology;
}
-#endif
-
int
ink_sys_name_release(char *name, int namelen, char *release, int releaselen)
{
@@ -118,23 +114,11 @@ ink_sys_name_release(char *name, int namelen, char *release, int releaselen)
int
ink_number_of_processors()
{
-#if TS_USE_HWLOC
#if HAVE_HWLOC_OBJ_PU
return hwloc_get_nbobjs_by_type(ink_get_topology(), HWLOC_OBJ_PU);
#else
return hwloc_get_nbobjs_by_type(ink_get_topology(), HWLOC_OBJ_CORE);
#endif
-#elif defined(freebsd)
- int mib[2], n;
- mib[0] = CTL_HW;
- mib[1] = HW_NCPU;
- size_t len = sizeof(n);
- if (sysctl(mib, 2, &n, &len, NULL, 0) == -1)
- return 1;
- return n;
-#else
- return sysconf(_SC_NPROCESSORS_ONLN); // number of processing units (includes Hyper Threading)
-#endif
}
int
diff --git a/lib/ts/ink_defs.h b/lib/ts/ink_defs.h
index 46cd6b5..5f700f4 100644
--- a/lib/ts/ink_defs.h
+++ b/lib/ts/ink_defs.h
@@ -133,9 +133,7 @@ max(const T a, const T b)
#define unlikely(x) __builtin_expect(!!(x), 0)
#endif
-#if TS_USE_HWLOC
#include <hwloc.h>
-#endif
#ifndef ROUNDUP
#define ROUNDUP(x, y) ((((x) + ((y)-1)) / (y)) * (y))
@@ -159,10 +157,8 @@ int ink_sys_name_release(char *name, int namelen, char *release, int releaselen)
int ink_number_of_processors();
int ink_login_name_max();
-#if TS_USE_HWLOC
// Get the hardware topology
hwloc_topology_t ink_get_topology();
-#endif
/** Constants.
*/
--
To stop receiving notification emails like this one, please contact
"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>.
[trafficserver] 03/03: Checkpoint
Posted by so...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
sorber pushed a commit to branch make_hwloc_required
in repository https://git-dual.apache.org/repos/asf/trafficserver.git
commit 08dc4910f329b8003ff4d4f1f1e130232723f0d2
Author: Phil Sorber <so...@apache.org>
AuthorDate: Thu Sep 8 13:19:14 2016 -0600
Checkpoint
---
build/hwloc.m4 | 127 ++++++++++++++++++++++++++++-----------------------------
1 file changed, 62 insertions(+), 65 deletions(-)
diff --git a/build/hwloc.m4 b/build/hwloc.m4
index 323f6e6..f788d60 100644
--- a/build/hwloc.m4
+++ b/build/hwloc.m4
@@ -22,84 +22,81 @@ dnl
dnl TS_CHECK_HWLOC: look for hwloc libraries and headers
dnl
AC_DEFUN([TS_CHECK_HWLOC], [
-hwloc_path_provided=no
-AC_ARG_WITH(hwloc, [AC_HELP_STRING([--with-hwloc=DIR],[use a specific hwloc library])],
-[
- if test "x$withval" != "xyes" && test "x$withval" != "x"; then
- hwloc_base_dir="$withval"
- if test "$withval" != "no"; then
- hwloc_path_provided=yes
- case "$withval" in
- *":"*)
- hwloc_include="`echo $withval |sed -e 's/:.*$//'`"
- hwloc_ldflags="`echo $withval |sed -e 's/^.*://'`"
- AC_MSG_CHECKING(checking for hwloc includes in $hwloc_include libs in $hwloc_ldflags )
- ;;
- *)
- hwloc_include="$withval/include"
- hwloc_ldflags="$withval/lib"
- AC_MSG_CHECKING(checking for hwloc includes in $withval)
- ;;
- esac
+ hwloc_path_provided=no
+ AC_ARG_WITH(hwloc, [AC_HELP_STRING([--with-hwloc=DIR],[use a specific hwloc library])],
+ [
+ if test "x$withval" != "xyes" && test "x$withval" != "x"; then
+ hwloc_base_dir="$withval"
+ if test "$withval" != "no"; then
+ hwloc_path_provided=yes
+ case "$withval" in
+ *":"*)
+ hwloc_include="`echo $withval |sed -e 's/:.*$//'`"
+ hwloc_ldflags="`echo $withval |sed -e 's/^.*://'`"
+ AC_MSG_CHECKING(checking for hwloc includes in $hwloc_include libs in $hwloc_ldflags )
+ ;;
+ *)
+ hwloc_include="$withval/include"
+ hwloc_ldflags="$withval/lib"
+ AC_MSG_CHECKING(checking for hwloc includes in $withval)
+ ;;
+ esac
+ fi
+ fi
+ ])
+
+ if test "x$hwloc_path_provided" = "xno"; then
+ # Use pkg-config, because some distros (*cough* Ubuntu) put hwloc in unusual places.
+ PKG_CHECK_MODULES([HWLOC], [hwloc], [], [
+ AC_SUBST([HWLOC_CFLAGS],[""])
+ AC_SUBST([HWLOC_LIBS],[""])
+ AC_MSG_RESULT([no])
+ $2
+ ])
+ else
+ if test -d $hwloc_include && test -d $hwloc_ldflags && test -f $hwloc_include/hwloc.h; then
+ saved_ldflags=$LDFLAGS
+ saved_cppflags=$CPPFLAGS
+ hwloc_have_headers=0
+ hwloc_have_libs=0
+ if test "$hwloc_base_dir" != "/usr"; then
+ TS_ADDTO(CPPFLAGS, [-I${hwloc_include}])
+ TS_ADDTO(LDFLAGS, [-L${hwloc_ldflags}])
+ TS_ADDTO_RPATH(${hwloc_ldflags})
+ fi
fi
fi
-])
-if test "x$hwloc_path_provided" = "xno"; then
- # Use pkg-config, because some distros (*cough* Ubuntu) put hwloc in unusual places.
- PKG_CHECK_MODULES([HWLOC], [hwloc], [
- SAVE_LIBS="$LIBS"
- LIBS="-lhwloc"
- AC_LANG_PUSH([C++])
- AC_MSG_CHECKING([for hwloc C++ linking])
- AC_LINK_IFELSE([
- AC_LANG_PROGRAM([#include <hwloc.h>],[hwloc_topology_t t; hwloc_topology_init(&t); hwloc_get_type_depth(t, HWLOC_OBJ_SOCKET);])],[
+ SAVE_LIBS="$LIBS"
+ LIBS="-lhwloc"
+ AC_LANG_PUSH([C++])
+ AC_CHECK_LIBS([hwloc], [hwloc_topology_init], [
+ AC_CHECK_HEADERS(hwloc.h, [
AC_SUBST([HWLOC_CFLAGS])
AC_SUBST([HWLOC_LIBS])
AC_MSG_RESULT([yes])
+ $1
# Old versions of libhwloc don't have HWLOC_OBJ_PU.
AC_CHECK_DECL(HWLOC_OBJ_PU,
[AC_DEFINE(HAVE_HWLOC_OBJ_PU, 1, [Whether HWLOC_OBJ_PU is available])], [],
[#include <hwloc.h>]
)
], [
+ CPPFLAGS=$saved_cppflags
+ LDFLAGS=$saved_ldflags
+ AC_SUBST([HWLOC_CFLAGS],[""])
+ AC_SUBST([HWLOC_LIBS],[""])
AC_MSG_RESULT([no])
- AC_MSG_ERROR([hwloc not linkable])
+ $2
])
- AC_LANG_POP()
- LIBS="$SAVE_LIBS"
], [
- AC_MSG_ERROR([hwloc not found])
- ])
-else
- if test -d $hwloc_include && test -d $hwloc_ldflags && test -f $hwloc_include/hwloc.h; then
- saved_ldflags=$LDFLAGS
- saved_cppflags=$CPPFLAGS
- hwloc_have_headers=0
- hwloc_have_libs=0
- if test "$hwloc_base_dir" != "/usr"; then
- TS_ADDTO(CPPFLAGS, [-I${hwloc_include}])
- TS_ADDTO(LDFLAGS, [-L${hwloc_ldflags}])
- TS_ADDTO_RPATH(${hwloc_ldflags})
- fi
- AC_SEARCH_LIBS([hwloc_code], [hwloc], [hwloc_have_libs=1])
- if test "$hwloc_have_libs" != "0"; then
- AC_CHECK_HEADERS(hwloc.h, [hwloc_have_headers=1])
- fi
- if test "$hwloc_have_headers" != "0"; then
- AC_SUBST(HWLOC_LIBS, [-lhwloc])
- AC_CHECK_DECL(HWLOC_OBJ_PU,
- [AC_DEFINE(HAVE_HWLOC_OBJ_PU, 1, [Whether HWLOC_OBJ_PU is available])], [],
- [#include <hwloc.h>]
- )
- else
- AC_MSG_ERROR([hwloc not found])
- CPPFLAGS=$saved_cppflags
- LDFLAGS=$saved_ldflags
- fi
- AC_MSG_RESULT([ok])
- else
- AC_MSG_ERROR([hwloc not found])
- fi
-fi
+ CPPFLAGS=$saved_cppflags
+ LDFLAGS=$saved_ldflags
+ AC_SUBST([HWLOC_CFLAGS],[""])
+ AC_SUBST([HWLOC_LIBS],[""])
+ AC_MSG_RESULT([no])
+ $2
+ ],[])
+ AC_LANG_POP()
+ LIBS="$SAVE_LIBS"
])
--
To stop receiving notification emails like this one, please contact
"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>.
[trafficserver] 02/03: TS-4821: Accept alternate location for hwloc
Posted by so...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
sorber pushed a commit to branch make_hwloc_required
in repository https://git-dual.apache.org/repos/asf/trafficserver.git
commit 2cc9fbdac384ea2627dbf18982686f35c9e7ce0e
Author: Phil Sorber <so...@apache.org>
AuthorDate: Wed Sep 7 13:59:04 2016 -0600
TS-4821: Accept alternate location for hwloc
---
build/hwloc.m4 | 105 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
configure.ac | 30 ++---------------
2 files changed, 108 insertions(+), 27 deletions(-)
diff --git a/build/hwloc.m4 b/build/hwloc.m4
new file mode 100644
index 0000000..323f6e6
--- /dev/null
+++ b/build/hwloc.m4
@@ -0,0 +1,105 @@
+dnl -------------------------------------------------------- -*- autoconf -*-
+dnl Licensed to the Apache Software Foundation (ASF) under one or more
+dnl contributor license agreements. See the NOTICE file distributed with
+dnl this work for additional information regarding copyright ownership.
+dnl The ASF licenses this file to You under the Apache License, Version 2.0
+dnl (the "License"); you may not use this file except in compliance with
+dnl the License. You may obtain a copy of the License at
+dnl
+dnl http://www.apache.org/licenses/LICENSE-2.0
+dnl
+dnl Unless required by applicable law or agreed to in writing, software
+dnl distributed under the License is distributed on an "AS IS" BASIS,
+dnl WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+dnl See the License for the specific language governing permissions and
+dnl limitations under the License.
+
+dnl
+dnl hwloc.m4: Trafficserver's hwloc autoconf macros
+dnl
+
+dnl
+dnl TS_CHECK_HWLOC: look for hwloc libraries and headers
+dnl
+AC_DEFUN([TS_CHECK_HWLOC], [
+hwloc_path_provided=no
+AC_ARG_WITH(hwloc, [AC_HELP_STRING([--with-hwloc=DIR],[use a specific hwloc library])],
+[
+ if test "x$withval" != "xyes" && test "x$withval" != "x"; then
+ hwloc_base_dir="$withval"
+ if test "$withval" != "no"; then
+ hwloc_path_provided=yes
+ case "$withval" in
+ *":"*)
+ hwloc_include="`echo $withval |sed -e 's/:.*$//'`"
+ hwloc_ldflags="`echo $withval |sed -e 's/^.*://'`"
+ AC_MSG_CHECKING(checking for hwloc includes in $hwloc_include libs in $hwloc_ldflags )
+ ;;
+ *)
+ hwloc_include="$withval/include"
+ hwloc_ldflags="$withval/lib"
+ AC_MSG_CHECKING(checking for hwloc includes in $withval)
+ ;;
+ esac
+ fi
+ fi
+])
+
+if test "x$hwloc_path_provided" = "xno"; then
+ # Use pkg-config, because some distros (*cough* Ubuntu) put hwloc in unusual places.
+ PKG_CHECK_MODULES([HWLOC], [hwloc], [
+ SAVE_LIBS="$LIBS"
+ LIBS="-lhwloc"
+ AC_LANG_PUSH([C++])
+ AC_MSG_CHECKING([for hwloc C++ linking])
+ AC_LINK_IFELSE([
+ AC_LANG_PROGRAM([#include <hwloc.h>],[hwloc_topology_t t; hwloc_topology_init(&t); hwloc_get_type_depth(t, HWLOC_OBJ_SOCKET);])],[
+ AC_SUBST([HWLOC_CFLAGS])
+ AC_SUBST([HWLOC_LIBS])
+ AC_MSG_RESULT([yes])
+ # Old versions of libhwloc don't have HWLOC_OBJ_PU.
+ AC_CHECK_DECL(HWLOC_OBJ_PU,
+ [AC_DEFINE(HAVE_HWLOC_OBJ_PU, 1, [Whether HWLOC_OBJ_PU is available])], [],
+ [#include <hwloc.h>]
+ )
+ ], [
+ AC_MSG_RESULT([no])
+ AC_MSG_ERROR([hwloc not linkable])
+ ])
+ AC_LANG_POP()
+ LIBS="$SAVE_LIBS"
+ ], [
+ AC_MSG_ERROR([hwloc not found])
+ ])
+else
+ if test -d $hwloc_include && test -d $hwloc_ldflags && test -f $hwloc_include/hwloc.h; then
+ saved_ldflags=$LDFLAGS
+ saved_cppflags=$CPPFLAGS
+ hwloc_have_headers=0
+ hwloc_have_libs=0
+ if test "$hwloc_base_dir" != "/usr"; then
+ TS_ADDTO(CPPFLAGS, [-I${hwloc_include}])
+ TS_ADDTO(LDFLAGS, [-L${hwloc_ldflags}])
+ TS_ADDTO_RPATH(${hwloc_ldflags})
+ fi
+ AC_SEARCH_LIBS([hwloc_code], [hwloc], [hwloc_have_libs=1])
+ if test "$hwloc_have_libs" != "0"; then
+ AC_CHECK_HEADERS(hwloc.h, [hwloc_have_headers=1])
+ fi
+ if test "$hwloc_have_headers" != "0"; then
+ AC_SUBST(HWLOC_LIBS, [-lhwloc])
+ AC_CHECK_DECL(HWLOC_OBJ_PU,
+ [AC_DEFINE(HAVE_HWLOC_OBJ_PU, 1, [Whether HWLOC_OBJ_PU is available])], [],
+ [#include <hwloc.h>]
+ )
+ else
+ AC_MSG_ERROR([hwloc not found])
+ CPPFLAGS=$saved_cppflags
+ LDFLAGS=$saved_ldflags
+ fi
+ AC_MSG_RESULT([ok])
+ else
+ AC_MSG_ERROR([hwloc not found])
+ fi
+fi
+])
diff --git a/configure.ac b/configure.ac
index 701c3f0..7f33cb8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1077,6 +1077,9 @@ TS_CHECK_ZLIB
# Check for lzma presence and usability
TS_CHECK_LZMA
+# Check for hwloc presence and usability
+TS_CHECK_HWLOC
+
#
# Tcl macros provided by build/tcl.m4
#
@@ -1310,33 +1313,6 @@ AS_IF([test "x$enable_linux_native_aio" = "xyes"], [
AC_MSG_RESULT([$enable_linux_native_aio])
TS_ARG_ENABLE_VAR([use], [linux_native_aio])
-# Check for hwloc library.
-# Use pkg-config, because some distros (*cough* Ubuntu) put hwloc in unusual places.
-PKG_CHECK_MODULES([HWLOC], [hwloc], [
- SAVE_LIBS="$LIBS"
- LIBS="-lhwloc"
- AC_LANG_PUSH([C++])
- AC_MSG_CHECKING([for hwloc C++ linking])
- AC_LINK_IFELSE([
- AC_LANG_PROGRAM([#include <hwloc.h>],[hwloc_topology_t t; hwloc_topology_init(&t); hwloc_get_type_depth(t, HWLOC_OBJ_SOCKET);])],[
- AC_SUBST([HWLOC_CFLAGS])
- AC_SUBST([HWLOC_LIBS])
- AC_MSG_RESULT([yes])
- # Old versions of libhwloc don't have HWLOC_OBJ_PU.
- AC_CHECK_DECL(HWLOC_OBJ_PU,
- [AC_DEFINE(HAVE_HWLOC_OBJ_PU, 1, [Whether HWLOC_OBJ_PU is available])], [],
- [#include <hwloc.h>]
- )
- ], [
- AC_MSG_RESULT([no])
- AC_MSG_ERROR([hwloc not linkable])
- ])
- AC_LANG_POP()
- LIBS="$SAVE_LIBS"
-], [
- AC_MSG_ERROR([hwloc not found])
-])
-
#
# Check for Maxmind APIs / includes. TODO: Long term, it might make sense to support
# GeoIP as a "helper" plugin, which other plugins can then use. Such a plugin could
--
To stop receiving notification emails like this one, please contact
"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>.