Commit 433f5c0f authored by Eduardo Pinho's avatar Eduardo Pinho Committed by Matthijs Douze

[C API] Fix libgpufaiss_c with extended API (#448)

- change libfaiss_c.a libgpufaiss_c.a targets to only include wrapper
impl
- include libfaiss_c.a on c_api `make all`
- build libgpufaiss_c.so with libfaiss_c.a instead of faiss_c .o file list
parent 30a362a6
......@@ -16,14 +16,15 @@ CLIBNAME=libfaiss_c
LIBCOBJ=error_impl.o Index_c.o IndexFlat_c.o Clustering_c.o AuxIndexStructures_c.o \
AutoTune_c.o IndexIVF_c.o IndexIVFFlat_c.o IndexLSH_c.o index_io_c.o MetaIndexes_c.o
# Build shared object file by default
all: $(CLIBNAME).$(SHAREDEXT)
# Build static and shared object files by default
all: $(CLIBNAME).a $(CLIBNAME).$(SHAREDEXT)
# Build static library (requires consumers to link with libstdc++)
$(CLIBNAME).a: $(LIBCOBJ) ../$(LIBNAME).a
# Build static object file containing the wrapper implementation only.
# Consumers are required to link with libfaiss.a and libstdc++.
$(CLIBNAME).a: $(LIBCOBJ)
ar r $@ $^
# Build dynamic library
# Build dynamic library (independent object)
$(CLIBNAME).$(SHAREDEXT): $(LIBCOBJ) ../$(LIBNAME).a
$(CXX) $(LDFLAGS) $(FAISSSHAREDFLAGS) -o $@ \
-Wl,--whole-archive $^ $(BLASLDFLAGS) -Wl,--no-whole-archive -static-libstdc++
......
......@@ -15,13 +15,14 @@ LIBNAME=libgpufaiss
CLIBNAME=libgpufaiss_c
LIBGPUCOBJ=GpuAutoTune_c.o GpuClonerOptions_c.o GpuIndex_c.o GpuResources_c.o \
StandardGpuResources_c.o
LIBCOBJ=../error_impl.o ../Index_c.o ../IndexFlat_c.o ../Clustering_c.o \
../AuxIndexStructures_c.o ../AutoTune_c.o ../IndexIVF_c.o
LIBCOBJ=../libfaiss_c.a
# Build shared object file by default
all: $(CLIBNAME).$(SHAREDEXT) bin/example_gpu_c
all: $(CLIBNAME).$(SHAREDEXT)
# Build static library (requires consumers to link with libstdc++)
# 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 $@ $^
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment