mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-28 19:25:27 +08:00
[flashlight-cuda] New Port (#14676)
* [flashlight-cuda] New Port * Rebase on NCCL port, update commit * Add default feature (fl)
This commit is contained in:
parent
e95a7a8dc0
commit
b7f03b4635
55
ports/flashlight-cuda/portfile.cmake
Normal file
55
ports/flashlight-cuda/portfile.cmake
Normal file
@ -0,0 +1,55 @@
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO facebookresearch/flashlight
|
||||
REF cd0aa18b94340afc7cfa9a14281d1c90c0ed42e1
|
||||
SHA512 a11392af82054b63c557214c04e59b362aa1eb5897b30a595b26fd22c37c29571e504346947c6b9cebc4499c3af68d2075fd3144dcc0535a27886e34036ac5ff
|
||||
HEAD_REF master
|
||||
)
|
||||
|
||||
################################### Build ###################################
|
||||
# Default flags
|
||||
set(FL_DEFAULT_VCPKG_CMAKE_FLAGS
|
||||
-DFL_BUILD_TESTS=OFF
|
||||
-DFL_BUILD_EXAMPLES=OFF
|
||||
-DFL_BACKEND=CUDA # this port is CUDA-backend only
|
||||
-DFL_BUILD_STANDALONE=OFF
|
||||
-DFL_INSTALL_CMAKE_DIR=${CURRENT_PACKAGES_DIR}/share/${PORT} # for CMake configs/targets
|
||||
)
|
||||
|
||||
# Determine which backend to build via specified feature
|
||||
vcpkg_check_features(
|
||||
OUT_FEATURE_OPTIONS FL_BACKEND_FEATURE_OPTIONS
|
||||
FEATURES
|
||||
lib FL_BUILD_LIBRARIES
|
||||
fl FL_BUILD_CORE
|
||||
asr FL_BUILD_APP_ASR
|
||||
imgclass FL_BUILD_APP_IMG_CLASS
|
||||
)
|
||||
|
||||
# Build and install
|
||||
vcpkg_configure_cmake(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
PREFER_NINJA
|
||||
OPTIONS ${FL_DEFAULT_VCPKG_CMAKE_FLAGS} ${FL_BACKEND_FEATURE_OPTIONS}
|
||||
)
|
||||
vcpkg_install_cmake()
|
||||
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
|
||||
|
||||
# Binaries/tools
|
||||
set(FLASHLIGHT_TOOLS "")
|
||||
if ("imgclass" IN_LIST FEATURES)
|
||||
list(APPEND FLASHLIGHT_TOOLS fl_imageNetResnet34)
|
||||
endif()
|
||||
if ("asr" IN_LIST FEATURES)
|
||||
list(APPEND FLASHLIGHT_TOOLS fl_asr_train fl_asr_test fl_asr_decode)
|
||||
endif()
|
||||
list(LENGTH FLASHLIGHT_TOOLS NUM_TOOLS)
|
||||
if (NUM_TOOLS GREATER 0)
|
||||
vcpkg_copy_tools(TOOL_NAMES ${FLASHLIGHT_TOOLS} AUTO_CLEAN)
|
||||
endif()
|
||||
|
||||
# Copyright and license
|
||||
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/flashlight-cuda RENAME copyright)
|
||||
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/flashlight-cuda RENAME license)
|
72
ports/flashlight-cuda/vcpkg.json
Normal file
72
ports/flashlight-cuda/vcpkg.json
Normal file
@ -0,0 +1,72 @@
|
||||
{
|
||||
"name": "flashlight-cuda",
|
||||
"version-string": "20201120",
|
||||
"port-version": 1,
|
||||
"description": "A C++ standalone library for machine learning. CUDA backend.",
|
||||
"supports": "!(windows | osx)",
|
||||
"default-features": [
|
||||
"fl"
|
||||
],
|
||||
"features": {
|
||||
"asr": {
|
||||
"description": "flashlight asr app",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "flashlight-cuda",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"fl"
|
||||
]
|
||||
},
|
||||
"gflags",
|
||||
"libsndfile"
|
||||
]
|
||||
},
|
||||
"fl": {
|
||||
"description": "flashlight core autograd and neural net library",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "arrayfire",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"cuda"
|
||||
]
|
||||
},
|
||||
"cereal",
|
||||
"cuda",
|
||||
"cudnn",
|
||||
{
|
||||
"name": "flashlight-cuda",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"lib"
|
||||
]
|
||||
},
|
||||
"nccl",
|
||||
"openmpi"
|
||||
]
|
||||
},
|
||||
"imgclass": {
|
||||
"description": "flashlight image classification app",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "flashlight-cuda",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"fl"
|
||||
]
|
||||
},
|
||||
"gflags"
|
||||
]
|
||||
},
|
||||
"lib": {
|
||||
"description": "flashlight libraries",
|
||||
"dependencies": [
|
||||
"cub",
|
||||
"fftw3",
|
||||
"intel-mkl",
|
||||
"kenlm"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user