Skip to content

Instantly share code, notes, and snippets.

@lxxstc
Last active February 3, 2019 06:18
Show Gist options
  • Select an option

  • Save lxxstc/3a6e7ce34c13f916984e3ff7af666201 to your computer and use it in GitHub Desktop.

Select an option

Save lxxstc/3a6e7ce34c13f916984e3ff7af666201 to your computer and use it in GitHub Desktop.

基本是按照文档顺序,此处对INSTALL.md做补充

安装BLAS/LAPACK

Ubuntu

不必按照INSTALL.md里面的编译安装方法,只要安装源里的包即可

$ sudo apt install libopenblas-dev
$ sudo apt install liblapack
$ sudo apt install swig

CentOS7

$ sudo yum install openblas-devel
$ sudo yum install lapack-devel
$ sudo yum install swig

制作test_blas

$ make tests/test_blas

如果make不过,应该是ld的问题,实在make不过直接把g++命令贴出来手动搞

开始编译 faiss

$ cp example_makefiles/makefile.inc.Linux makefile.inc
$ make

开始编译py wrapper

请安装包python-numpy,如果你像我一样想使用virtualenv,那么请将makefile.inc中PYTHONCFLAGS修改为如下内容 PYTHONCFLAGS=-I/usr/include/python2.7/ -I${VIRTUALENV_PATH}/lib/python2.7/site-packages/numpy/core/include/

$ make py

使用文档见

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment