CMakeLists.txt 4.9 KB
Newer Older
J
jinhai 已提交
1
#-------------------------------------------------------------------------------
J
jinhai 已提交
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you 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
#
#   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 已提交
18
#-------------------------------------------------------------------------------
S
starlord 已提交
19

Y
youny626 已提交
20
foreach (dir ${INDEX_INCLUDE_DIRS})
S
starlord 已提交
21
    include_directories(${dir})
Y
youny626 已提交
22
endforeach ()
S
starlord 已提交
23

Z
zhiru 已提交
24 25
include_directories(${MILVUS_SOURCE_DIR})
include_directories(${MILVUS_ENGINE_SRC})
S
starlord 已提交
26
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
Z
zhiru 已提交
27

S
starlord 已提交
28
aux_source_directory(${MILVUS_ENGINE_SRC}/cache cache_files)
Z
zhiru 已提交
29
aux_source_directory(${MILVUS_ENGINE_SRC}/config config_files)
S
starlord 已提交
30
aux_source_directory(${MILVUS_ENGINE_SRC}/metrics metrics_files)
Z
zhiru 已提交
31 32 33 34 35 36
aux_source_directory(${MILVUS_ENGINE_SRC}/db db_main_files)
aux_source_directory(${MILVUS_ENGINE_SRC}/db/engine db_engine_files)
aux_source_directory(${MILVUS_ENGINE_SRC}/db/insert db_insert_files)
aux_source_directory(${MILVUS_ENGINE_SRC}/db/meta db_meta_files)

set(grpc_service_files
Z
update  
zhiru 已提交
37 38 39 40
        ${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 已提交
41 42
        )

Z
update  
zhiru 已提交
43
aux_source_directory(${MILVUS_ENGINE_SRC}/scheduler scheduler_main_files)
Z
zhiru 已提交
44 45 46 47 48
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)
aux_source_directory(${MILVUS_ENGINE_SRC}/scheduler/resource scheduler_resource_files)
aux_source_directory(${MILVUS_ENGINE_SRC}/scheduler/task scheduler_task_files)
49
aux_source_directory(${MILVUS_ENGINE_SRC}/scheduler/optimizer scheduler_optimizer_files)
Z
zhiru 已提交
50
set(scheduler_files
Z
update  
zhiru 已提交
51
        ${scheduler_main_files}
Z
zhiru 已提交
52 53 54 55 56
        ${scheduler_action_files}
        ${scheduler_event_files}
        ${scheduler_job_files}
        ${scheduler_resource_files}
        ${scheduler_task_files}
57
        ${scheduler_optimizer_files}
Z
zhiru 已提交
58 59
        )

W
wxyu 已提交
60 61 62 63 64 65 66
aux_source_directory(${MILVUS_ENGINE_SRC}/external/easyloggingpp external_easyloggingpp_files)
aux_source_directory(${MILVUS_ENGINE_SRC}/external/nlohmann external_nlohmann_files)
set(external_files
        ${external_easyloggingpp_files}
        ${external_nlohmann_files}
        )

Z
zhiru 已提交
67 68 69
aux_source_directory(${MILVUS_ENGINE_SRC}/server server_files)
aux_source_directory(${MILVUS_ENGINE_SRC}/server/grpc_impl grpc_server_files)
aux_source_directory(${MILVUS_ENGINE_SRC}/utils utils_files)
Z
update  
zhiru 已提交
70
aux_source_directory(${MILVUS_ENGINE_SRC}/wrapper wrapper_files)
71

S
starlord 已提交
72
set(entry_file
G
groot 已提交
73
        ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp)
J
jinhai 已提交
74

Z
zhiru 已提交
75
set(helper_files
S
starlord 已提交
76
        ${MILVUS_ENGINE_SRC}/server/Config.cpp
77 78
        ${MILVUS_ENGINE_SRC}/utils/CommonUtil.cpp
        ${MILVUS_ENGINE_SRC}/utils/TimeRecorder.cpp
Z
zhiru 已提交
79
        ${MILVUS_ENGINE_SRC}/utils/Status.cpp
G
groot 已提交
80
        ${MILVUS_ENGINE_SRC}/utils/StringHelpFunctions.cpp
Z
zhiru 已提交
81
        ${MILVUS_ENGINE_SRC}/utils/ValidationUtil.cpp
W
wxyu 已提交
82
        ${MILVUS_ENGINE_SRC}/external/easyloggingpp/easylogging++.cc
83 84
        )

Z
update  
zhiru 已提交
85 86 87 88 89 90 91 92
set(common_files
        ${cache_files}
        ${config_files}
        ${db_main_files}
        ${db_engine_files}
        ${db_insert_files}
        ${db_meta_files}
        ${metrics_files}
W
wxyu 已提交
93
        ${external_files}
Z
update  
zhiru 已提交
94
        ${scheduler_files}
Z
update  
zhiru 已提交
95
        ${wrapper_files}
Z
update  
zhiru 已提交
96 97 98
        ${helper_files}
        )

J
jinhai 已提交
99
set(unittest_libs
Z
update  
zhiru 已提交
100
        sqlite
101 102
        libboost_system.a
        libboost_filesystem.a
Z
update  
zhiru 已提交
103
        mysqlpp
G
groot 已提交
104
        yaml-cpp
Z
zhiru 已提交
105 106
        gtest
        gmock
J
jinhai 已提交
107 108
        gtest_main
        gmock_main
Y
yu yunfeng 已提交
109
        pthread
Z
zhiru 已提交
110
        metrics
111 112 113 114 115 116 117
        gfortran
        prometheus-cpp-pull
        prometheus-cpp-push
        prometheus-cpp-core
        dl
        z
        )
J
jinhai 已提交
118

Y
youny626 已提交
119 120 121 122 123 124 125 126 127 128 129 130
if (MILVUS_GPU_VERSION)
    include_directories("${CUDA_INCLUDE_DIRS}")
    link_directories("${CUDA_TOOLKIT_ROOT_DIR}/lib64")
    set(unittest_libs ${unittest_libs}
            ${CUDA_TOOLKIT_ROOT_DIR}/lib64/stubs/libnvidia-ml.so
            cudart
            cublas
            )
    aux_source_directory(${MILVUS_ENGINE_SRC}/wrapper/gpu wrapper_gpu_files)
    set(common_files ${common_files}
            ${wrapper_gpu_files}
            )
Y
youny626 已提交
131
endif ()
Y
youny626 已提交
132

G
groot 已提交
133
add_subdirectory(db)
Z
update  
zhiru 已提交
134
add_subdirectory(wrapper)
135
add_subdirectory(metrics)
136
add_subdirectory(scheduler)
Z
update  
zhiru 已提交
137
add_subdirectory(server)