Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/sqlite/blob/master/ext/vec1/Makefile # sqlite [Ported from github.com/sqlite/sqlite] Fix bugs in and improve the interface to the ".check" command of the CLI. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `sqlite / ext / vec1 / Makefile` 63 lines ยท 1927 bytes Raw Blame History 1 2 CC = gcc 3 4 CFLAGS += -O3 5 CFLAGS += -DNDEBUG 6 CFLAGS += -Wextra -Werror 7 CFLAGS += -g 8 9 #CFLAGS += -DVEC1_THREADS=0 10 #CFLAGS += -fprofile-arcs -ftest-coverage -fprofile-update=atomic -lgcov 11 #CFLAGS += -fno-inline 12 13 #ASANFLAGS = -fsanitize=address,undefined -fno-sanitize-recover=undefined 14 #CFLAGS += $(ASANFLAGS) 15 16 SIMDCFLAGS = -mavx2 -mfma 17 18 SRC = vec1.c 19 20 vec1.so: $(SRC) 21 $(CC) $(CFLAGS) $(SIMDCFLAGS) $(SRC) -o vec1.so -shared -fPIC -lm 22 23 vec1.s: $(SRC) 24 $(CC) $(CFLAGS) -g0 $(SIMDCFLAGS) $(SRC) -S 25 26 # Method for building multi-arch loadable libraries. 27 # 28 # To build a multi-arch library, the "vec1.c" file must be compiled twice. 29 # Once with VEC1SIMD defined as SCALAR, and once as AVX2. The -DVEC1SMD=AVX2 30 # compilation should pass flags to enable AVX2 support, the -DVEC1SMD=SCALAR 31 # build should not pass any such flags. Then both objects are linked into 32 # a single *.so file. The result works on hardware that supports AVX2, and 33 # also on hardware that does not. 34 # 35 # Eventually, when AVX-512 support is added, there will be a third 36 # compilation of vec1.c with flags to support AVX-512. 37 # 38 vec1multi.so: $(SRC) 39 $(CC) -DVEC1SIMD=SCALAR -c $(CFLAGS) $(SRC) -o vec1scalar.o -fPIC 40 $(CC) -DVEC1SIMD=AVX2 -c -mavx2 -mfma $(CFLAGS) $(SRC) -o vec1avx2.o -fPIC 41 $(CC) vec1scalar.o vec1avx2.o -o vec1multi.so -shared -fPIC 42 43 vec1_faiss.so: vec1_faiss.cpp 44 g++ $(CFLAGS) vec1_faiss.cpp -o vec1_faiss.so -shared -fPIC -lfaiss 45 46 vec1testscalar.so: $(SRC) 47 $(CC) $(CFLAGS) -DVEC1_TEST_SCALAR $(SRC) -o vec1testscalar.so -shared -fPIC -lm 48 49 vec1.a: $(SRC) 50 $(CC) -DVEC1_STATIC $(CFLAGS) $(SIMDCFLAGS) -c $(SRC) -fPIC 51 ar rcs vec1.a vec1.o 52 53 vec1_algo_test: tool/vec1_algo_test.c $(SRC) 54 $(CC) -I. $(CFLAGS) $(SIMDCFLAGS) tool/vec1_algo_test.c -o vec1_algo_test -lm 55 56 clean: 57 rm -f vec1.so vec1_faiss.so vec1multi.so vec1testscalar.so 58 rm -f vec1.a 59 rm -f vec1.o vec1scalar.o vec1avx2.o 60 rm -f vec1.so-vec1.gcda vec1.so-vec1.gcno 61 rm -f vec1.s 62 63