CMakeLists.txt 6.3 KB
Newer Older
J
jinhai 已提交
1
#-------------------------------------------------------------------------------
2
# Copyright (C) 2019-2020 Zilliz. All rights reserved.
J
jinhai 已提交
3
#
4 5
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
J
jinhai 已提交
6
#
7 8 9 10 11
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under the License
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing permissions and limitations under the License.
J
jinhai 已提交
12 13
#-------------------------------------------------------------------------------

Z
zhiru 已提交
14 15
include_directories(${MILVUS_SOURCE_DIR})
include_directories(${MILVUS_ENGINE_SRC})
W
wxyu 已提交
16
include_directories(${MILVUS_THIRDPARTY_SRC})
J
jinhai 已提交
17

S
starlord 已提交
18 19
include_directories(${MILVUS_ENGINE_SRC}/grpc/gen-status)
include_directories(${MILVUS_ENGINE_SRC}/grpc/gen-milvus)
Z
zhiru 已提交
20

21
set(FOUND_OPENBLAS "unknown")
22

S
starlord 已提交
23
add_subdirectory(index)
S
starlord 已提交
24 25
set(INDEX_INCLUDE_DIRS ${INDEX_INCLUDE_DIRS} PARENT_SCOPE)
foreach (dir ${INDEX_INCLUDE_DIRS})
Z
zhiru 已提交
26
    include_directories(${dir})
Z
zhiru 已提交
27
endforeach ()
Z
zhiru 已提交
28

Z
zhiru 已提交
29
set(grpc_service_files
Z
update  
zhiru 已提交
30 31 32 33
        ${MILVUS_ENGINE_SRC}/grpc/gen-milvus/milvus.grpc.pb.cc
        ${MILVUS_ENGINE_SRC}/grpc/gen-milvus/milvus.pb.cc
        ${MILVUS_ENGINE_SRC}/grpc/gen-status/status.grpc.pb.cc
        ${MILVUS_ENGINE_SRC}/grpc/gen-status/status.pb.cc
Z
zhiru 已提交
34 35
        )

Z
update  
zhiru 已提交
36 37 38 39
aux_source_directory(${MILVUS_ENGINE_SRC}/scheduler scheduler_main_files)
aux_source_directory(${MILVUS_ENGINE_SRC}/scheduler/action scheduler_action_files)
aux_source_directory(${MILVUS_ENGINE_SRC}/scheduler/event scheduler_event_files)
aux_source_directory(${MILVUS_ENGINE_SRC}/scheduler/job scheduler_job_files)
40
aux_source_directory(${MILVUS_ENGINE_SRC}/scheduler/selector scheduler_selector_files)
Z
update  
zhiru 已提交
41 42
aux_source_directory(${MILVUS_ENGINE_SRC}/scheduler/resource scheduler_resource_files)
aux_source_directory(${MILVUS_ENGINE_SRC}/scheduler/task scheduler_task_files)
Z
zhiru 已提交
43
set(scheduler_files
Z
update  
zhiru 已提交
44
        ${scheduler_main_files}
W
wxyu 已提交
45 46
        ${scheduler_action_files}
        ${scheduler_event_files}
W
wxyu 已提交
47
        ${scheduler_job_files}
48
        ${scheduler_selector_files}
W
wxyu 已提交
49 50 51 52
        ${scheduler_resource_files}
        ${scheduler_task_files}
        )

53
aux_source_directory(${MILVUS_ENGINE_SRC}/server server_service_files)
B
BossZou 已提交
54
aux_source_directory(${MILVUS_ENGINE_SRC}/server/init server_init_files)
55
aux_source_directory(${MILVUS_ENGINE_SRC}/server/delivery/request delivery_request_files)
56
aux_source_directory(${MILVUS_ENGINE_SRC}/server/delivery/strategy delivery_strategy_files)
57 58
aux_source_directory(${MILVUS_ENGINE_SRC}/server/delivery delivery_files)
set(server_files
B
BossZou 已提交
59
        ${server_init_files}
60
        ${server_service_files}
W
Wang XiangYu 已提交
61
        ${server_init_files}
62
        ${delivery_request_files}
63
        ${delivery_strategy_files}
64 65 66
        ${delivery_files}
        )

G
groot 已提交
67
aux_source_directory(${MILVUS_ENGINE_SRC}/server/grpc_impl grpc_impl_files)
Z
Zhiru Zhu 已提交
68 69
aux_source_directory(${MILVUS_ENGINE_SRC}/server/grpc_impl/interceptor grpc_interceptor_files)
aux_source_directory(${MILVUS_ENGINE_SRC}/server/context server_context_files)
G
groot 已提交
70 71 72
set(grpc_server_files
        ${grpc_request_files}
        ${grpc_impl_files}
Z
Zhiru Zhu 已提交
73
        ${grpc_interceptor_files}
G
groot 已提交
74 75
        )

B
BossZou 已提交
76 77 78 79
aux_source_directory(${MILVUS_ENGINE_SRC}/server/web_impl/handler web_handler_files)
aux_source_directory(${MILVUS_ENGINE_SRC}/server/web_impl/component web_conponent_files)
aux_source_directory(${MILVUS_ENGINE_SRC}/server/web_impl/controller web_controller_files)
aux_source_directory(${MILVUS_ENGINE_SRC}/server/web_impl/dto web_dto_files)
80
aux_source_directory(${MILVUS_ENGINE_SRC}/server/web_impl/utils web_utils_files)
B
BossZou 已提交
81 82 83 84 85 86
aux_source_directory(${MILVUS_ENGINE_SRC}/server/web_impl web_impl_files)
set(web_server_files
        ${web_handler_files}
        ${web_conponent_files}
        ${web_controller_files}
        ${web_dto_files}
87
        ${web_utils_files}
B
BossZou 已提交
88 89 90
        ${web_impl_files}
        )

C
Cai Yudong 已提交
91 92 93 94 95
set(s3_client_lib
        aws-cpp-sdk-s3
        aws-cpp-sdk-core
        )

96
add_subdirectory(utils)
97
add_subdirectory(metrics)
X
XuanYang-cn 已提交
98 99 100 101
add_subdirectory(config)
add_subdirectory(tracing)
add_subdirectory(query)
add_subdirectory(db) # target milvus_engine
W
Wang XiangYu 已提交
102
add_subdirectory(log)
C
Cai Yudong 已提交
103

X
XuanYang-cn 已提交
104 105
# **************************** Get&Print Include Directories ****************************
get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES )
106

X
XuanYang-cn 已提交
107 108 109
foreach (dir ${dirs})
    message(STATUS "Current Include DIRS: "${dir})
endforeach ()
W
wxyu 已提交
110

Y
yu yunfeng 已提交
111

G
groot 已提交
112
set(server_libs
G
groot 已提交
113
        milvus_engine
W
Wang XiangYu 已提交
114
        config
Y
yu yunfeng 已提交
115
        metrics
Z
Zhiru Zhu 已提交
116
        tracing
W
Wang XiangYu 已提交
117
        log
B
BossZou 已提交
118
        oatpp
119
        query
120
        utils
G
groot 已提交
121
        )
G
groot 已提交
122

S
starlord 已提交
123
add_executable(milvus_server
124
        ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp
125
        ${context_files}
Z
zhiru 已提交
126
        ${scheduler_files}
S
starlord 已提交
127
        ${server_files}
Z
zhiru 已提交
128
        ${grpc_server_files}
S
starlord 已提交
129
        ${grpc_service_files}
B
BossZou 已提交
130
        ${web_server_files}
Z
Zhiru Zhu 已提交
131
        ${server_context_files}
S
starlord 已提交
132
        )
Y
yu yunfeng 已提交
133

S
starlord 已提交
134 135 136
target_link_libraries(milvus_server
        ${server_libs}
        )
S
starlord 已提交
137 138 139

install(TARGETS milvus_server DESTINATION bin)

140 141 142 143
install(FILES
        ${CMAKE_BINARY_DIR}/mysqlpp_ep-prefix/src/mysqlpp_ep/lib/${CMAKE_SHARED_LIBRARY_PREFIX}mysqlpp${CMAKE_SHARED_LIBRARY_SUFFIX}
        ${CMAKE_BINARY_DIR}/mysqlpp_ep-prefix/src/mysqlpp_ep/lib/${CMAKE_SHARED_LIBRARY_PREFIX}mysqlpp${CMAKE_SHARED_LIBRARY_SUFFIX}.3
        ${CMAKE_BINARY_DIR}/mysqlpp_ep-prefix/src/mysqlpp_ep/lib/${CMAKE_SHARED_LIBRARY_PREFIX}mysqlpp${CMAKE_SHARED_LIBRARY_SUFFIX}.3.2.4
144 145 146
        ${CMAKE_BINARY_DIR}/fiu_ep-prefix/src/fiu_ep/lib/${CMAKE_SHARED_LIBRARY_PREFIX}fiu${CMAKE_SHARED_LIBRARY_SUFFIX}
        ${CMAKE_BINARY_DIR}/fiu_ep-prefix/src/fiu_ep/lib/${CMAKE_SHARED_LIBRARY_PREFIX}fiu${CMAKE_SHARED_LIBRARY_SUFFIX}.0
        ${CMAKE_BINARY_DIR}/fiu_ep-prefix/src/fiu_ep/lib/${CMAKE_SHARED_LIBRARY_PREFIX}fiu${CMAKE_SHARED_LIBRARY_SUFFIX}.1.00
Z
zhiru 已提交
147
        DESTINATION lib)
O
op-hunter 已提交
148

149
if (FOUND_OPENBLAS STREQUAL "false")
O
op-hunter 已提交
150
    install(FILES
151 152 153 154
        ${CMAKE_BINARY_DIR}/src/index/openblas_ep-prefix/src/openblas_ep/lib/${CMAKE_SHARED_LIBRARY_PREFIX}openblas${CMAKE_SHARED_LIBRARY_SUFFIX}
        ${CMAKE_BINARY_DIR}/src/index/openblas_ep-prefix/src/openblas_ep/lib/${CMAKE_SHARED_LIBRARY_PREFIX}openblas${CMAKE_SHARED_LIBRARY_SUFFIX}.0
        ${CMAKE_BINARY_DIR}/src/index/openblas_ep-prefix/src/openblas_ep/lib/${CMAKE_SHARED_LIBRARY_PREFIX}openblas${CMAKE_SHARED_LIBRARY_SUFFIX}.0.3
        DESTINATION lib)
W
Wang XiangYu 已提交
155
endif()