-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: clean up cmake and move go part to Milvus #168
Changes from all commits
b2f5d94
9fa8fc8
e9c0a1a
0bcdd31
bb83fc0
cb4fbbc
9f70251
887dc99
0769f2c
e9bc697
a538bc0
6326ff6
bf4cb4d
c20578d
5deb556
5e78ef1
c15aae6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,3 +11,4 @@ go/.idea/* | |
compile_commands.json | ||
CMakeUserPresets.json | ||
.vscode/* | ||
go/internal/core/output/* | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
cmake_minimum_required(VERSION 3.20.0) | ||
|
||
project(milvus-storage VERSION 0.1.0) | ||
set(CMAKE_CXX_STANDARD 17) | ||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON) | ||
|
||
option(WITH_UT "Build the testing tree." ON) | ||
option(WITH_UT "Build the testing tree." OFF) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we still have UT if this option is turned off? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. test bin is moved into |
||
option(WITH_ASAN "Build with address sanitizer." OFF) | ||
option(WITH_OPENDAL "Build with opendal." OFF) | ||
option(WITH_BENCHMARK "Build with micro benchmark." OFF) | ||
option(WITH_AZURE_FS "Build with azure file system." ON) | ||
|
||
set(CMAKE_CXX_STANDARD 17) | ||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON) | ||
set(CMAKE_INSTALL_PREFIX ${CMAKE_CURRENT_BINARY_DIR}) | ||
include(GNUInstallDirs) | ||
|
||
if (WITH_OPENDAL) | ||
|
@@ -19,57 +19,64 @@ if (WITH_OPENDAL) | |
endif() | ||
|
||
find_package(Boost REQUIRED) | ||
|
||
find_package(Arrow REQUIRED) | ||
include_directories(${Arrow_INCLUDE_DIRS}) | ||
|
||
find_package(Protobuf REQUIRED) | ||
find_package(glog REQUIRED) | ||
|
||
file(GLOB_RECURSE SRC_FILES src/*.cpp src/*.cc) | ||
|
||
add_library(milvus-storage SHARED ${SRC_FILES}) | ||
target_include_directories(milvus-storage PUBLIC | ||
${CMAKE_CURRENT_SOURCE_DIR}/include/milvus-storage | ||
${CMAKE_CURRENT_SOURCE_DIR}/src | ||
${CMAKE_CURRENT_SOURCE_DIR}/test/include | ||
) | ||
|
||
set(LINK_LIBS | ||
arrow::arrow | ||
Boost::boost | ||
protobuf::protobuf | ||
AWS::aws-sdk-cpp-identity-management | ||
glog::glog | ||
Azure::azure-core | ||
Azure::azure-storage-blobs | ||
) | ||
list(APPEND LINK_LIBS arrow::arrow) | ||
list(APPEND LINK_LIBS Boost::boost) | ||
list(APPEND LINK_LIBS protobuf::protobuf) | ||
list(APPEND LINK_LIBS AWS::aws-sdk-cpp-identity-management) | ||
list(APPEND LINK_LIBS glog::glog) | ||
|
||
if (WITH_OPENDAL) | ||
list(APPEND LINK_LIBS opendal) | ||
endif() | ||
|
||
target_link_libraries(milvus-storage PUBLIC ${LINK_LIBS}) | ||
if (WITH_AZURE_FS) | ||
add_compile_definitions(MILVUS_AZURE_FS) | ||
list(APPEND LINK_LIBS Azure::azure-core) | ||
list(APPEND LINK_LIBS Azure::azure-storage-blobs) | ||
endif() | ||
|
||
set_target_properties(milvus-storage PROPERTIES | ||
INSTALL_RPATH "$ORIGIN/../lib" | ||
BUILD_WITH_INSTALL_RPATH TRUE | ||
) | ||
target_link_libraries(milvus-storage PUBLIC ${LINK_LIBS}) | ||
target_include_directories(milvus-storage PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR}/src) | ||
|
||
if (WITH_UT) | ||
enable_testing() | ||
add_subdirectory(test) | ||
endif() | ||
|
||
if (WITH_BENCHMARK) | ||
add_subdirectory(benchmark) | ||
endif() | ||
|
||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/milvus-storage.pc.in "${CMAKE_CURRENT_BINARY_DIR}/milvus-storage.pc" @ONLY) | ||
function(add_pkg_config module) | ||
configure_file( | ||
${CMAKE_CURRENT_SOURCE_DIR}/src/${module}.pc.in | ||
${CMAKE_CURRENT_BINARY_DIR}/${module}.pc | ||
@ONLY | ||
) | ||
install( | ||
FILES "${CMAKE_CURRENT_BINARY_DIR}/${module}.pc" | ||
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig/" | ||
) | ||
endfunction() | ||
|
||
add_pkg_config(libstorage) | ||
|
||
install(TARGETS milvus-storage | ||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
DESTINATION ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR} | ||
) | ||
message( "install cmake install libdir: ${CMAKE_CURRENT_SOURCE_DIR}") | ||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/milvus-storage.pc" DESTINATION "${CMAKE_CURRENT_SOURCE_DIR}/build/Release/") | ||
|
||
install(DIRECTORY "${PROJECT_SOURCE_DIR}/include/milvus-storage" | ||
DESTINATION "${CMAKE_INSTALL_PREFIX}/include") | ||
|
||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,8 +16,8 @@ | |
#include <memory> | ||
#include "parquet/arrow/reader.h" | ||
#include "arrow/filesystem/filesystem.h" | ||
#include "common/result.h" | ||
#include "storage/options.h" | ||
#include "milvus-storage/common/result.h" | ||
#include "milvus-storage/storage/options.h" | ||
Comment on lines
+19
to
+20
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is strange to include the root path in those |
||
|
||
namespace milvus_storage { | ||
Result<std::unique_ptr<parquet::arrow::FileReader>> MakeArrowFileReader(arrow::fs::FileSystem& fs, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed.