File tree 4 files changed +17
-14
lines changed
4 files changed +17
-14
lines changed Original file line number Diff line number Diff line change @@ -71,3 +71,5 @@ add_subdirectory(src/examples)
71
71
add_subdirectory (test )
72
72
73
73
FILE (COPY src/resources/logging.yaml DESTINATION "${CMAKE_INSTALL_PREFIX} /resources" )
74
+
75
+ install (SCRIPT "install.cmake" )
Original file line number Diff line number Diff line change @@ -95,18 +95,6 @@ function build() {
95
95
fi
96
96
}
97
97
98
- function install_torchserve_cpp() {
99
- TARGET_DIR=` python -c " import ts; from pathlib import Path; print(Path(ts.__file__).parent / 'cpp')" `
100
-
101
- if [ -d $TARGET_DIR ]; then
102
- rm -rf $TARGET_DIR
103
- fi
104
- mkdir $TARGET_DIR
105
- cp -rp $BASE_DIR /_build/bin $TARGET_DIR /bin
106
- cp -rp $BASE_DIR /_build/libs $TARGET_DIR /lib
107
- cp -rp $BASE_DIR /_build/resources $TARGET_DIR /resources
108
- }
109
-
110
98
# Parse args
111
99
JOBS=8
112
100
WITH_QUIC=false
@@ -168,4 +156,3 @@ cd $BASE_DIR
168
156
git submodule update --init --recursive
169
157
170
158
build
171
- install_torchserve_cpp
Original file line number Diff line number Diff line change
1
+ execute_process (COMMAND python -c "import ts; from pathlib import Path; print(Path(ts.__file__).parent / 'cpp')"
2
+ OUTPUT_VARIABLE TARGET_DIR
3
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
4
+
5
+ message ("Installing cpp backend into ${TARGET_DIR} " )
6
+
7
+ if (EXISTS ${TARGET_DIR} )
8
+ execute_process (COMMAND rm -rf ${TARGET_DIR} )
9
+ endif ()
10
+
11
+ execute_process (COMMAND mkdir ${TARGET_DIR} )
12
+ execute_process (COMMAND cp -rp ${CMAKE_BINARY_DIR} /bin ${TARGET_DIR} /bin)
13
+ execute_process (COMMAND cp -rp ${CMAKE_BINARY_DIR} /libs ${TARGET_DIR} /lib)
14
+ execute_process (COMMAND cp -rp ${CMAKE_BINARY_DIR} /resources ${TARGET_DIR} /resources)
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ FetchContent_Declare(
16
16
17
17
FetchContent_MakeAvailable(tokenizer_bin stories15M_bin)
18
18
19
- add_library (llama2_c STATIC ../../../cpp/third-party/llama2.c/run.c)
19
+ add_library (llama2_c STATIC ${CMAKE_CURRENT_SOURCE_DIR} / ../../../cpp/third-party/llama2.c/run.c)
20
20
target_compile_options (llama2_c PRIVATE -Wall -Wextra -Ofast -fPIC)
21
21
22
22
add_library (babyllama_handler SHARED src/baby_llama_handler.cc)
You can’t perform that action at this time.
0 commit comments