From d10918a71ab43df46689f52fa3280830ae79ffee Mon Sep 17 00:00:00 2001 From: almikhayl Date: Mon, 20 May 2019 03:24:15 +0300 Subject: [PATCH] [numactl] new port only linux (#6080) * [numactl] new port only linux * Add system dependency message * Update dependencies to include libtool * Make whitespace change to retrigger CI --- ports/numactl/CONTROL | 3 ++ ports/numactl/portfile.cmake | 73 ++++++++++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 ports/numactl/CONTROL create mode 100644 ports/numactl/portfile.cmake diff --git a/ports/numactl/CONTROL b/ports/numactl/CONTROL new file mode 100644 index 000000000..4c5c03687 --- /dev/null +++ b/ports/numactl/CONTROL @@ -0,0 +1,3 @@ +Source: numactl +Version: 2.0.12 +Description: NUMA support for Linux diff --git a/ports/numactl/portfile.cmake b/ports/numactl/portfile.cmake new file mode 100644 index 000000000..3319d282f --- /dev/null +++ b/ports/numactl/portfile.cmake @@ -0,0 +1,73 @@ +include(vcpkg_common_functions) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO numactl/numactl + REF v2.0.12 + SHA512 3814efd924d1c9152a30f6ae5b665afc20648226cd475d72b933c0ec4f30249af4e25110de17f144734b787ed765644dca09a657219806ab5c9c550abd45bf8e + HEAD_REF master +) + +if(NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux") + message(FATAL_ERROR "Package only supports linux platform.") +endif() + +message( +"numactl currently requires the following libraries from the system package manager: + autoconf libtool +These can be installed on Ubuntu systems via sudo apt install autoconf libtool" +) + +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + set(SHARED_STATIC --enable-static --disable-shared) +else() + set(SHARED_STATIC --disable-static --enable-shared) +endif() + +set(OPTIONS ${SHARED_STATIC}) +vcpkg_execute_required_process( + COMMAND ${SOURCE_PATH}/autogen.sh + WORKING_DIRECTORY ${SOURCE_PATH} + LOGNAME setup-${TARGET_TRIPLET} +) + +file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) +file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) +message(STATUS "Configuring ${TARGET_TRIPLET}-dbg") +set(CFLAGS "${VCPKG_C_FLAGS} ${VCPKG_C_FLAGS_DEBUG} -fPIC -O0 -g -I${SOURCE_PATH}/include") +set(LDFLAGS "${VCPKG_LINKER_FLAGS}") +vcpkg_execute_required_process( + COMMAND ${SOURCE_PATH}/configure --prefix=${CURRENT_PACKAGES_DIR}/debug ${OPTIONS} --with-sysroot=${CURRENT_INSTALLED_DIR}/debug + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg + LOGNAME configure-${TARGET_TRIPLET}-dbg +) +message(STATUS "Building ${TARGET_TRIPLET}-dbg") +vcpkg_execute_required_process( + COMMAND make -j install "CFLAGS=${CFLAGS}" "LDFLAGS=${LDFLAGS}" + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg + LOGNAME install-${TARGET_TRIPLET}-dbg +) + +file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) +file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) +message(STATUS "Configuring ${TARGET_TRIPLET}-rel") +set(CFLAGS "${VCPKG_C_FLAGS} ${VCPKG_C_FLAGS_RELEASE} -fPIC -O3 -I${SOURCE_PATH}/include") +set(LDFLAGS "${VCPKG_LINKER_FLAGS}") +vcpkg_execute_required_process( + COMMAND ${SOURCE_PATH}/configure --prefix=${CURRENT_PACKAGES_DIR} ${OPTIONS} --with-sysroot=${CURRENT_INSTALLED_DIR} + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel + LOGNAME configure-${TARGET_TRIPLET}-rel +) +message(STATUS "Building ${TARGET_TRIPLET}-rel") +vcpkg_execute_required_process( + COMMAND make -j install "CFLAGS=${CFLAGS}" "LDFLAGS=${LDFLAGS}" + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel + LOGNAME install-${TARGET_TRIPLET}-rel +) + +if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) +endif() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share) +configure_file(${SOURCE_PATH}/README.md ${CURRENT_PACKAGES_DIR}/share/numactl/copyright COPYONLY)