mirror of
https://github.com/facebookresearch/faiss.git
synced 2025-06-03 21:54:02 +08:00
* Refactors Makefiles and add configure script. * Give MKL higher priority in configure script. * Clean up Linux example makefile.inc. * Cleanup makefile.inc examples. * Fix python clean Makefile target. * Regen swig wrappers. * Remove useless CUDAFLAGS variable. * Fix python linking flags. * Separate compile and link phase in python makefile. * Add macro to look for swig. * Add CUDA check in configure script. * Cleanup make depend targets. * Cleanup CUDA flags. * Fix linking flags. * Fix python GPU linking. * Remove useless flags from python gpu module linking. * Add check for cuda libs. * Cleanup GPU targets. * Clean up test target. * Add cpu/gpu targets to python makefile. * Clean up tutorial Makefile. * Remove stale OS var from example makefiles. * Clean up cuda example flags.
38 lines
870 B
Makefile
38 lines
870 B
Makefile
# 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
|
|
|
|
TESTS_SRC = $(wildcard *.cpp)
|
|
TESTS = $(TESTS_SRC:.cpp=.o)
|
|
|
|
all: run
|
|
|
|
run: tests
|
|
./tests
|
|
|
|
tests: $(TESTS) ../libfaiss.a gtest/make/gtest_main.a
|
|
$(CXX) -o $@ $^ $(LDFLAGS) $(LIBS)
|
|
|
|
%.o: %.cpp gtest
|
|
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(CPUFLAGS) -c -o $@ $< -Igtest/include -I../..
|
|
|
|
gtest/make/gtest_main.a: gtest
|
|
make -C gtest/make CXX="$(CXX)" CXXFLAGS="$(CXXFLAGS)" gtest_main.a
|
|
|
|
gtest:
|
|
curl -L https://github.com/google/googletest/archive/release-1.8.0.tar.gz | tar xz && \
|
|
mv googletest-release-1.8.0/googletest gtest && \
|
|
rm -rf googletest-release-1.8.0
|
|
|
|
clean:
|
|
rm -f test_runner
|
|
rm -f *.o
|
|
rm -rf gtest
|
|
|
|
|
|
.PHONY: all clean run
|