Commit dd6c9ebf authored by Eduardo Pinho's avatar Eduardo Pinho Committed by Lucas Hosseini

[c_api] Rearrange lib linking in Makefiles (#490)

parent f841bbab
......@@ -26,8 +26,8 @@ $(CLIBNAME).a: $(LIBCOBJ)
# Build dynamic library (independent object)
$(CLIBNAME).$(SHAREDEXT): $(LIBCOBJ) ../$(LIBNAME).a
$(CXX) $(LDFLAGS) $(LIBS) $(SHAREDFLAGS) -o $@ \
-Wl,--whole-archive $^ -Wl,--no-whole-archive -static-libstdc++
$(CXX) $(LDFLAGS) $(SHAREDFLAGS) -o $@ \
-Wl,--whole-archive $^ -Wl,--no-whole-archive $(LIBS) -static-libstdc++
bin/example_c: example_c.c $(CLIBNAME).$(SHAREDEXT)
$(CC) $(CFLAGS) -std=c99 -I. -I.. -L. -o $@ example_c.c \
......
......@@ -28,9 +28,9 @@ $(CLIBNAME).a: $(LIBGPUCOBJ) ../../gpu/$(LIBNAME).a
# Build dynamic library
$(CLIBNAME).$(SHAREDEXT): $(LIBCOBJ) $(LIBGPUCOBJ) ../../libfaiss.a ../../gpu/$(LIBNAME).a
$(CXX) $(LDFLAGS) $(SHAREDFLAGS) $(CUDACFLAGS) $(LIBS) -o $@ \
$(CXX) $(LDFLAGS) $(SHAREDFLAGS) $(CUDACFLAGS) -o $@ \
-Wl,--whole-archive $(LIBCOBJ) ../../libfaiss.a \
-Wl,--no-whole-archive -static-libstdc++ $(LIBGPUCOBJ) ../../gpu/$(LIBNAME).a \
-Wl,--no-whole-archive -static-libstdc++ $(LIBGPUCOBJ) $(LIBS) ../../gpu/$(LIBNAME).a \
$(NVCCLDFLAGS) $(NVCCLIBS)
# Build GPU example
......
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