Files
faiss/c_api/gpu/Makefile
T
Eduardo Pinho 2bfbead8f1 [C API] Update for compatibility with v1.5 (#858)
* [c_api] Update impl and interface for v1.5

- move IndexShards to dedicated module IndexShards_c.{h|cpp}
- remove getter/setters to unreachable fields
- reimplement faiss_IndexIVF_imbalance_factor (to use invlists)
- minor IndexIVF documentation tweaks
- Remove QueryResult, provide RangeQueryResult

* [c_api] Document FaissErrorCode

* [c_api] Update GPU impl and interface for v1.5

- Remove unavailable method setTempMemoryFraction

* [c_api] Relicense to MIT

In accordance to the rest of the project
2019-06-12 15:46:08 +02:00

59 lines
2.3 KiB
Makefile

# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
.SUFFIXES: .cpp .o
# C API with GPU support
include ../../makefile.inc
DEBUGFLAG=-DNDEBUG # no debugging
LIBNAME=libgpufaiss
CLIBNAME=libgpufaiss_c
LIBGPUCOBJ=GpuAutoTune_c.o GpuClonerOptions_c.o GpuIndex_c.o GpuResources_c.o \
StandardGpuResources_c.o
LIBCOBJ=../libfaiss_c.a
# Build shared object file by default
all: $(CLIBNAME).$(SHAREDEXT)
# Build static object file containing the wrapper implementation only.
# Consumers are required to link with the C++ standard library and remaining
# portions of this library: libfaiss_c.a, libfaiss.a, libgpufaiss.a, and libstdc++.
$(CLIBNAME).a: $(LIBGPUCOBJ) ../../gpu/$(LIBNAME).a
ar r $@ $^
# Build dynamic library
$(CLIBNAME).$(SHAREDEXT): $(LIBCOBJ) $(LIBGPUCOBJ) ../../libfaiss.a ../../gpu/$(LIBNAME).a
$(CXX) $(LDFLAGS) $(SHAREDFLAGS) $(CUDACFLAGS) -o $@ \
-Wl,--whole-archive $(LIBCOBJ) ../../libfaiss.a \
-Wl,--no-whole-archive -static-libstdc++ $(LIBGPUCOBJ) $(LIBS) ../../gpu/$(LIBNAME).a \
$(NVCCLDFLAGS) $(NVCCLIBS)
# Build GPU example
bin/example_gpu_c: example_gpu_c.c $(CLIBNAME).$(SHAREDEXT)
$(CC) $(CFLAGS) $(CUDACFLAGS) -std=c99 -I. -I.. -o $@ example_gpu_c.c \
-L. -lgpufaiss_c
clean:
rm -f $(CLIBNAME).a $(CLIBNAME).$(SHAREDEXT)* *.o bin/example_gpu_c
# Dependencies
GpuAutoTune_c.o: CXXFLAGS += -I.. -I../.. $(CUDACFLAGS) $(DEBUGFLAG)
GpuAutoTune_c.o: GpuAutoTune_c.cpp GpuAutoTune_c.h ../../gpu/GpuAutoTune.h ../Index_c.h ../macros_impl.h
GpuClonerOptions_c.o: CXXFLAGS += -I.. -I../.. $(CUDACFLAGS) $(DEBUGFLAG)
GpuClonerOptions_c.o: GpuClonerOptions_c.cpp GpuClonerOptions_c.h GpuIndicesOptions_c.h ../../gpu/GpuClonerOptions.h ../macros_impl.h
GpuIndex_c.o: CXXFLAGS += -I.. -I../.. $(CUDACFLAGS) $(DEBUGFLAG)
GpuIndex_c.o: GpuIndex_c.cpp GpuIndex_c.h ../../gpu/GpuIndex.h ../macros_impl.h
GpuResources_c.o: CXXFLAGS += -I.. -I../.. $(CUDACFLAGS) $(DEBUGFLAG)
GpuResources_c.o: GpuResources_c.cpp GpuResources_c.h ../../gpu/GpuResources.h ../macros_impl.h
StandardGpuResources_c.o: CXXFLAGS += -I.. -I../.. $(CUDACFLAGS) $(DEBUGFLAG)
StandardGpuResources_c.o: StandardGpuResources_c.cpp StandardGpuResources_c.h ../../gpu/StandardGpuResources.h ../macros_impl.h