Skip to content

Commit

Permalink
[hwloc] 2.11.2
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkvdb committed Oct 9, 2024
1 parent 949d3e1 commit fa960cf
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 55 deletions.
42 changes: 8 additions & 34 deletions ports/hwloc/fix_shared_win_build.patch
Original file line number Diff line number Diff line change
@@ -1,56 +1,30 @@
diff --git a/configure.ac b/configure.ac
index 44180d1aa..6bba9c435 100644
index 8af26ec..0d52b00 100644
--- a/configure.ac
+++ b/configure.ac
@@ -101,10 +101,11 @@ AM_PROG_CC_C_O
m4_version_prereq([2.70], [], [AC_PROG_CC_C99])
CFLAGS=$CFLAGS_save

-AC_ARG_VAR(CC_FOR_BUILD,[build system C compiler])
-AS_IF([test -z "$CC_FOR_BUILD"],[
- AC_SUBST([CC_FOR_BUILD], [$CC])
-])
+# only needed to run/build dolib.exe which can be replaced with a bash script....
+# AC_ARG_VAR(CC_FOR_BUILD,[build system C compiler])
+# AS_IF([test -z "$CC_FOR_BUILD"],[
+# AC_SUBST([CC_FOR_BUILD], [$CC])
+# ])

####################################################################
# CLI arguments
@@ -132,6 +133,8 @@ AS_IF([test "$enable_embedded_mode" != "yes"],
@@ -127,6 +127,8 @@ AS_IF([test "$enable_embedded_mode" != "yes"],
####################################################################

AC_SUBST([libhwloc_so_version])
+libhwloc_so_version_current_minus_age=`expr [[ $libhwloc_so_version=~ ([[:digit:]]+):[[:digit:]]+:([[:digit:]]+) ]] && real_so_ver=$(expr ${BASH_REMATCH[1]} - ${BASH_REMATCH[2]})`
+AC_SUBST(libhwloc_so_version_current_minus_age)
AC_SUBST([libhwloc_so_name])

# Setup the hwloc core
HWLOC_SETUP_CORE([], [], [AC_MSG_ERROR([Cannot build hwloc core])], [1])
diff --git a/hwloc/Makefile.am b/hwloc/Makefile.am
index 48cc81c5b..5aac67d4f 100644
index 4b3800a..f96473c 100644
--- a/hwloc/Makefile.am
+++ b/hwloc/Makefile.am
@@ -191,16 +191,15 @@ if HWLOC_HAVE_WINDOWS
@@ -189,11 +189,10 @@ if HWLOC_HAVE_WINDOWS

LC_MESSAGES=C
export LC_MESSAGES
-ldflags += -Xlinker --output-def -Xlinker .libs/libhwloc.def

if HWLOC_HAVE_MS_LIB
-dolib$(EXEEXT): dolib.c
- $(CC_FOR_BUILD) $< -o $@
-.libs/libhwloc.lib: libhwloc.la dolib$(EXEEXT)
- [ ! -r .libs/libhwloc.def ] || ./dolib$(EXEEXT) "$(HWLOC_MS_LIB)" $(HWLOC_MS_LIB_ARCH) .libs/libhwloc.def $(libhwloc_so_version) .libs/libhwloc.lib
+# dolib$(EXEEXT): dolib.c
+# $(CC_FOR_BUILD) $< -o $@
+# .libs/libhwloc.lib: libhwloc.la dolib$(EXEEXT)
+# [ ! -r .libs/libhwloc.def ] || ./dolib$(EXEEXT) "$(HWLOC_MS_LIB)" $(HWLOC_MS_LIB_ARCH) .libs/libhwloc.def $(libhwloc_so_version) .libs/libhwloc.lib
+.libs/libhwloc.lib: libhwloc.la
+ [ ! -r .libs/libhwloc.def ] || "$(HWLOC_MS_LIB)" /machine:$(HWLOC_MS_LIB_ARCH) /def:.libs/libhwloc.def /name:libhwloc-$(libhwloc_so_version_current_minus_age) /out:.libs/libhwloc.lib
.libs/libhwloc.lib: libhwloc.la
- [ ! -r .libs/libhwloc.def ] || "$(HWLOC_MS_LIB)" -machine:$(HWLOC_MS_LIB_ARCH) -def:.libs/libhwloc.def -name:libhwloc-$(libhwloc_so_name) -out:.libs/libhwloc.lib
+# [ ! -r .libs/libhwloc.def ] || "$(HWLOC_MS_LIB)" -machine:$(HWLOC_MS_LIB_ARCH) -def:.libs/libhwloc.def -name:libhwloc-$(libhwloc_so_name) -out:.libs/libhwloc.lib
all-local: .libs/libhwloc.lib
-clean-local:
- $(RM) dolib$(EXEEXT)
endif HWLOC_HAVE_MS_LIB

install-exec-hook:
13 changes: 0 additions & 13 deletions ports/hwloc/fix_wrong_ifdef.patch

This file was deleted.

22 changes: 16 additions & 6 deletions ports/hwloc/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO open-mpi/hwloc
REF 5e185ccfff2728fa351cea41f6d9fefebfb88078 # hwloc-2.5.0
SHA512 96f6421c40eede3a3c273a1ffa06accc43767421d5fb7b402a83caea1ef1a3bb8282c08ed94bc696296f37f3df80cd86403dac1012f2218b674569c8afcf3de9
PATCHES fix_wrong_ifdef.patch
fix_shared_win_build.patch
REF "hwloc-${VERSION}"
SHA512 1ed47955d4a3ecf66636f1c5a89648ef055aa4f26fac9b9bc64d6f7715d671dc823337ebf38df53d60b50d697eccadfbd48d28b4540a5153c59d7eecd347f91c
PATCHES
fix_shared_win_build.patch
stdout_fileno.patch
)

if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
Expand All @@ -14,6 +15,8 @@ endif()

if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
list(APPEND OPTIONS "HWLOC_LDFLAGS=-no-undefined")
elseif(VCPKG_TARGET_IS_OSX)
list(APPEND OPTIONS "HWLOC_LDFLAGS=-framework CoreFoundation")
endif()

vcpkg_configure_make(
Expand Down Expand Up @@ -42,10 +45,17 @@ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")

if(EXISTS "${CURRENT_PACKAGES_DIR}/tools/hwloc/bin/hwloc-compress-dir")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/tools/hwloc/bin/hwloc-compress-dir" "${CURRENT_INSTALLED_DIR}" "`dirname $0`/../../..")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/tools/hwloc/bin/hwloc-compress-dir" "${CURRENT_INSTALLED_DIR}" "`dirname $0`/../../.." IGNORE_UNCHANGED)
endif()
if(EXISTS "${CURRENT_PACKAGES_DIR}/tools/hwloc/debug/bin/hwloc-compress-dir")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/tools/hwloc/debug/bin/hwloc-compress-dir" "${CURRENT_INSTALLED_DIR}" "`dirname $0`/../../..")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/tools/hwloc/debug/bin/hwloc-compress-dir" "${CURRENT_INSTALLED_DIR}" "`dirname $0`/../../../.." IGNORE_UNCHANGED)
endif()

if(EXISTS "${CURRENT_PACKAGES_DIR}/tools/hwloc/bin/hwloc-gather-topology")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/tools/hwloc/bin/hwloc-gather-topology" "${CURRENT_INSTALLED_DIR}" "`dirname $0`/../../..")
endif()
if(EXISTS "${CURRENT_PACKAGES_DIR}/tools/hwloc/debug/bin/hwloc-gather-topology")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/tools/hwloc/debug/bin/hwloc-gather-topology" "${CURRENT_INSTALLED_DIR}" "`dirname $0`/../../../..")
endif()

# Handle copyright
Expand Down
15 changes: 15 additions & 0 deletions ports/hwloc/stdout_fileno.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff --git a/utils/lstopo/lstopo.c b/utils/lstopo/lstopo.c
index a946581c3..ecbf64aff 100644
--- a/utils/lstopo/lstopo.c
+++ b/utils/lstopo/lstopo.c
@@ -58,6 +58,10 @@
# endif
#endif

+#if _MSC_VER
+#define STDOUT_FILENO _fileno( stdout )
+#endif
+
#ifdef ANDROID
extern void setJNIEnv();
#endif
4 changes: 2 additions & 2 deletions ports/hwloc/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "hwloc",
"version": "2.5.0",
"port-version": 1,
"version": "2.11.2",
"maintainers": "bgoglin<[email protected]>",
"description": [
"Portable Hardware Locality (hwloc)",
"The Portable Hardware Locality (hwloc) software package provides a portable abstraction (across OS, versions, architectures, ...) of the hierarchical topology of modern architectures, including NUMA memory nodes, sockets, shared caches, cores and simultaneous multithreading. It also gathers various system attributes such as cache and memory information as well as the locality of I/O devices such as network interfaces, InfiniBand HCAs or GPUs."
],
"homepage": "https://github.com/open-mpi/hwloc",
"license": "BSD-2-Clause",
"supports": "!uwp"
}

0 comments on commit fa960cf

Please sign in to comment.