[fp16] create a new port (#16340)

* [psimd] create a new port

* [psimd] update baseline and port SHA

* [fp16] create a new port

* [fp16] update baseline and port SHA

* [fp16] apply PR feedback
This commit is contained in:
Park DongHa 2021-04-02 02:36:07 +09:00 committed by GitHub
parent b05fe02703
commit 67d8f453e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 72 additions and 0 deletions

View File

@ -0,0 +1,31 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -33,7 +33,8 @@ SET(CONFU_DEPENDENCIES_SOURCE_DIR ${CMAKE_SOURCE_DIR}/deps
SET(CONFU_DEPENDENCIES_BINARY_DIR ${CMAKE_BINARY_DIR}/deps
CACHE PATH "Confu-style dependencies binary directory")
-IF(NOT DEFINED PSIMD_SOURCE_DIR)
+find_path(PSIMD_INCLUDE_DIRS "psimd.h")
+IF(FALSE)
MESSAGE(STATUS "Downloading PSimd to ${CONFU_DEPENDENCIES_SOURCE_DIR}/psimd (define PSIMD_SOURCE_DIR to avoid it)")
CONFIGURE_FILE(cmake/DownloadPSimd.cmake "${CONFU_DEPENDENCIES_BINARY_DIR}/psimd-download/CMakeLists.txt")
EXECUTE_PROCESS(COMMAND "${CMAKE_COMMAND}" -G "${CMAKE_GENERATOR}" .
@@ -76,7 +77,7 @@ ELSE()
ENDIF()
TARGET_INCLUDE_DIRECTORIES(fp16 INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
- $<INSTALL_INTERFACE:include>)
+ $<INSTALL_INTERFACE:include> $<INSTALL_INTERFACE:${PSIMD_INCLUDE_DIRS}>)
INSTALL(FILES include/fp16.h
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
@@ -90,7 +91,7 @@ INSTALL(FILES
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/fp16)
# ---[ Configure psimd
-IF(NOT TARGET psimd)
+IF(FALSE)
ADD_SUBDIRECTORY(
"${PSIMD_SOURCE_DIR}"
"${CONFU_DEPENDENCIES_BINARY_DIR}/psimd")

19
ports/fp16/portfile.cmake Normal file
View File

@ -0,0 +1,19 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO Maratyszcza/fp16
REF 4dfe081cf6bcd15db339cf2680b9281b8451eeb3
SHA512 e79a1f6f8d4aeca85982158d5b070923d31d4f2062ed84cfa6f26c47a34f2e8ac49e0f330b7d49f5732d5e1eec6e7afccdac43645070060fb7827e2ce261dd3e
PATCHES
find-psimd.patch
)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
-DFP16_BUILD_TESTS=OFF
-DFP16_BUILD_BENCHMARKS=OFF
)
vcpkg_install_cmake()
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug)

9
ports/fp16/vcpkg.json Normal file
View File

@ -0,0 +1,9 @@
{
"name": "fp16",
"version-date": "2021-02-21",
"description": "Header-only library for conversion to/from half-precision floating point formats",
"homepage": "https://github.com/Maratyszcza/FP16",
"dependencies": [
"psimd"
]
}

View File

@ -2036,6 +2036,10 @@
"baseline": "1.0.5",
"port-version": 0
},
"fp16": {
"baseline": "2021-02-21",
"port-version": 0
},
"fplus": {
"baseline": "0.2.13-p0",
"port-version": 0

9
versions/f-/fp16.json Normal file
View File

@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "849acf1f87e0194fda4cd5459e51c564874c60ed",
"version-date": "2021-02-21",
"port-version": 0
}
]
}