forked from jplu/faiss-grpc-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
136 lines (120 loc) · 4.47 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
project(faiss-server)
#cmake_minimum_required(VERSION 3.11.4)
include(ExternalProject)
# c-ares
#set(CARES_VERSION 1_14_0)
#set(CARES_URL URL https://github.com/c-ares/c-ares/archive/cares-${CARES_VERSION}.zip)
#ExternalProject_Add(c-ares
# PREFIX c-ares
# URL ${CARES_URL}
# CMAKE_CACHE_ARGS
# -DCARES_SHARED:BOOL=OFF
# -DCARES_STATIC:BOOL=ON
# -DCARES_STATIC_PIC:BOOL=ON
# -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_CURRENT_BINARY_DIR}/c-ares
#)
# protobuf
#set(PROTOBUF_VERSION v3.9.1)
#set(PROTOBUF_URL https://github.com/google/protobuf/archive/${PROTOBUF_VERSION}.zip)
#ExternalProject_Add(protobuf
# PREFIX protobuf
# URL ${PROTOBUF_URL}
# SOURCE_SUBDIR cmake
# CMAKE_CACHE_ARGS
# -Dprotobuf_BUILD_TESTS:BOOL=OFF
# -Dprotobuf_WITH_ZLIB:BOOL=OFF
# -Dprotobuf_MSVC_STATIC_RUNTIME:BOOL=OFF
# -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_CURRENT_BINARY_DIR}/protobuf
#)
#set(_FINDPACKAGE_PROTOBUF_CONFIG_DIR "${CMAKE_CURRENT_BINARY_DIR}/protobuf/lib/cmake/protobuf")
#set(Protobuf_INCLUDE_DIR "${CMAKE_CURRENT_BINARY_DIR}/protobuf/include")
# zlib
#set(ZLIB_VERSION 1.2.11)
#set(ZLIB_URL https://zlib.net/zlib-${ZLIB_VERSION}.tar.gz)
#ExternalProject_Add(zlib
# PREFIX zlib
# URL ${ZLIB_URL}
# CMAKE_CACHE_ARGS
# -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_CURRENT_BINARY_DIR}/zlib
#)
# gRPC
#set(GRPC_VERSION v1.22.1)
#set(GRPC_URL https://github.com/grpc/grpc/archive/${GRPC_VERSION}.zip)
#ExternalProject_Add(grpc
# PREFIX grpc
# URL ${GRPC_URL}
# DEPENDS c-ares protobuf zlib
# CMAKE_CACHE_ARGS
# -DgRPC_INSTALL:BOOL=ON
# -DgRPC_BUILD_TESTS:BOOL=OFF
# -DgRPC_PROTOBUF_PROVIDER:STRING=package
# -DgRPC_PROTOBUF_PACKAGE_TYPE:STRING=CONFIG
# -DProtobuf_DIR:PATH=${_FINDPACKAGE_PROTOBUF_CONFIG_DIR}
# -DgRPC_ZLIB_PROVIDER:STRING=package
# -DZLIB_ROOT:STRING=${CMAKE_CURRENT_BINARY_DIR}/zlib
# -DgRPC_CARES_PROVIDER:STRING=package
# -Dc-ares_DIR:PATH=${CMAKE_CURRENT_BINARY_DIR}/c-ares/lib/cmake/c-ares
# -DgRPC_SSL_PROVIDER:STRING=package
# -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_CURRENT_BINARY_DIR}/grpc
#)
# faiss
#set(FAISS_VERSION v1.5.3)
#set(FAISS_URL https://github.com/facebookresearch/faiss/archive/${FAISS_VERSION}.tar.gz)
#set(FAISS_SOURCE ${CMAKE_CURRENT_BINARY_DIR}/faiss/src/faiss)
#set(FAISS_MAKEFILEINC_DEST ${FAISS_SOURCE}/makefile.inc)
#if(APPLE)
# set(FAISS_MAKEFILEINC_SRC ${FAISS_SOURCE}/example_makefiles/makefile.inc.Mac.brew)
# ExternalProject_Add(faiss
# PREFIX faiss
# URL ${FAISS_URL}
# CONFIGURE_COMMAND cp ${FAISS_MAKEFILEINC_SRC} ${FAISS_MAKEFILEINC_DEST}
# BUILD_COMMAND cd ${FAISS_SOURCE} && make install
# INSTALL_COMMAND ""
# CMAKE_CACHE_ARGS
# -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_CURRENT_BINARY_DIR}/faiss
# )
#elseif(UNIX)
# set(FAISS_MAKEFILEINC_SRC ${FAISS_SOURCE}/example_makefiles/makefile.inc.Linux)
# ExternalProject_Add(faiss
# PREFIX faiss
# URL ${FAISS_URL}
# CONFIGURE_COMMAND cp ${FAISS_MAKEFILEINC_SRC} ${FAISS_MAKEFILEINC_DEST} && cd ${FAISS_SOURCE} && ./configure --with-cuda=/usr/local/cuda-10.0 LIBS=-lgomp
# BUILD_COMMAND cd ${FAISS_SOURCE}
# INSTALL_COMMAND ""
# CMAKE_CACHE_ARGS
# -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_CURRENT_BINARY_DIR}/faiss
# )
#endif()
# gflags
#set(GFLAGS_VERSION v2.2.2)
#set(GFLAGS_URL https://github.com/gflags/gflags/archive/${GFLAGS_VERSION}.zip)
#ExternalProject_Add(gflags
# PREFIX gflags
# URL ${GFLAGS_URL}
# CMAKE_CACHE_ARGS
# -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_CURRENT_BINARY_DIR}/gflags
#)
# spdlog
#set(SPDLOG_VERSION v1.3.1)
#set(SPDLOG_URL https://github.com/gabime/spdlog/archive/${SPDLOG_VERSION}.zip)
#ExternalProject_Add(spdlog
# PREFIX spdlog
# URL ${SPDLOG_URL}
# CMAKE_CACHE_ARGS
# -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_CURRENT_BINARY_DIR}/spdlog
# -DSPDLOG_BUILD_BENCH:BOOL=OFF
#)
#set(SPDLOG_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR}/spdlog/include)
# faiss-server
ExternalProject_Add(faiss-server
PREFIX faiss-server
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src"
BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/bin"
INSTALL_COMMAND ""
# CMAKE_CACHE_ARGS
# -DProtobuf_DIR:PATH=${_FINDPACKAGE_PROTOBUF_CONFIG_DIR}
# -Dc-ares_DIR:PATH=${CMAKE_CURRENT_BINARY_DIR}/c-ares/lib/cmake/c-ares
# -DZLIB_ROOT:STRING=${CMAKE_CURRENT_BINARY_DIR}/zlib
# -DgRPC_DIR:PATH=${CMAKE_CURRENT_BINARY_DIR}/grpc/lib/cmake/grpc
# DEPENDS spdlog
)