aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/hwloc
diff options
context:
space:
mode:
Diffstat (limited to 'vcpkg/ports/hwloc')
-rw-r--r--vcpkg/ports/hwloc/fix_shared_win_build.patch30
-rw-r--r--vcpkg/ports/hwloc/portfile.cmake70
-rw-r--r--vcpkg/ports/hwloc/stdout_fileno.patch15
-rw-r--r--vcpkg/ports/hwloc/vcpkg.json12
4 files changed, 127 insertions, 0 deletions
diff --git a/vcpkg/ports/hwloc/fix_shared_win_build.patch b/vcpkg/ports/hwloc/fix_shared_win_build.patch
new file mode 100644
index 0000000..dcfadbd
--- /dev/null
+++ b/vcpkg/ports/hwloc/fix_shared_win_build.patch
@@ -0,0 +1,30 @@
+diff --git a/configure.ac b/configure.ac
+index 8af26ec..0d52b00 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -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
+diff --git a/hwloc/Makefile.am b/hwloc/Makefile.am
+index 4b3800a..f96473c 100644
+--- a/hwloc/Makefile.am
++++ b/hwloc/Makefile.am
+@@ -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
+ .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
+ endif HWLOC_HAVE_MS_LIB
+
diff --git a/vcpkg/ports/hwloc/portfile.cmake b/vcpkg/ports/hwloc/portfile.cmake
new file mode 100644
index 0000000..5448cb3
--- /dev/null
+++ b/vcpkg/ports/hwloc/portfile.cmake
@@ -0,0 +1,70 @@
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO open-mpi/hwloc
+ 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)
+ set(OPTIONS ac_cv_prog_cc_c99= # To avoid the compiler check for C99 which will fail for MSVC
+ --disable-plugin-dlopen)
+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(
+ SOURCE_PATH "${SOURCE_PATH}"
+ AUTOCONFIG
+ OPTIONS
+ ${OPTIONS}
+ --disable-libxml2
+ --disable-opencl
+ --disable-cairo
+ --disable-cuda
+ --disable-libudev
+ --disable-levelzero
+ --disable-nvml
+ --disable-rsmi
+ --disable-pci
+ #--disable-cpuid
+ #--disable-picky
+)
+
+vcpkg_install_make()
+vcpkg_fixup_pkgconfig()
+vcpkg_copy_tool_dependencies("${CURRENT_PACKAGES_DIR}/tools/${PORT}/bin")
+
+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`/../../.." 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`/../../../.." 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
+file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
+
+file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/COPYING.txt"
+ "${CURRENT_PACKAGES_DIR}/debug/README.txt"
+ "${CURRENT_PACKAGES_DIR}/debug/NEWS.txt"
+ "${CURRENT_PACKAGES_DIR}/COPYING.txt"
+ "${CURRENT_PACKAGES_DIR}/README.txt"
+ "${CURRENT_PACKAGES_DIR}/NEWS.txt"
+ )
diff --git a/vcpkg/ports/hwloc/stdout_fileno.patch b/vcpkg/ports/hwloc/stdout_fileno.patch
new file mode 100644
index 0000000..e205fb0
--- /dev/null
+++ b/vcpkg/ports/hwloc/stdout_fileno.patch
@@ -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
diff --git a/vcpkg/ports/hwloc/vcpkg.json b/vcpkg/ports/hwloc/vcpkg.json
new file mode 100644
index 0000000..e238d7c
--- /dev/null
+++ b/vcpkg/ports/hwloc/vcpkg.json
@@ -0,0 +1,12 @@
+{
+ "name": "hwloc",
+ "version": "2.11.2",
+ "maintainers": "bgoglin<Brice.Goglin@inria.fr>",
+ "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"
+}