<commit_before># Copyright (c) 2015-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD+Patents license found in the
# LICENSE file in the root directory of this source tree.

-include makefile.inc

SRC=$(wildcard *.cpp)
OBJ=$(SRC:.cpp=.o)


############################
# Building

default: libfaiss.a

all: libfaiss.a libfaiss.$(SHAREDEXT)

libfaiss.a: $(OBJ)
	ar r $@ $^

libfaiss.$(SHAREDEXT): $(OBJ)
	$(CXX) $(SHAREDFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS)

%.o: %.cpp
	$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(CPUFLAGS) -c $< -o $@

clean:
	rm -f libfaiss.*
	rm -f $(OBJ)


############################
# Installing

install: libfaiss.a libfaiss.$(SHAREDEXT) installdirs
	cp libfaiss.a libfaiss.$(SHAREDEXT) $(DESTDIR)$(libdir)
	cp *.h $(DESTDIR)$(includedir)/faiss/

installdirs:
	$(MKDIR_P) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir)/faiss

uninstall:
	rm $(DESTDIR)$(libdir)/libfaiss.a
	rm $(DESTDIR)$(libdir)/libfaiss.$(SHAREDEXT)
	rm -rf $(DESTDIR)$(includedir)/faiss


#############################
# Dependencies

-include depend

# The above makefile.dep is generated by the following target:
depend:
	for i in $(SRC); do \
		$(CXXCPP) $(CPPFLAGS) -MM $$i; \
	done > depend


#############################
# Tests

test: libfaiss.a py
	make -C tests run
	PYTHONPATH=./python/build/`ls python/build | grep lib` \
	$(PYTHON) -m unittest discover tests/ -v


#############################
# Demos

demos: libfaiss.a
	make -C demos


#############################
# Misc

misc/test_blas: misc/test_blas.cpp
	$(CXX) $(CXXFLAG) $(LDFLAGS) $(LIBS) -o $@ $^


#############################
# Python

py:
	$(MAKE) -C python build


.PHONY: all clean default demos install installdirs py test uninstall<commit_msg>Fix linking order for misc/test_blas in Makefile. (#489)<commit_after># Copyright (c) 2015-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD+Patents license found in the
# LICENSE file in the root directory of this source tree.

-include makefile.inc

SRC=$(wildcard *.cpp)
OBJ=$(SRC:.cpp=.o)


############################
# Building

default: libfaiss.a

all: libfaiss.a libfaiss.$(SHAREDEXT)

libfaiss.a: $(OBJ)
	ar r $@ $^

libfaiss.$(SHAREDEXT): $(OBJ)
	$(CXX) $(SHAREDFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS)

%.o: %.cpp
	$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(CPUFLAGS) -c $< -o $@

clean:
	rm -f libfaiss.*
	rm -f $(OBJ)


############################
# Installing

install: libfaiss.a libfaiss.$(SHAREDEXT) installdirs
	cp libfaiss.a libfaiss.$(SHAREDEXT) $(DESTDIR)$(libdir)
	cp *.h $(DESTDIR)$(includedir)/faiss/

installdirs:
	$(MKDIR_P) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir)/faiss

uninstall:
	rm $(DESTDIR)$(libdir)/libfaiss.a
	rm $(DESTDIR)$(libdir)/libfaiss.$(SHAREDEXT)
	rm -rf $(DESTDIR)$(includedir)/faiss


#############################
# Dependencies

-include depend

# The above makefile.dep is generated by the following target:
depend:
	for i in $(SRC); do \
		$(CXXCPP) $(CPPFLAGS) -MM $$i; \
	done > depend


#############################
# Tests

test: libfaiss.a py
	make -C tests run
	PYTHONPATH=./python/build/`ls python/build | grep lib` \
	$(PYTHON) -m unittest discover tests/ -v


#############################
# Demos

demos: libfaiss.a
	make -C demos


#############################
# Misc

misc/test_blas: misc/test_blas.cpp
	$(CXX) $(CXXFLAG) $(LDFLAGS) -o $@ $^ $(LIBS)


#############################
# Python

py:
	$(MAKE) -C python build


.PHONY: all clean default demos install installdirs py test uninstall
{'fraction_non_alphanumeric': 0.26039016115351993, 'fraction_numerical': 0.0031099802092168505, 'mean_word_length': 4.63375796178344, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '839344', 'n_tokens_mistral': 1402, 'n_tokens_neox': 1295, 'n_words': 334}