File tree 3 files changed +28
-8
lines changed
3 files changed +28
-8
lines changed Original file line number Diff line number Diff line change @@ -13,11 +13,17 @@ jobs:
13
13
- run : mkdir ./ov/
14
14
- run : curl https://storage.openvinotoolkit.org/repositories/openvino/packages/nightly/2024.1.0-14758-22bd6ff0494/l_openvino_toolkit_centos7_2024.1.0.dev20240315_x86_64.tgz | tar --directory ./ov/ --strip-components 1 -xz # Install CentOS7 instead of Ubuntu to match PyPI distribution ABI
15
15
- run : sudo ./ov/install_dependencies/install_openvino_dependencies.sh
16
+ - run : source ./ov/setupvars.sh && cmake -DCMAKE_BUILD_TYPE=Release -S ./ -B ./build/
17
+ - run : cmake --build ./build/ -j
18
+ - run : source ./ov/setupvars.sh && PYTHONPATH=./src/python:$PYTHONPATH python -c "from openvino.genai.py_generate_pipeline import LLMPipeline"
16
19
- run : source ./ov/setupvars.sh && python -m pip install --pre . --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/nightly
17
20
- run : python -c "from openvino.genai.py_generate_pipeline import LLMPipeline"
18
21
19
22
genai_lib_windows :
20
23
runs-on : windows-latest
24
+ defaults :
25
+ run :
26
+ shell : cmd
21
27
steps :
22
28
- uses : actions/checkout@v4
23
29
with :
27
33
python-version : 3.8
28
34
- run : curl --output ov.zip https://storage.openvinotoolkit.org/repositories/openvino/packages/nightly/2024.1.0-14645-e6dc0865128/w_openvino_toolkit_windows_2024.1.0.dev20240304_x86_64.zip
29
35
- run : unzip ov.zip
36
+ - run : call w_openvino_toolkit_windows_2024.1.0.dev20240304_x86_64\setupvars.bat && cmake -DCMAKE_BUILD_TYPE=Release -S ./ -B ./build/
37
+ - run : cmake --build ./build/ -j
38
+ - run : call w_openvino_toolkit_windows_2024.1.0.dev20240304_x86_64\setupvars.bat && set PYTHONPATH=./src/python:$PYTHONPATH && python -c "from openvino.genai.py_generate_pipeline import LLMPipeline"
30
39
- run : call w_openvino_toolkit_windows_2024.1.0.dev20240304_x86_64\setupvars.bat && python -m pip install .
31
- shell : cmd
32
40
- run : python -c "from openvino.genai.py_generate_pipeline import LLMPipeline"
Original file line number Diff line number Diff line change @@ -31,10 +31,10 @@ function(ov_genai_build_jinja2cpp)
31
31
32
32
add_subdirectory ("${jinja2cpp_SOURCE_DIR} " "${jinja2cpp_BINARY_DIR} " EXCLUDE_FROM_ALL )
33
33
# openvino::runtime exports _GLIBCXX_USE_CXX11_ABI=0 on CenOS7.
34
- # It needs to be propagated to every lib GenAI links with. It's
35
- # enough to propagate it to fmt, because fmt propagates to
34
+ # It needs to be propagated to every library GenAI links with.
35
+ # It's enough to propagate to fmt, because fmt propagates to
36
36
# jinja2cpp.
37
- target_link_libraries (fmt PUBLIC openvino::runtime)
37
+ target_compile_definitions (fmt PUBLIC $<TARGET_PROPERTY: openvino::runtime, INTERFACE_COMPILE_DEFINITIONS > )
38
38
endif ()
39
39
endfunction ()
40
40
@@ -57,4 +57,12 @@ target_link_libraries(${TARGET_NAME} PUBLIC openvino::runtime PRIVATE nlohmann_j
57
57
target_compile_definitions (${TARGET_NAME} PRIVATE OPENVINO_TOKENIZERS_PATH=\"$<TARGET_FILE:openvino_tokenizers>\")
58
58
59
59
target_compile_features (${TARGET_NAME} PUBLIC cxx_std_17)
60
+
60
61
install (TARGETS ${TARGET_NAME} LIBRARY DESTINATION . COMPONENT genai RUNTIME DESTINATION . COMPONENT genai)
62
+
63
+ # Populate python with the libraries to allow skipping wheel installation
64
+ add_custom_command (TARGET generate_pipeline_lib POST_BUILD
65
+ COMMAND "${CMAKE_COMMAND} " -E copy
66
+ "$<TARGET_FILE:generate_pipeline_lib>"
67
+ "${CMAKE_CURRENT_SOURCE_DIR} /../python/openvino/genai/$<TARGET_FILE_NAME:generate_pipeline_lib>"
68
+ COMMENT "Copy generate_pipeline_lib to src/python/openvino/genai" )
Original file line number Diff line number Diff line change @@ -17,16 +17,13 @@ endif()
17
17
18
18
pybind11_add_module(py_generate_pipeline py_generate_pipeline.cpp)
19
19
target_link_libraries (py_generate_pipeline PRIVATE generate_pipeline_lib)
20
+
20
21
install (TARGETS py_generate_pipeline LIBRARY DESTINATION . COMPONENT genai_python)
21
22
22
23
# setting RPATH / LC_RPATH depending on platform
23
24
if (LINUX)
24
25
# to find libgenerate_pipeline_lib.so in the same folder
25
26
set (rpaths "$ORIGIN" )
26
- if (DEFINED SKBUILD)
27
- # in case we build pip package, we need to refer to libopenvino.so from 'openvino' package
28
- list (APPEND rpaths "@ORIGIN/../../openvino/libs" )
29
- endif ()
30
27
elseif (APPLE )
31
28
# to find libgenerate_pipeline_lib.dylib in the same folder
32
29
set (rpaths "@loader_path" )
@@ -39,3 +36,10 @@ endif()
39
36
if (rpaths)
40
37
set_target_properties (py_generate_pipeline PROPERTIES INSTALL_RPATH "${rpaths} " )
41
38
endif ()
39
+
40
+ # Populate python with the libraries to allow skipping wheel installation
41
+ add_custom_command (TARGET py_generate_pipeline POST_BUILD
42
+ COMMAND "${CMAKE_COMMAND} " -E copy
43
+ "$<TARGET_FILE:py_generate_pipeline>"
44
+ "${CMAKE_CURRENT_SOURCE_DIR} /openvino/genai/$<TARGET_FILE_NAME:py_generate_pipeline>"
45
+ COMMENT "Copy py_generate_pipeline to src/python/openvino/genai" )
You can’t perform that action at this time.
0 commit comments