[flashlight-cuda] New Port (#14676)

* [flashlight-cuda] New Port

* Rebase on NCCL port, update commit

* Add default feature (fl)
This commit is contained in:
Jacob Kahn 2020-11-30 12:05:02 -06:00 committed by GitHub
parent e95a7a8dc0
commit b7f03b4635
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 127 additions and 0 deletions

View 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)

View 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"
]
}
}
}