CMakeLists.txt 4.9 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
set(INDEX_INCLUDE_DIRS ${INDEX_INCLUDE_DIRS} PARENT_SCOPE)
25 26
foreach (DIR ${INDEX_INCLUDE_DIRS})
    include_directories(${DIR})
Z
zhiru 已提交
27
endforeach ()
Z
zhiru 已提交
28

29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
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 )
aux_source_directory( ${MILVUS_ENGINE_SRC}/scheduler/selector   SCHEDULER_SELECTOR_FILES )
aux_source_directory( ${MILVUS_ENGINE_SRC}/scheduler/resource   SCHEDULER_RESOURCE_FILES )
aux_source_directory( ${MILVUS_ENGINE_SRC}/scheduler/task       SCHEDULER_TASK_FILES )

set( SCHEDULER_FILES  ${SCHEDULER_MAIN_FILES}
                      ${SCHEDULER_ACTION_FILES}
                      ${SCHEDULER_EVENT_FILES}
                      ${SCHEDULER_JOB_FILES}
                      ${SCHEDULER_SELECTOR_FILES}
                      ${SCHEDULER_RESOURCE_FILES}
                      ${SCHEDULER_TASK_FILES}
                      )

46 47 48 49 50
# dependencies of target milvus_engine
add_subdirectory( storage )
add_subdirectory( cache )
add_subdirectory( codecs )
add_subdirectory( segment )
51
add_subdirectory( tracing )
52

53 54 55 56 57 58
add_subdirectory( utils )
add_subdirectory( metrics )
add_subdirectory( config )
add_subdirectory( query )
add_subdirectory( db ) # target milvus_engine
add_subdirectory( log )
59 60
add_subdirectory( server )

61 62 63 64 65 66 67 68 69 70
set(link_lib
        milvus_engine
        config
        metrics
        log
        oatpp
        query
        utils
        )

71

72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
if (MILVUS_WITH_PROMETHEUS)
    set(link_lib
            ${link_lib}
            # dependency prometheus
            prometheus-cpp-push
            prometheus-cpp-pull
            prometheus-cpp-core
            )
endif ()

set(link_lib
        ${link_lib}
        curl
        )

87
target_link_libraries( server
88
                PUBLIC ${link_lib}
89
                       )
C
Cai Yudong 已提交
90

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

94
foreach ( dir ${dirs} )
95
    message( STATUS "Current Include DIRS: " ${dir} )
X
XuanYang-cn 已提交
96
endforeach ()
W
wxyu 已提交
97

98
set( SERVER_LIBS server )
99 100 101 102 103 104


add_executable( milvus_server   ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp
                                ${SCHEDULER_FILES}
                                )

105
target_link_libraries( milvus_server PRIVATE ${SERVER_LIBS} )
106 107 108 109 110 111 112 113 114 115 116 117 118
install( TARGETS milvus_server DESTINATION bin )

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
         ${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
         DESTINATION lib )

if ( FOUND_OPENBLAS STREQUAL "false" )
    install( FILES
119 120 121
        ${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
122
        DESTINATION lib )
W
Wang XiangYu 已提交
123
endif()