diff options
| author | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
|---|---|---|
| committer | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
| commit | 54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch) | |
| tree | d915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/flashlight-cuda | |
Diffstat (limited to 'vcpkg/ports/flashlight-cuda')
| -rw-r--r-- | vcpkg/ports/flashlight-cuda/portfile.cmake | 86 | ||||
| -rw-r--r-- | vcpkg/ports/flashlight-cuda/vcpkg.json | 110 |
2 files changed, 196 insertions, 0 deletions
diff --git a/vcpkg/ports/flashlight-cuda/portfile.cmake b/vcpkg/ports/flashlight-cuda/portfile.cmake new file mode 100644 index 0000000..49582ff --- /dev/null +++ b/vcpkg/ports/flashlight-cuda/portfile.cmake @@ -0,0 +1,86 @@ +if (EXISTS "${CURRENT_INSTALLED_DIR}/share/flashlight") + message(FATAL_ERROR "Only one of flashlight-cpu and flashlight-cuda" + "can be installed at once. Uninstall and try again:" + "\n vcpkg remove flashlight-cuda\n") +endif() + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO flashlight/flashlight + REF 626914e79073c5547513de649af706f7e2b796ad # 0.3 branch tip + SHA512 a22057cfa4cfe7acd95cbc5445a30870cce3cdde89066d1d75f40be0d73b069a49e89b226fe5337488cfe5618dd25958679c0636a3e4008312f01606328becfa + 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 +) + +# Determine which components to build via specified feature +vcpkg_check_features( + OUT_FEATURE_OPTIONS FEATURE_OPTIONS + FEATURES + lib FL_BUILD_LIBRARIES + fl FL_BUILD_CORE + asr FL_BUILD_APP_ASR + imgclass FL_BUILD_APP_IMGCLASS + lm FL_BUILD_APP_LM + objdet FL_BUILD_APP_OBJDET +) + +# Build and install +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + ${FL_DEFAULT_VCPKG_CMAKE_FLAGS} + ${FEATURE_OPTIONS} + OPTIONS_DEBUG + "-DFL_INSTALL_CMAKE_DIR=${CURRENT_PACKAGES_DIR}/debug/share/flashlight" + OPTIONS_RELEASE + "-DFL_INSTALL_CMAKE_DIR=${CURRENT_PACKAGES_DIR}/share/flashlight" +) +vcpkg_cmake_install() + +vcpkg_cmake_config_fixup(PACKAGE_NAME flashlight) + +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_img_imagenet_resnet34 + fl_img_imagenet_eval + fl_img_imagenet_vit + ) +endif() +if ("asr" IN_LIST FEATURES) + list(APPEND FLASHLIGHT_TOOLS + fl_asr_train + fl_asr_test + fl_asr_decode + fl_asr_align + fl_asr_voice_activity_detection_ctc + fl_asr_arch_benchmark + ) +endif() +if ("lm" IN_LIST FEATURES) + list(APPEND FLASHLIGHT_TOOLS + fl_lm_dictionary_builder + fl_lm_train + fl_lm_test + ) +endif() +list(LENGTH FLASHLIGHT_TOOLS NUM_TOOLS) +if (NUM_TOOLS GREATER 0) + vcpkg_copy_tools(TOOL_NAMES ${FLASHLIGHT_TOOLS} AUTO_CLEAN) +endif() + +# Copyright +file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
\ No newline at end of file diff --git a/vcpkg/ports/flashlight-cuda/vcpkg.json b/vcpkg/ports/flashlight-cuda/vcpkg.json new file mode 100644 index 0000000..6ed1b9e --- /dev/null +++ b/vcpkg/ports/flashlight-cuda/vcpkg.json @@ -0,0 +1,110 @@ +{ + "name": "flashlight-cuda", + "version": "0.3", + "port-version": 7, + "description": "A C++ standalone library for machine learning. CUDA backend.", + "homepage": "https://github.com/facebookresearch/flashlight", + "license": "MIT", + "supports": "!(windows | osx)", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ], + "default-features": [ + "fl" + ], + "features": { + "asr": { + "description": "flashlight asr app", + "dependencies": [ + { + "name": "flashlight-cuda", + "features": [ + "fl", + "lib" + ] + }, + "gflags", + { + "name": "libsndfile", + "default-features": false, + "features": [ + "external-libs" + ] + } + ] + }, + "fl": { + "description": "flashlight core autograd and neural net library", + "dependencies": [ + { + "name": "arrayfire", + "features": [ + "cuda" + ] + }, + "cereal", + "cuda", + "cudnn", + "nccl", + "openmpi", + "stb" + ] + }, + "imgclass": { + "description": "flashlight image classification app", + "dependencies": [ + { + "name": "flashlight-cuda", + "features": [ + "fl", + "lib" + ] + }, + "gflags" + ] + }, + "lib": { + "description": "flashlight libraries", + "dependencies": [ + "cuda", + "fftw3", + "intel-mkl", + "kenlm" + ] + }, + "lm": { + "description": "flashlight lm app", + "dependencies": [ + { + "name": "flashlight-cuda", + "features": [ + "fl", + "lib" + ] + }, + "gflags" + ] + }, + "objdet": { + "description": "flashlight object detection app", + "dependencies": [ + { + "name": "flashlight-cuda", + "features": [ + "fl", + "imgclass", + "lib" + ] + }, + "gflags" + ] + } + } +} |