mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-27 18:31:15 +08:00
[hwloc] Update to 2.5 and switch to make (#20905)
* hwloc try and error * hwloc fix build. * format manifest * version stuff * remove supports expression. Copy COPYING from src dir * format manifest * overwrite version * update ci baseline hpx uses _mm_pause which seems to be undefined on arm64 maybe hpx requires a supports field? * switch to version in manifest * version stuff * add maintainer Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> * version stuff Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com>
This commit is contained in:
parent
1ba5e0ffe5
commit
fdac8bfc1b
@ -1,69 +0,0 @@
|
||||
cmake_minimum_required(VERSION 3.0)
|
||||
project(hwloc
|
||||
LANGUAGES C
|
||||
VERSION 2.2.0)
|
||||
|
||||
configure_file(contrib/windows/hwloc_config.h include/hwloc/autogen/config.h COPYONLY)
|
||||
configure_file(contrib/windows/static-components.h include/static-components.h COPYONLY)
|
||||
configure_file(contrib/windows/private_config.h include/private/autogen/config.h COPYONLY)
|
||||
|
||||
file(READ ${CMAKE_CURRENT_BINARY_DIR}/include/private/autogen/config.h PRIVATE_CONFIG_H)
|
||||
string(REPLACE "#define HAVE_DECL_SNPRINTF 0" "#define HAVE_DECL_SNPRINTF 1" PRIVATE_CONFIG_H "${PRIVATE_CONFIG_H}")
|
||||
string(REPLACE "#define HAVE_DECL_STRTOULL 0" "#define HAVE_DECL_STRTOULL 1" PRIVATE_CONFIG_H "${PRIVATE_CONFIG_H}")
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
|
||||
string(REPLACE "/* #undef HWLOC_X86_32_ARCH */" "#define HWLOC_X86_32_ARCH 1" PRIVATE_CONFIG_H "${PRIVATE_CONFIG_H}")
|
||||
string(REPLACE "#define HWLOC_X86_64_ARCH 1" "/* #undef HWLOC_X86_64_ARCH */" PRIVATE_CONFIG_H "${PRIVATE_CONFIG_H}")
|
||||
string(REPLACE "#define SIZEOF_VOID_P 8" "#define SIZEOF_VOID_P 4" PRIVATE_CONFIG_H "${PRIVATE_CONFIG_H}")
|
||||
endif()
|
||||
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/include/private/autogen/config.h "${PRIVATE_CONFIG_H}")
|
||||
|
||||
add_library(libhwloc
|
||||
hwloc/base64.c
|
||||
hwloc/bind.c
|
||||
hwloc/bitmap.c
|
||||
hwloc/components.c
|
||||
hwloc/distances.c
|
||||
hwloc/diff.c
|
||||
hwloc/misc.c
|
||||
hwloc/pci-common.c
|
||||
hwloc/shmem.c
|
||||
hwloc/topology-noos.c
|
||||
hwloc/topology-synthetic.c
|
||||
hwloc/topology-windows.c
|
||||
hwloc/topology-x86.c
|
||||
hwloc/topology-xml-nolibxml.c
|
||||
hwloc/topology-xml.c
|
||||
hwloc/topology.c
|
||||
hwloc/traversal.c
|
||||
hwloc/dolib.c)
|
||||
|
||||
set_target_properties(libhwloc PROPERTIES DEFINE_SYMBOL _USRDLL)
|
||||
|
||||
add_executable(hwloc-info
|
||||
utils/hwloc/hwloc-info.c)
|
||||
|
||||
target_link_libraries(hwloc-info PRIVATE libhwloc)
|
||||
|
||||
foreach(Target IN ITEMS libhwloc hwloc-info)
|
||||
target_include_directories(${Target} PRIVATE ./include ./hwloc ${CMAKE_CURRENT_BINARY_DIR}/include)
|
||||
target_compile_definitions(${Target} PRIVATE _CRT_SECURE_NO_WARNINGS)
|
||||
endforeach(Target)
|
||||
|
||||
install(TARGETS libhwloc
|
||||
RUNTIME DESTINATION bin
|
||||
ARCHIVE DESTINATION lib
|
||||
LIBRARY DESTINATION lib)
|
||||
|
||||
install(TARGETS hwloc-info
|
||||
RUNTIME DESTINATION tools/hwloc)
|
||||
if(BUILD_SHARED_LIBS)
|
||||
install(TARGETS libhwloc
|
||||
RUNTIME DESTINATION tools/hwloc)
|
||||
endif(BUILD_SHARED_LIBS)
|
||||
|
||||
|
||||
if(NOT HWLOC_SKIP_INCLUDES)
|
||||
install(FILES include/hwloc.h DESTINATION include)
|
||||
install(DIRECTORY include/hwloc DESTINATION include FILES_MATCHING PATTERN "*.h")
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/include/hwloc/autogen/config.h DESTINATION include/hwloc/autogen)
|
||||
endif()
|
56
ports/hwloc/fix_shared_win_build.patch
Normal file
56
ports/hwloc/fix_shared_win_build.patch
Normal file
@ -0,0 +1,56 @@
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 44180d1aa..6bba9c435 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"],
|
||||
####################################################################
|
||||
|
||||
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)
|
||||
|
||||
# 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
|
||||
--- a/hwloc/Makefile.am
|
||||
+++ b/hwloc/Makefile.am
|
||||
@@ -191,16 +191,15 @@ 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
|
||||
all-local: .libs/libhwloc.lib
|
||||
-clean-local:
|
||||
- $(RM) dolib$(EXEEXT)
|
||||
endif HWLOC_HAVE_MS_LIB
|
||||
|
||||
install-exec-hook:
|
13
ports/hwloc/fix_wrong_ifdef.patch
Normal file
13
ports/hwloc/fix_wrong_ifdef.patch
Normal file
@ -0,0 +1,13 @@
|
||||
diff --git a/hwloc/topology.c b/hwloc/topology.c
|
||||
index 01e5a863c..211f2cbd1 100644
|
||||
--- a/hwloc/topology.c
|
||||
+++ b/hwloc/topology.c
|
||||
@@ -69,7 +69,7 @@
|
||||
* it will break in cygwin, we'll have to use both putenv() and SetEnvironmentVariable().
|
||||
* Hopefully L0 will be provide a way to enable Sysman without env vars before it happens.
|
||||
*/
|
||||
-#ifdef HWLOC_HAVE_ATTRIBUTE_CONSTRUCTOR
|
||||
+#if HWLOC_HAVE_ATTRIBUTE_CONSTRUCTOR
|
||||
static void hwloc_constructor(void) __attribute__((constructor));
|
||||
static void hwloc_constructor(void)
|
||||
{
|
@ -1,54 +1,54 @@
|
||||
vcpkg_fail_port_install(ON_ARCH "arm" "arm64" ON_TARGET "uwp")
|
||||
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO open-mpi/hwloc
|
||||
REF 263908a2c1f21c0e221a8d1f6472daf3a1fc07b9 # hwloc-2.2.0
|
||||
SHA512 87f3d267781fd1f8907b0c080868b56943c7c2caecae5c0fbe9a55f8c5e9453bb6b7892834ba37696c1ebadd8d7bfdd5e513ea72a075211b808a1d5803ea4b8e
|
||||
REF 5e185ccfff2728fa351cea41f6d9fefebfb88078 # hwloc-2.5.0
|
||||
SHA512 96f6421c40eede3a3c273a1ffa06accc43767421d5fb7b402a83caea1ef1a3bb8282c08ed94bc696296f37f3df80cd86403dac1012f2218b674569c8afcf3de9
|
||||
PATCHES fix_wrong_ifdef.patch
|
||||
fix_shared_win_build.patch
|
||||
)
|
||||
|
||||
if (VCPKG_TARGET_IS_WINDOWS)
|
||||
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
|
||||
vcpkg_configure_cmake(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
PREFER_NINJA
|
||||
)
|
||||
|
||||
vcpkg_install_cmake()
|
||||
|
||||
file(READ ${CURRENT_PACKAGES_DIR}/include/hwloc/autogen/config.h PUBLIC_CONFIG_H)
|
||||
string(REPLACE "defined( DECLSPEC_EXPORTS )" "0" PUBLIC_CONFIG_H "${PUBLIC_CONFIG_H}")
|
||||
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
||||
string(REPLACE "defined( _USRDLL )" "0" PUBLIC_CONFIG_H "${PUBLIC_CONFIG_H}")
|
||||
else()
|
||||
string(REPLACE "defined( _USRDLL )" "1" PUBLIC_CONFIG_H "${PUBLIC_CONFIG_H}")
|
||||
endif()
|
||||
file(WRITE ${CURRENT_PACKAGES_DIR}/include/hwloc/autogen/config.h "${PUBLIC_CONFIG_H}")
|
||||
|
||||
file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/tools)
|
||||
else()
|
||||
message(WARNING "${PORT} currently requires the following tool from the system package manager:\n libtool")
|
||||
|
||||
vcpkg_configure_make(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
AUTOCONFIG
|
||||
OPTIONS
|
||||
--disable-libxml2
|
||||
--disable-opencl
|
||||
)
|
||||
|
||||
vcpkg_install_make()
|
||||
|
||||
file(GLOB HWLOC_EXEC ${CURRENT_PACKAGES_DIR}/bin)
|
||||
message("HWLOC_EXEC: ${HWLOC_EXEC}")
|
||||
if (HWLOC_EXEC)
|
||||
file(COPY ${HWLOC_EXEC} DESTINATION ${CURRENT_PACKAGES_DIR}/tools)
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
|
||||
endif()
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
|
||||
|
||||
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()
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
||||
|
||||
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
|
||||
list(APPEND OPTIONS "HWLOC_LDFLAGS=-no-undefined")
|
||||
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")
|
||||
|
||||
|
||||
# Handle copyright
|
||||
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME 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"
|
||||
)
|
||||
|
@ -1,11 +1,11 @@
|
||||
{
|
||||
"name": "hwloc",
|
||||
"version-string": "2.2.0",
|
||||
"port-version": 1,
|
||||
"version": "2.5.0",
|
||||
"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",
|
||||
"supports": "!(uwp | arm | arm64)"
|
||||
"supports": "!uwp"
|
||||
}
|
||||
|
@ -427,6 +427,7 @@ healpix:x64-osx=fail
|
||||
hiredis:arm-uwp=fail
|
||||
hiredis:x64-uwp=fail
|
||||
hpx:x64-windows-static=fail
|
||||
hpx:arm64-windows=fail
|
||||
hpx:x64-linux=fail
|
||||
hunspell:x64-windows-static-md=fail
|
||||
ideviceinstaller:x64-windows-static-md=fail
|
||||
|
@ -2697,8 +2697,8 @@
|
||||
"port-version": 5
|
||||
},
|
||||
"hwloc": {
|
||||
"baseline": "2.2.0",
|
||||
"port-version": 1
|
||||
"baseline": "2.5.0",
|
||||
"port-version": 0
|
||||
},
|
||||
"hyperscan": {
|
||||
"baseline": "5.3.0",
|
||||
|
@ -1,5 +1,10 @@
|
||||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "f06abb37eb6d851f82bca48c437744fd1c642dc3",
|
||||
"version": "2.5.0",
|
||||
"port-version": 0
|
||||
},
|
||||
{
|
||||
"git-tree": "564b5a894249dd831dbb8ad8792fe30d12ac353a",
|
||||
"version-string": "2.2.0",
|
||||
|
Loading…
x
Reference in New Issue
Block a user