组件地址:https://github.com/pgvector/pgvector
我的机器是MacOS,下载的postgreSQL是15,按理下载下来是自动安装了pgvector,但是测试的时候发现并没有这个extension。
按文档执行:
make -- 报错,clang: error: unsupported argument 'native' to option '-march=' 。
经查询命令改为:make OPTFLAGS=""
然后报错误:clang: warning: no such sysroot directory: '/Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk' [-Wmissing-sysroot] 。重新安装了xcode command Line tools还是报这个错。应该是因为新版的command line tools本身就没有这个11.3.sdk文件,所以怎么更新都没用。
于是从:https://github.com/phracker/MacOSX-SDKs 下载了MacOSX11.3.sdk,放在本地/Library/Developer/CommandLineTools/SDKs/下。
重新执行:make OPTFLAGS="" 和 sudo make install 。成功。
Enable the extension (do this once in each database where you want to use it)
CREATE EXTENSION vector;
Create a vector column with 3 dimensions
CREATE TABLE items (id bigserial PRIMARY KEY, embedding vector(3));
标签:SDKs,postgreSQL,make,pgvector,vector,install,sdk From: https://www.cnblogs.com/saaspeter/p/18524147