Skip to content

Commit

Permalink
Switch from git submodule to system library for zstd dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
pabs3 committed Mar 25, 2023
1 parent 854468d commit 205bbc3
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 21 deletions.
4 changes: 0 additions & 4 deletions .gitmodules

This file was deleted.

6 changes: 2 additions & 4 deletions AnnService/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@
# Licensed under the MIT License.

set(AnnService ${PROJECT_SOURCE_DIR}/AnnService)
set(Zstd ${PROJECT_SOURCE_DIR}/ThirdParty/zstd)

include_directories(${AnnService})
include_directories(${Zstd}/lib)

file(GLOB_RECURSE HDR_FILES ${AnnService}/inc/Core/*.h ${AnnService}/inc/Helper/*.h)
file(GLOB_RECURSE SRC_FILES ${AnnService}/src/Core/*.cpp ${AnnService}/src/Helper/*.cpp)
Expand Down Expand Up @@ -38,9 +36,9 @@ if(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
endif()

add_library (SPTAGLib SHARED ${SRC_FILES} ${HDR_FILES})
target_link_libraries (SPTAGLib DistanceUtils libzstd_shared ${NUMA_LIBRARY})
target_link_libraries (SPTAGLib DistanceUtils zstd ${NUMA_LIBRARY})
add_library (SPTAGLibStatic STATIC ${SRC_FILES} ${HDR_FILES})
target_link_libraries (SPTAGLibStatic DistanceUtils libzstd_static ${NUMA_LIBRARY_STATIC})
target_link_libraries (SPTAGLibStatic DistanceUtils zstd ${NUMA_LIBRARY_STATIC})
if(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
target_compile_options(SPTAGLibStatic PRIVATE -fPIC)
endif()
Expand Down
2 changes: 0 additions & 2 deletions AnnService/inc/Core/SPANN/Compressor.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
#define _SPTAG_SPANN_COMPRESSOR_H_

#include <string>
//#include "zstd.h"
//#include "zdict.h"
#include <zstd.h>
#include <zdict.h>
#include "inc/Core/Common.h"
Expand Down
2 changes: 0 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,6 @@ endif()
option(GPU "GPU" ON)
option(LIBRARYONLY "LIBRARYONLY" OFF)

add_subdirectory (ThirdParty/zstd/build/cmake)

add_subdirectory (AnnService)
add_subdirectory (Test)
add_subdirectory (GPUSupport)
Expand Down
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get -y install wget build-essential \
swig cmake git libnuma libnuma-dev \
libboost-filesystem-dev libboost-test-dev libboost-serialization-dev libboost-regex-dev libboost-serialization-dev libboost-regex-dev libboost-thread-dev libboost-system-dev
libboost-filesystem-dev libboost-test-dev libboost-serialization-dev libboost-regex-dev libboost-serialization-dev libboost-regex-dev libboost-thread-dev libboost-system-dev libzstd-dev

ENV PYTHONPATH=/app/Release

Expand All @@ -14,6 +14,5 @@ COPY AnnService ./AnnService/
COPY Test ./Test/
COPY Wrappers ./Wrappers/
COPY GPUSupport ./GPUSupport/
COPY ThirdParty ./ThirdParty/

RUN mkdir build && cd build && cmake .. && make -j$(nproc) && cd ..
3 changes: 1 addition & 2 deletions Dockerfile.cuda
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get -y install build-essential \
swig cmake git libnuma libnuma-dev \
libboost-filesystem-dev libboost-test-dev libboost-serialization-dev libboost-regex-dev libboost-serialization-dev libboost-regex-dev libboost-thread-dev libboost-system-dev
libboost-filesystem-dev libboost-test-dev libboost-serialization-dev libboost-regex-dev libboost-serialization-dev libboost-regex-dev libboost-thread-dev libboost-system-dev libzstd-dev

ENV PYTHONPATH=/app/Release

Expand All @@ -14,6 +14,5 @@ COPY AnnService ./AnnService/
COPY Test ./Test/
COPY Wrappers ./Wrappers/
COPY GPUSupport ./GPUSupport/
COPY ThirdParty ./ThirdParty/

RUN mkdir build && cd build && cmake .. && -j$(nproc) && cd ..
6 changes: 2 additions & 4 deletions GPUSupport/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ if (CUDA_FOUND)

include_directories(${AnnService})

include_directories(${PROJECT_SOURCE_DIR}/ThirdParty/zstd/lib)

file(GLOB_RECURSE GPU_HDR_FILES ${AnnService}/inc/Core/*.h ${AnnService}/inc/Helper/*.h ${AnnService}/inc/Core/Common/cuda/*)
file(GLOB_RECURSE GPU_SRC_FILES ${AnnService}/src/Core/*.cpp ${AnnService}/src/Helper/*.cpp ${AnnService}/src/Core/Common/Kernel.cu)

Expand All @@ -54,11 +52,11 @@ if (CUDA_FOUND)
endif()

CUDA_ADD_LIBRARY(GPUSPTAGLib SHARED ${GPU_SRC_FILES} ${GPU_HDR_FILES})
target_link_libraries(GPUSPTAGLib DistanceUtils ${Boost_LIBRARIES} ${CUDA_LIBRARIES} libzstd_shared ${NUMA_LIBRARY})
target_link_libraries(GPUSPTAGLib DistanceUtils ${Boost_LIBRARIES} ${CUDA_LIBRARIES} zstd ${NUMA_LIBRARY})
target_compile_definitions(GPUSPTAGLib PRIVATE ${Definition})

CUDA_ADD_LIBRARY(GPUSPTAGLibStatic STATIC ${GPU_SRC_FILES} ${GPU_HDR_FILES})
target_link_libraries(GPUSPTAGLibStatic DistanceUtils ${Boost_LIBRARIES} ${CUDA_LIBRARIES} libzstd_static ${NUMA_LIBRARY_STATIC})
target_link_libraries(GPUSPTAGLibStatic DistanceUtils ${Boost_LIBRARIES} ${CUDA_LIBRARIES} zstd ${NUMA_LIBRARY_STATIC})
target_compile_definitions(GPUSPTAGLibStatic PRIVATE ${Definition})
add_dependencies(GPUSPTAGLibStatic GPUSPTAGLib)

Expand Down
1 change: 0 additions & 1 deletion ThirdParty/zstd
Submodule zstd deleted from e47e67

0 comments on commit 205bbc3

Please sign in to comment.