Skip to content

Commit

Permalink
Exclude JAX FE from all distributions except wheel
Browse files Browse the repository at this point in the history
  • Loading branch information
ilya-lavrenov committed Sep 16, 2024
1 parent cd64efe commit c562037
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/fedora_29.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ jobs:
python3 -c 'from openvino import Core; Core().get_property("MULTI", "SUPPORTED_PROPERTIES")'
python3 -c 'from openvino import Core; Core().get_property("HETERO", "SUPPORTED_PROPERTIES")'
python3 -c 'from openvino import Core; Core().get_property("BATCH", "SUPPORTED_PROPERTIES")'
python3 -c 'from openvino.frontend import FrontEndManager; assert len(FrontEndManager().get_available_front_ends()) == 7'
python3 -c 'from openvino.frontend import FrontEndManager; assert len(FrontEndManager().get_available_front_ends()) == 6'
benchmark_app --help
opt_in_out --help
ovc --help
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/job_debian_packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ jobs:
python3 -c 'from openvino import Core; Core().get_property("MULTI", "SUPPORTED_PROPERTIES")'
python3 -c 'from openvino import Core; Core().get_property("HETERO", "SUPPORTED_PROPERTIES")'
python3 -c 'from openvino import Core; Core().get_property("BATCH", "SUPPORTED_PROPERTIES")'
python3 -c 'from openvino.frontend import FrontEndManager; assert len(FrontEndManager().get_available_front_ends()) == 7'
python3 -c 'from openvino.frontend import FrontEndManager; assert len(FrontEndManager().get_available_front_ends()) == 6'
benchmark_app --help
opt_in_out --help
ovc --help
18 changes: 12 additions & 6 deletions cmake/developer_package/frontends/frontends.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,14 @@ endmacro()
# FILEDESCRIPTION <description> # used on Windows to describe DLL file
# [LINKABLE_FRONTEND] # whether we can use FE API directly or via FEM only
# [SKIP_INSTALL] # private frontend, not for end users
# [DISABLE_CPP_INSTALL] # excludes frontend from all cmake rules
# [PROTOBUF_REQUIRED] # options to denote that protobuf is used
# [PROTOBUF_LITE] # requires only libprotobuf-lite
# [SKIP_NCC_STYLE] # use custom NCC rules
# [LINK_LIBRARIES <lib1 lib2 ...>])
#
macro(ov_add_frontend)
set(options LINKABLE_FRONTEND PROTOBUF_REQUIRED PROTOBUF_LITE SKIP_NCC_STYLE SKIP_INSTALL)
set(options LINKABLE_FRONTEND PROTOBUF_REQUIRED PROTOBUF_LITE SKIP_NCC_STYLE SKIP_INSTALL DISABLE_CPP_INSTALL)
set(oneValueArgs NAME FILEDESCRIPTION)
set(multiValueArgs LINK_LIBRARIES PROTO_FILES)
cmake_parse_arguments(OV_FRONTEND "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
Expand Down Expand Up @@ -306,30 +307,35 @@ macro(ov_add_frontend)
# installation

if(NOT OV_FRONTEND_SKIP_INSTALL)
# convert option (OFF / ON) to actual value
if(OV_FRONTEND_DISABLE_CPP_INSTALL)
set(frontend_exclude_from_all EXCLUDE_FROM_ALL)
endif()

if(BUILD_SHARED_LIBS)
# Note:
# we use 'framework' as component for deployment scenario, i.e. for libraries itself
# and use common 'core_dev' component for headers, cmake files and symlinks to versioned library
set(lib_component "${OV_FRONTEND_NAME}")
set(dev_component "${OV_CPACK_COMP_CORE_DEV}")

# TODO: whether we need to do it configuralbe on Windows installer?
ov_cpack_add_component(${lib_component} HIDDEN)

if(OV_FRONTEND_LINKABLE_FRONTEND)
if(OV_FRONTEND_LINKABLE_FRONTEND AND NOT OV_FRONTEND_DISABLE_CPP_INSTALL)
set(export_set EXPORT OpenVINOTargets)
set(archive_dest ARCHIVE DESTINATION ${OV_CPACK_ARCHIVEDIR} COMPONENT ${dev_component} ${OV_CPACK_COMP_CORE_DEV_EXCLUDE_ALL})
set(namelink NAMELINK_COMPONENT ${OV_CPACK_COMP_LINKS} ${OV_CPACK_COMP_LINKS_EXCLUDE_ALL})
else()
set(namelink NAMELINK_SKIP)
endif()
install(TARGETS ${TARGET_NAME} ${export_set}
RUNTIME DESTINATION ${OV_CPACK_RUNTIMEDIR} COMPONENT ${lib_component}
RUNTIME DESTINATION ${OV_CPACK_RUNTIMEDIR} COMPONENT ${lib_component} ${frontend_exclude_from_all}
${archive_dest}
LIBRARY DESTINATION ${OV_CPACK_LIBRARYDIR} COMPONENT ${lib_component}
LIBRARY DESTINATION ${OV_CPACK_LIBRARYDIR} COMPONENT ${lib_component} ${frontend_exclude_from_all}
${namelink})

# export to build tree
# Note: we keep this even with passed DISABLE_CPP_INSTALL to ensure that Python API can be built
if(OV_FRONTEND_LINKABLE_FRONTEND)
export(TARGETS ${TARGET_NAME} NAMESPACE openvino::
APPEND FILE "${CMAKE_BINARY_DIR}/OpenVINOTargets.cmake")
Expand All @@ -338,7 +344,7 @@ macro(ov_add_frontend)
ov_install_static_lib(${TARGET_NAME} ${OV_CPACK_COMP_CORE})
endif()

if(OV_FRONTEND_LINKABLE_FRONTEND)
if(OV_FRONTEND_LINKABLE_FRONTEND AND NOT OV_FRONTEND_DISABLE_CPP_INSTALL)
# install library development files
install(DIRECTORY ${${TARGET_NAME}_INCLUDE_DIR}/openvino
DESTINATION ${FRONTEND_INSTALL_INCLUDE}
Expand Down
1 change: 1 addition & 0 deletions src/frontends/jax/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ endif()

ov_add_frontend(NAME jax
LINKABLE_FRONTEND
DISABLE_CPP_INSTALL
FILEDESCRIPTION "FrontEnd to load and convert JAX/Flax models"
LINK_LIBRARIES openvino::util openvino::core::dev)

0 comments on commit c562037

Please sign in to comment.