Skip to content

Commit

Permalink
[c_api] Rearrange lib linking in Makefiles (#490)
Browse files Browse the repository at this point in the history
  • Loading branch information
Enet4 authored and beauby committed Jun 13, 2018
1 parent f841bba commit dd6c9eb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions c_api/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
4 changes: 2 additions & 2 deletions c_api/gpu/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit dd6c9eb

Please sign in to comment.