timescale / pgvectorscale

A complement to pgvector for high performance, cost efficient vector search on large workloads.
PostgreSQL License
601 stars 23 forks source link

ERROR: extension "vectorscale" has no installation script nor update path for version "0.2.0" #98

Open BrunoQuagliata1 opened 2 weeks ago

BrunoQuagliata1 commented 2 weeks ago

Issue Description: I am encountering an error while trying to install the vectorscale extension for PostgreSQL from source. Below are the steps I followed and the error message I received:

Steps Taken:

  1. Installed Rust and Cargo as prerequisites.
  2. Installed cargo-pgrx and initialized it for PostgreSQL 16.
  3. Cloned the pgvectorscale repository and navigated to the pgvectorscale/pgvectorscale directory.
  4. Compiled and installed vectorscale using cargo pgrx install --release.

Error Encountered: When attempting to create the extension in my PostgreSQL database, I used the command:

CREATE EXTENSION IF NOT EXISTS vectorscale CASCADE;

However, I received the following error:

ERROR: extension "vectorscale" has no installation script nor update path for version "0.2.0"

Steps I've Tried to Resolve the Issue:

I would appreciate any guidance on resolving this issue. Thank you!

irowberryFS commented 2 weeks ago

I'm getting something similar (on Linux). ERROR: extension "vectorscale" has no installation script nor update path for version "@CARGO_VERSION@"

yihong0618 commented 2 weeks ago

maybe you need init the pg_config

cevian commented 2 weeks ago

@BrunoQuagliata1 and @irowberryFS can you provide the output of pg_config and the output of cargo pgrx install --release? Also by which method did you install Postgres on your systems ?

irowberryFS commented 2 weeks ago

@cevian okay here is the output of pg_config.

BINDIR = /usr/bin
DOCDIR = /usr/share/doc/pgsql
HTMLDIR = /usr/share/doc/pgsql
INCLUDEDIR = /usr/include
PKGINCLUDEDIR = /usr/include/pgsql
INCLUDEDIR-SERVER = /usr/include/pgsql/server
LIBDIR = /usr/lib64
PKGLIBDIR = /usr/lib64/pgsql
LOCALEDIR = /usr/share/locale
MANDIR = /usr/share/man
SHAREDIR = /usr/share/pgsql
SYSCONFDIR = /etc
PGXS = /usr/lib64/pgsql/pgxs/src/makefiles/pgxs.mk
CONFIGURE =  '--build=x86_64-amazon-linux-gnu' '--host=x86_64-amazon-linux-gnu' '--program-prefix=' '--disable-dependency-tracking' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib64' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/var/lib' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--disable-rpath' '--with-perl' '--with-tcl' '--with-tclconfig=/usr/lib64' '--with-ldap' '--with-openssl' '--with-pam' '--with-gssapi' '--with-ossp-uuid' '--with-libxml' '--with-libxslt' '--enable-nls' '--enable-dtrace' '--with-selinux' '--with-system-tzdata=/usr/share/zoneinfo' '--datadir=/usr/share/pgsql' '--with-systemd' '--with-lz4' '--with-icu' '--with-llvm' '--with-python' 'build_alias=x86_64-amazon-linux-gnu' 'host_alias=x86_64-amazon-linux-gnu' 'CC=gcc' 'CFLAGS=-O2 -ftree-vectorize -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection' 'LDFLAGS=-Wl,-z,relro -Wl,--as-needed  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -Wl,--build-id=sha1 ' 'CXX=g++' 'CXXFLAGS=-O2 -ftree-vectorize -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -march=x86-64-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection' 'PKG_CONFIG_PATH=:/usr/lib64/pkgconfig:/usr/share/pkgconfig' 'PYTHON=/usr/bin/python3'
CC = gcc
CPPFLAGS = -D_GNU_SOURCE -I/usr/include/libxml2
CFLAGS = -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -O2 -ftree-vectorize -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection
CFLAGS_SL = -fPIC
LDFLAGS = -Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -L/usr/lib64 -Wl,--as-needed
LDFLAGS_EX =
LDFLAGS_SL =
LIBS = -lpgcommon -lpgport -lselinux -llz4 -lxslt -lxml2 -lpam -lssl -lcrypto -lgssapi_krb5 -lz -lreadline -lm
VERSION = PostgreSQL 15.6

Upon first run of cargo pgrx install --release

Compiling vectorscale v0.2.0 (/tmp/pgvectorscale/pgvectorscale)
error: On x86, the AVX2 feature must be enabled. Set RUSTFLAGS="-C target-feature=+avx2,+fma"
 --> src/access_method/distance.rs:4:1
  |
4 | / compile_error!(
5 | |     "On x86, the AVX2 feature must be enabled. Set RUSTFLAGS=\"-C target-feature=+avx2,+fma\""
6 | | );
  | |_^

error: On x86, the AVX2 feature must be enabled. Set RUSTFLAGS="-C target-feature=+avx2,+fma"
  --> src/access_method/distance_x86.rs:10:1
   |
10 | / compile_error!(
11 | |     "On x86, the AVX2 feature must be enabled. Set RUSTFLAGS=\"-C target-feature=+avx2,+fma\""
12 | | );
   | |_^

error: On x86, the fma feature must be enabled. Set RUSTFLAGS="-C target-feature=+avx2,+fma"
  --> src/access_method/distance_x86.rs:16:1
   |
16 | / compile_error!(
17 | |     "On x86, the fma feature must be enabled. Set RUSTFLAGS=\"-C target-feature=+avx2,+fma\""
18 | | );
   | |_^

error: could not compile `vectorscale` (lib) due to 3 previous errors

After setting flag.

Compiling vectorscale v0.2.0 (/tmp/pgvectorscale/pgvectorscale)
    Finished `release` profile [optimized] target(s) in 46.21s
  Installing extension
     Copying control file to /usr/share/pgsql/extension/vectorscale.control
Error:
   0: failed writing `/tmp/pgvectorscale/pgvectorscale/vectorscale.control` to `/usr/share/pgsql/extension/vectorscale.control`
   1: Permission denied (os error 13)

Location:
   /home/ec2-user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cargo-pgrx-0.11.4/src/command/install.rs:270

  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ SPANTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

   0: cargo_pgrx::command::install::install_extension with pg_version=15.6 profile=Release test=false features=["pg15"]
      at /home/ec2-user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cargo-pgrx-0.11.4/src/command/install.rs:114
   1: cargo_pgrx::command::install::execute
      at /home/ec2-user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cargo-pgrx-0.11.4/src/command/install.rs:63

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.

I then copy the .control file and get the error.

If I remember correctly, I used dnf to install postgres.

bh4cyi commented 2 weeks ago

cargo pgrx install --release --sudo