Skip to content

Commit 700c817

Browse files
gemfieldfacebook-github-bot
authored andcommitted
Add install for libCaffe2_perfkernels_avx*.a (#53825)
Summary: When build libtorch static library, these three static libraries will be generated but won't be installed to CMAKE_INSTALL_LIBDIR: - libCaffe2_perfkernels_avx2.a - libCaffe2_perfkernels_avx512.a - libCaffe2_perfkernels_avx.a This PR will fix this issue. Please be noted that after this fix there still have static libraries missing in CMAKE_INSTALL_LIBDIR, but they belong to third_party repo, and we need to fix in the corresponding repo: - libfoxi_loader.a - libonnx.a - libonnx_proto.a - libfmt.a - libnccl_static.a Pull Request resolved: #53825 Reviewed By: ngimel Differential Revision: D27013844 Pulled By: malfet fbshipit-source-id: 8a84cc72b6ae87393ca26c4e474f5526a7b18ab2
1 parent 2782126 commit 700c817

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

caffe2/perfkernels/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ if(CAFFE2_COMPILER_SUPPORTS_AVX2_EXTENSIONS)
2828
add_dependencies(Caffe2_perfkernels_avx2 Caffe2_PROTO)
2929
target_link_libraries(Caffe2_perfkernels_avx PRIVATE c10)
3030
target_link_libraries(Caffe2_perfkernels_avx2 PRIVATE c10)
31+
install(TARGETS Caffe2_perfkernels_avx Caffe2_perfkernels_avx2
32+
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}")
33+
3134
if(MSVC AND NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
3235
target_compile_options(Caffe2_perfkernels_avx
3336
PRIVATE "/arch:AVX"
@@ -61,6 +64,9 @@ if(CAFFE2_COMPILER_SUPPORTS_AVX2_EXTENSIONS)
6164
add_library(Caffe2_perfkernels_avx512 STATIC ${avx512_srcs})
6265
add_dependencies(Caffe2_perfkernels_avx512 Caffe2_PROTO)
6366
target_link_libraries(Caffe2_perfkernels_avx512 PRIVATE c10)
67+
install(TARGETS Caffe2_perfkernels_avx512
68+
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}")
69+
6470
if(MSVC AND NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
6571
target_compile_options(Caffe2_perfkernels_avx512
6672
PRIVATE "/D__AVX512F__"

0 commit comments

Comments
 (0)