forked from facebookresearch/faiss
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile.inc.Mac.brew
92 lines (74 loc) · 2.97 KB
/
makefile.inc.Mac.brew
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# -*- makefile -*-
# Tested on macOS Sierra (10.12.2) with llvm installed using Homebrew (https://brew.sh)
# brew install llvm
CC=/usr/local/opt/llvm/bin/clang++
CFLAGS=-fPIC -m64 -Wall -g -O3 -msse4 -mpopcnt -fopenmp -Wno-sign-compare -I/usr/local/opt/llvm/include -std=c++11
LLVM_VERSION_PATH=$(shell ls -rt /usr/local/Cellar/llvm/ | tail -n1)
LDFLAGS=-g -fPIC -fopenmp -L/usr/local/opt/llvm/lib -L/usr/local/Cellar/llvm/${LLVM_VERSION_PATH}/lib
# common mac flags
SHAREDEXT=dylib
SHAREDFLAGS=-Wl,-F. -bundle -undefined dynamic_lookup
FAISSSHAREDFLAGS=-dynamiclib
# wrapldflags=""
# sharedext=dylib
# sharedflags="-dynamiclib"
# yaelsharedflags="$sharedflags -install_name $yaelprefix/yael/libyael.dylib"
##########################################################################
# Uncomment one of the 4 BLAS/Lapack implementation options
# below. They are sorted # from fastest to slowest (in our
# experiments).
##########################################################################
#
# 1. Intel MKL
#
# This is the fastest BLAS implementation we tested. Unfortunately it
# is not open-source and determining the correct linking flags is a
# nightmare. See
#
# https://software.intel.com/en-us/articles/intel-mkl-link-line-advisor
#
# for a start on setting the link flags. On version IntelComposerXE
# 2015.0.090, the following flags work
#
# MKLROOT=$(HOME)/fbsource/fbcode/third-party2//IntelComposerXE/2015.0.090/gcc-4.8.1-glibc-2.17/c3f970a/mkl
#
# BLASLDFLAGS=-Wl,--no-as-needed -L$(MKLROOT)/lib/intel64 -lmkl_intel_ilp64 \
# -lmkl_core -lmkl_gnu_thread -ldl -lpthread
#
# the ilp64 means that the integers are 64-bit.
#
# BLASLDFLAGS=-DFINTEGER=long
#
# you may have to set the LD_LIBRARY_PATH=$MKLROOT/lib/intel64 at runtime
#
#
# 2. Openblas
#
# The library contains both BLAS and Lapack. Install with brew install OpenBLAS
#
# BLASCFLAGS=-DFINTEGER=int
# BLASLDFLAGS=/usr/local/opt/openblas/lib/libblas.dylib
#
#
# 3. Apple's framework accelerate
#
# This has the advantage that it does not require to install anything,
# as it is provided by default on the mac. It is not very fast, though.
#
BLASCFLAGS=-DFINTEGER=int
BLASLDFLAGS=-framework Accelerate
##########################################################################
# SWIG and Python flags
##########################################################################
# SWIG executable. This should be at least version 3.x
# brew install swig
SWIGEXEC=/usr/local/bin/swig
# The Python include directories for the current python executable
PYTHON_INC=$(shell python -c "import distutils.sysconfig; print(distutils.sysconfig.get_python_inc())")
NUMPY_INC=$(shell python -c "import numpy ; print(numpy.get_include())")
PYTHONCFLAGS=-I${PYTHON_INC} -I${NUMPY_INC}
##########################################################################
# Faiss GPU
##########################################################################
# As we don't have access to a Mac with nvidia GPUs installed, we
# could not validate the GPU compile of Faiss.