From 91876e047a54526b4ea459eb4bd7e5cce9a51564 Mon Sep 17 00:00:00 2001 From: Hartmut Kaiser Date: Mon, 22 May 2017 21:38:11 -0500 Subject: Add support for installing binary distributions of HWLOC - this depends on #1144 - this fixes #1124 --- ports/hwloc/CONTROL | 4 ++++ ports/hwloc/portfile.cmake | 53 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 ports/hwloc/CONTROL create mode 100644 ports/hwloc/portfile.cmake diff --git a/ports/hwloc/CONTROL b/ports/hwloc/CONTROL new file mode 100644 index 000000000..f79c957e5 --- /dev/null +++ b/ports/hwloc/CONTROL @@ -0,0 +1,4 @@ +Source: hwloc +Version: 1.11.7 +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. diff --git a/ports/hwloc/portfile.cmake b/ports/hwloc/portfile.cmake new file mode 100644 index 000000000..785061158 --- /dev/null +++ b/ports/hwloc/portfile.cmake @@ -0,0 +1,53 @@ +# Common Ambient Variables: +# CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT} +# CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET} +# CURRENT_PORT DIR = ${VCPKG_ROOT_DIR}\ports\${PORT} +# PORT = current port name (zlib, etc) +# TARGET_TRIPLET = current triplet (x86-windows, x64-windows-static, etc) +# VCPKG_CRT_LINKAGE = C runtime linkage type (static, dynamic) +# VCPKG_LIBRARY_LINKAGE = target library linkage type (static, dynamic) +# VCPKG_ROOT_DIR = +# VCPKG_TARGET_ARCHITECTURE = target architecture (x64, x86, arm) +# + +include(vcpkg_common_functions) + +if(TRIPLET_SYSTEM_ARCH MATCHES "x86") + vcpkg_download_distfile(ARCHIVE + URLS "https://www.open-mpi.org/software/hwloc/v1.11/downloads/hwloc-win32-build-1.11.7.zip" + FILENAME "hwloc-win32-build-1.11.7.zip" + SHA512 c474f2400b207bbad3da94d201d03eb711df6a87aacb8429c489591ed47393eb499d99da5737a22d0745194296db11bf9e8ebbabd4bf2ecfd2d2878a773195d8 + ) + set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/hwloc-win32-build-1.11.7) +elseif(TRIPLET_SYSTEM_ARCH MATCHES "x64") + vcpkg_download_distfile(ARCHIVE + URLS "https://www.open-mpi.org/software/hwloc/v1.11/downloads/hwloc-win64-build-1.11.7.zip" + FILENAME "hwloc-win64-build-1.11.7.zip" + SHA512 1373107f75f372fa519a7c3f686fbb6ff89e14c3750e1d64755c768daf77a01a1d962b5e7ecadc65f9917b56f45193e637db3958a0bede08cfe2dd983a335d9b + ) + set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/hwloc-win64-build-1.11.7) +else() + message(FATAL_ERROR " HWLOC is not available for download for the ARM platform") +endif() +vcpkg_extract_source_archive(${ARCHIVE}) + +message(STATUS "Installing") + +# copy include files +file(COPY ${SOURCE_PATH}/include/hwloc.h DESTINATION ${CURRENT_PACKAGES_DIR}/include) +file(COPY ${SOURCE_PATH}/include/hwloc DESTINATION ${CURRENT_PACKAGES_DIR}/include) + +# copy binaries +file(COPY ${SOURCE_PATH}/bin/libhwloc-5.dll DESTINATION ${CURRENT_PACKAGES_DIR}/bin) +file(COPY ${SOURCE_PATH}/lib/libhwloc.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib) + +file(COPY ${SOURCE_PATH}/bin/libhwloc-5.dll DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) +file(COPY ${SOURCE_PATH}/lib/libhwloc.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) + +message(STATUS "Installing done") + +# Handle copyright +file(COPY ${SOURCE_PATH}/COPYING.TXT DESTINATION ${CURRENT_PACKAGES_DIR}/share/hwloc) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/hwloc/COPYING.txt ${CURRENT_PACKAGES_DIR}/share/hwloc/copyright) + +set(VCPKG_POLICY_ALLOW_OBSOLETE_MSVCRT enabled) -- cgit v1.2.3 From 67e038b9e059745e953f13e666777081055794bb Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Mon, 22 May 2017 22:21:10 -0700 Subject: [hwloc] Use VCPKG_TARGET_ARCHITECTURE instead of TRIPLET_SYSTEM_ARCH. --- ports/hwloc/portfile.cmake | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/ports/hwloc/portfile.cmake b/ports/hwloc/portfile.cmake index 785061158..c689d621f 100644 --- a/ports/hwloc/portfile.cmake +++ b/ports/hwloc/portfile.cmake @@ -1,25 +1,13 @@ -# Common Ambient Variables: -# CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT} -# CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET} -# CURRENT_PORT DIR = ${VCPKG_ROOT_DIR}\ports\${PORT} -# PORT = current port name (zlib, etc) -# TARGET_TRIPLET = current triplet (x86-windows, x64-windows-static, etc) -# VCPKG_CRT_LINKAGE = C runtime linkage type (static, dynamic) -# VCPKG_LIBRARY_LINKAGE = target library linkage type (static, dynamic) -# VCPKG_ROOT_DIR = -# VCPKG_TARGET_ARCHITECTURE = target architecture (x64, x86, arm) -# - include(vcpkg_common_functions) -if(TRIPLET_SYSTEM_ARCH MATCHES "x86") +if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") vcpkg_download_distfile(ARCHIVE URLS "https://www.open-mpi.org/software/hwloc/v1.11/downloads/hwloc-win32-build-1.11.7.zip" FILENAME "hwloc-win32-build-1.11.7.zip" SHA512 c474f2400b207bbad3da94d201d03eb711df6a87aacb8429c489591ed47393eb499d99da5737a22d0745194296db11bf9e8ebbabd4bf2ecfd2d2878a773195d8 ) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/hwloc-win32-build-1.11.7) -elseif(TRIPLET_SYSTEM_ARCH MATCHES "x64") +elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") vcpkg_download_distfile(ARCHIVE URLS "https://www.open-mpi.org/software/hwloc/v1.11/downloads/hwloc-win64-build-1.11.7.zip" FILENAME "hwloc-win64-build-1.11.7.zip" @@ -27,7 +15,7 @@ elseif(TRIPLET_SYSTEM_ARCH MATCHES "x64") ) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/hwloc-win64-build-1.11.7) else() - message(FATAL_ERROR " HWLOC is not available for download for the ARM platform") + message(FATAL_ERROR "HWLOC is not available for download for the platform: ${VCPKG_TARGET_ARCHITECTURE}") endif() vcpkg_extract_source_archive(${ARCHIVE}) -- cgit v1.2.3