Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning: unknown attribute target_clones #546

Closed
japinli opened this issue May 8, 2024 · 4 comments
Closed

Warning: unknown attribute target_clones #546

japinli opened this issue May 8, 2024 · 4 comments

Comments

@japinli
Copy link
Contributor

japinli commented May 8, 2024

Hi,

When I try to build pgvector on Ubuntu 22.04, it complains $subject, as follows:

src/vector.c:568:1: warning: unknown attribute 'target_clones' ignored [-Wunknown-attributes]
VECTOR_TARGET_CLONES static float
^~~~~~~~~~~~~~~~~~~~
src/vector.c:38:45: note: expanded from macro 'VECTOR_TARGET_CLONES'
#define VECTOR_TARGET_CLONES __attribute__((target_clones("default", "fma")))
                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/vector.c:615:1: warning: unknown attribute 'target_clones' ignored [-Wunknown-attributes]
VECTOR_TARGET_CLONES static float
^~~~~~~~~~~~~~~~~~~~
src/vector.c:38:45: note: expanded from macro 'VECTOR_TARGET_CLONES'
#define VECTOR_TARGET_CLONES __attribute__((target_clones("default", "fma")))
                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/vector.c:657:1: warning: unknown attribute 'target_clones' ignored [-Wunknown-attributes]
VECTOR_TARGET_CLONES static double
^~~~~~~~~~~~~~~~~~~~
src/vector.c:38:45: note: expanded from macro 'VECTOR_TARGET_CLONES'
#define VECTOR_TARGET_CLONES __attribute__((target_clones("default", "fma")))
                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/vector.c:733:1: warning: unknown attribute 'target_clones' ignored [-Wunknown-attributes]
VECTOR_TARGET_CLONES static float
^~~~~~~~~~~~~~~~~~~~
src/vector.c:38:45: note: expanded from macro 'VECTOR_TARGET_CLONES'
#define VECTOR_TARGET_CLONES __attribute__((target_clones("default", "fma")))
                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4 warnings generated.

Here are my environments:

japin@b97a6632-06dc-427e-aa18-cbd95d4bbfae:~/codes/extensions/pgvector$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.4 LTS
Release:        22.04
Codename:       jammy
japin@b97a6632-06dc-427e-aa18-cbd95d4bbfae:~/codes/extensions/pgvector$ gcc --version
gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

japin@b97a6632-06dc-427e-aa18-cbd95d4bbfae:~/codes/extensions/pgvector$ clang --version
Ubuntu clang version 12.0.1-19ubuntu3
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

I found that commit 4e093f9 changes this behavior.

--- a/src/vector.c
+++ b/src/vector.c
@@ -34,18 +34,10 @@
 #define STATE_DIMS(x) (ARR_DIMS(x)[0] - 1)
 #define CreateStateDatums(dim) palloc(sizeof(Datum) * (dim + 1))

-/* target_clones requires glibc */
-#if defined(__gnu_linux__) && defined(__has_attribute)
-/* Use separate line for portability */
-#if __has_attribute(target_clones)
-#define HAVE_TARGET_CLONES
-#endif
-#endif
-
-#if defined(__x86_64__) && defined(HAVE_TARGET_CLONES) && !defined(__FMA__)
-#define VECTOR_DISPATCH __attribute__((target_clones("default", "fma")))
+#if defined(USE_TARGET_CLONES) && !defined(__FMA__)
+#define VECTOR_TARGET_CLONES __attribute__((target_clones("default", "fma")))
 #else
-#define VECTOR_DISPATCH
+#define VECTOR_TARGET_CLONES
 #endif

 PG_MODULE_MAGIC;

What's the reason to remove the checking of the target_clones attribute?

@ankane
Copy link
Member

ankane commented May 8, 2024

Hi @japinli, I'm not sure how to reproduce the warning (it's also not present on CI). Can you paste the compiler command that's generating it? From my understanding, all of the compilers where we enable USE_TARGET_CLONES should support it.

@japinli
Copy link
Contributor Author

japinli commented May 8, 2024

Hi @japinli, I'm not sure how to reproduce the warning (it's also not present on CI). Can you paste the compiler command that's generating it? From my understanding, all of the compilers where we enable USE_TARGET_CLONES should support it.

Here are my compile actions:

japin@b97a6632-06dc-427e-aa18-cbd95d4bbfae:~/codes/extensions/pgvector$ make USE_PGXS=1
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wshadow=compatible-local -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -Wmissing-prototypes -Wincompatible-pointer-types -march=native -ftree-vectorize -fassociative-math -fno-signed-zeros -fno-trapping-math -fPIC -fvisibility=hidden -I. -I./ -I/data/japin/codes/postgres/build/pg/include/server -I/data/japin/codes/postgres/build/pg/include/internal  -D_GNU_SOURCE -I/usr/include/libxml2   -c -o src/bitutils.o src/bitutils.c -MMD -MP -MF .deps/bitutils.Po
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wshadow=compatible-local -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -Wmissing-prototypes -Wincompatible-pointer-types -march=native -ftree-vectorize -fassociative-math -fno-signed-zeros -fno-trapping-math -fPIC -fvisibility=hidden -I. -I./ -I/data/japin/codes/postgres/build/pg/include/server -I/data/japin/codes/postgres/build/pg/include/internal  -D_GNU_SOURCE -I/usr/include/libxml2   -c -o src/bitvec.o src/bitvec.c -MMD -MP -MF .deps/bitvec.Po
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wshadow=compatible-local -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -Wmissing-prototypes -Wincompatible-pointer-types -march=native -ftree-vectorize -fassociative-math -fno-signed-zeros -fno-trapping-math -fPIC -fvisibility=hidden -I. -I./ -I/data/japin/codes/postgres/build/pg/include/server -I/data/japin/codes/postgres/build/pg/include/internal  -D_GNU_SOURCE -I/usr/include/libxml2   -c -o src/halfutils.o src/halfutils.c -MMD -MP -MF .deps/halfutils.Po
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wshadow=compatible-local -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -Wmissing-prototypes -Wincompatible-pointer-types -march=native -ftree-vectorize -fassociative-math -fno-signed-zeros -fno-trapping-math -fPIC -fvisibility=hidden -I. -I./ -I/data/japin/codes/postgres/build/pg/include/server -I/data/japin/codes/postgres/build/pg/include/internal  -D_GNU_SOURCE -I/usr/include/libxml2   -c -o src/halfvec.o src/halfvec.c -MMD -MP -MF .deps/halfvec.Po
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wshadow=compatible-local -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -Wmissing-prototypes -Wincompatible-pointer-types -march=native -ftree-vectorize -fassociative-math -fno-signed-zeros -fno-trapping-math -fPIC -fvisibility=hidden -I. -I./ -I/data/japin/codes/postgres/build/pg/include/server -I/data/japin/codes/postgres/build/pg/include/internal  -D_GNU_SOURCE -I/usr/include/libxml2   -c -o src/hnsw.o src/hnsw.c -MMD -MP -MF .deps/hnsw.Po
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wshadow=compatible-local -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -Wmissing-prototypes -Wincompatible-pointer-types -march=native -ftree-vectorize -fassociative-math -fno-signed-zeros -fno-trapping-math -fPIC -fvisibility=hidden -I. -I./ -I/data/japin/codes/postgres/build/pg/include/server -I/data/japin/codes/postgres/build/pg/include/internal  -D_GNU_SOURCE -I/usr/include/libxml2   -c -o src/hnswbuild.o src/hnswbuild.c -MMD -MP -MF .deps/hnswbuild.Po
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wshadow=compatible-local -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -Wmissing-prototypes -Wincompatible-pointer-types -march=native -ftree-vectorize -fassociative-math -fno-signed-zeros -fno-trapping-math -fPIC -fvisibility=hidden -I. -I./ -I/data/japin/codes/postgres/build/pg/include/server -I/data/japin/codes/postgres/build/pg/include/internal  -D_GNU_SOURCE -I/usr/include/libxml2   -c -o src/hnswinsert.o src/hnswinsert.c -MMD -MP -MF .deps/hnswinsert.Po
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wshadow=compatible-local -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -Wmissing-prototypes -Wincompatible-pointer-types -march=native -ftree-vectorize -fassociative-math -fno-signed-zeros -fno-trapping-math -fPIC -fvisibility=hidden -I. -I./ -I/data/japin/codes/postgres/build/pg/include/server -I/data/japin/codes/postgres/build/pg/include/internal  -D_GNU_SOURCE -I/usr/include/libxml2   -c -o src/hnswscan.o src/hnswscan.c -MMD -MP -MF .deps/hnswscan.Po
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wshadow=compatible-local -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -Wmissing-prototypes -Wincompatible-pointer-types -march=native -ftree-vectorize -fassociative-math -fno-signed-zeros -fno-trapping-math -fPIC -fvisibility=hidden -I. -I./ -I/data/japin/codes/postgres/build/pg/include/server -I/data/japin/codes/postgres/build/pg/include/internal  -D_GNU_SOURCE -I/usr/include/libxml2   -c -o src/hnswutils.o src/hnswutils.c -MMD -MP -MF .deps/hnswutils.Po
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wshadow=compatible-local -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -Wmissing-prototypes -Wincompatible-pointer-types -march=native -ftree-vectorize -fassociative-math -fno-signed-zeros -fno-trapping-math -fPIC -fvisibility=hidden -I. -I./ -I/data/japin/codes/postgres/build/pg/include/server -I/data/japin/codes/postgres/build/pg/include/internal  -D_GNU_SOURCE -I/usr/include/libxml2   -c -o src/hnswvacuum.o src/hnswvacuum.c -MMD -MP -MF .deps/hnswvacuum.Po
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wshadow=compatible-local -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -Wmissing-prototypes -Wincompatible-pointer-types -march=native -ftree-vectorize -fassociative-math -fno-signed-zeros -fno-trapping-math -fPIC -fvisibility=hidden -I. -I./ -I/data/japin/codes/postgres/build/pg/include/server -I/data/japin/codes/postgres/build/pg/include/internal  -D_GNU_SOURCE -I/usr/include/libxml2   -c -o src/ivfbuild.o src/ivfbuild.c -MMD -MP -MF .deps/ivfbuild.Po
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wshadow=compatible-local -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -Wmissing-prototypes -Wincompatible-pointer-types -march=native -ftree-vectorize -fassociative-math -fno-signed-zeros -fno-trapping-math -fPIC -fvisibility=hidden -I. -I./ -I/data/japin/codes/postgres/build/pg/include/server -I/data/japin/codes/postgres/build/pg/include/internal  -D_GNU_SOURCE -I/usr/include/libxml2   -c -o src/ivfflat.o src/ivfflat.c -MMD -MP -MF .deps/ivfflat.Po
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wshadow=compatible-local -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -Wmissing-prototypes -Wincompatible-pointer-types -march=native -ftree-vectorize -fassociative-math -fno-signed-zeros -fno-trapping-math -fPIC -fvisibility=hidden -I. -I./ -I/data/japin/codes/postgres/build/pg/include/server -I/data/japin/codes/postgres/build/pg/include/internal  -D_GNU_SOURCE -I/usr/include/libxml2   -c -o src/ivfinsert.o src/ivfinsert.c -MMD -MP -MF .deps/ivfinsert.Po
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wshadow=compatible-local -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -Wmissing-prototypes -Wincompatible-pointer-types -march=native -ftree-vectorize -fassociative-math -fno-signed-zeros -fno-trapping-math -fPIC -fvisibility=hidden -I. -I./ -I/data/japin/codes/postgres/build/pg/include/server -I/data/japin/codes/postgres/build/pg/include/internal  -D_GNU_SOURCE -I/usr/include/libxml2   -c -o src/ivfkmeans.o src/ivfkmeans.c -MMD -MP -MF .deps/ivfkmeans.Po
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wshadow=compatible-local -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -Wmissing-prototypes -Wincompatible-pointer-types -march=native -ftree-vectorize -fassociative-math -fno-signed-zeros -fno-trapping-math -fPIC -fvisibility=hidden -I. -I./ -I/data/japin/codes/postgres/build/pg/include/server -I/data/japin/codes/postgres/build/pg/include/internal  -D_GNU_SOURCE -I/usr/include/libxml2   -c -o src/ivfscan.o src/ivfscan.c -MMD -MP -MF .deps/ivfscan.Po
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wshadow=compatible-local -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -Wmissing-prototypes -Wincompatible-pointer-types -march=native -ftree-vectorize -fassociative-math -fno-signed-zeros -fno-trapping-math -fPIC -fvisibility=hidden -I. -I./ -I/data/japin/codes/postgres/build/pg/include/server -I/data/japin/codes/postgres/build/pg/include/internal  -D_GNU_SOURCE -I/usr/include/libxml2   -c -o src/ivfutils.o src/ivfutils.c -MMD -MP -MF .deps/ivfutils.Po
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wshadow=compatible-local -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -Wmissing-prototypes -Wincompatible-pointer-types -march=native -ftree-vectorize -fassociative-math -fno-signed-zeros -fno-trapping-math -fPIC -fvisibility=hidden -I. -I./ -I/data/japin/codes/postgres/build/pg/include/server -I/data/japin/codes/postgres/build/pg/include/internal  -D_GNU_SOURCE -I/usr/include/libxml2   -c -o src/ivfvacuum.o src/ivfvacuum.c -MMD -MP -MF .deps/ivfvacuum.Po
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wshadow=compatible-local -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -Wmissing-prototypes -Wincompatible-pointer-types -march=native -ftree-vectorize -fassociative-math -fno-signed-zeros -fno-trapping-math -fPIC -fvisibility=hidden -I. -I./ -I/data/japin/codes/postgres/build/pg/include/server -I/data/japin/codes/postgres/build/pg/include/internal  -D_GNU_SOURCE -I/usr/include/libxml2   -c -o src/sparsevec.o src/sparsevec.c -MMD -MP -MF .deps/sparsevec.Po
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wshadow=compatible-local -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -Wmissing-prototypes -Wincompatible-pointer-types -march=native -ftree-vectorize -fassociative-math -fno-signed-zeros -fno-trapping-math -fPIC -fvisibility=hidden -I. -I./ -I/data/japin/codes/postgres/build/pg/include/server -I/data/japin/codes/postgres/build/pg/include/internal  -D_GNU_SOURCE -I/usr/include/libxml2   -c -o src/vector.o src/vector.c -MMD -MP -MF .deps/vector.Po
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wshadow=compatible-local -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -Wmissing-prototypes -Wincompatible-pointer-types -march=native -ftree-vectorize -fassociative-math -fno-signed-zeros -fno-trapping-math -fPIC -fvisibility=hidden -shared -o vector.so src/bitutils.o src/bitvec.o src/halfutils.o src/halfvec.o src/hnsw.o src/hnswbuild.o src/hnswinsert.o src/hnswscan.o src/hnswutils.o src/hnswvacuum.o src/ivfbuild.o src/ivfflat.o src/ivfinsert.o src/ivfkmeans.o src/ivfscan.o src/ivfutils.o src/ivfvacuum.o src/sparsevec.o src/vector.o -L/data/japin/codes/postgres/build/pg/lib   -L/usr/lib/llvm-12/lib  -Wl,--as-needed -Wl,-rpath,'/data/japin/codes/postgres/build/pg/lib',--enable-new-dtags -fvisibility=hidden
cp sql/vector.sql sql/vector--0.7.0.sql
/usr/bin/clang -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -O2  -I. -I./ -I/data/japin/codes/postgres/build/pg/include/server -I/data/japin/codes/postgres/build/pg/include/internal  -D_GNU_SOURCE -I/usr/include/libxml2  -flto=thin -emit-llvm -c -o src/bitutils.bc src/bitutils.c
/usr/bin/clang -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -O2  -I. -I./ -I/data/japin/codes/postgres/build/pg/include/server -I/data/japin/codes/postgres/build/pg/include/internal  -D_GNU_SOURCE -I/usr/include/libxml2  -flto=thin -emit-llvm -c -o src/bitvec.bc src/bitvec.c
/usr/bin/clang -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -O2  -I. -I./ -I/data/japin/codes/postgres/build/pg/include/server -I/data/japin/codes/postgres/build/pg/include/internal  -D_GNU_SOURCE -I/usr/include/libxml2  -flto=thin -emit-llvm -c -o src/halfutils.bc src/halfutils.c
/usr/bin/clang -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -O2  -I. -I./ -I/data/japin/codes/postgres/build/pg/include/server -I/data/japin/codes/postgres/build/pg/include/internal  -D_GNU_SOURCE -I/usr/include/libxml2  -flto=thin -emit-llvm -c -o src/halfvec.bc src/halfvec.c
/usr/bin/clang -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -O2  -I. -I./ -I/data/japin/codes/postgres/build/pg/include/server -I/data/japin/codes/postgres/build/pg/include/internal  -D_GNU_SOURCE -I/usr/include/libxml2  -flto=thin -emit-llvm -c -o src/hnsw.bc src/hnsw.c
/usr/bin/clang -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -O2  -I. -I./ -I/data/japin/codes/postgres/build/pg/include/server -I/data/japin/codes/postgres/build/pg/include/internal  -D_GNU_SOURCE -I/usr/include/libxml2  -flto=thin -emit-llvm -c -o src/hnswbuild.bc src/hnswbuild.c
/usr/bin/clang -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -O2  -I. -I./ -I/data/japin/codes/postgres/build/pg/include/server -I/data/japin/codes/postgres/build/pg/include/internal  -D_GNU_SOURCE -I/usr/include/libxml2  -flto=thin -emit-llvm -c -o src/hnswinsert.bc src/hnswinsert.c
/usr/bin/clang -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -O2  -I. -I./ -I/data/japin/codes/postgres/build/pg/include/server -I/data/japin/codes/postgres/build/pg/include/internal  -D_GNU_SOURCE -I/usr/include/libxml2  -flto=thin -emit-llvm -c -o src/hnswscan.bc src/hnswscan.c
/usr/bin/clang -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -O2  -I. -I./ -I/data/japin/codes/postgres/build/pg/include/server -I/data/japin/codes/postgres/build/pg/include/internal  -D_GNU_SOURCE -I/usr/include/libxml2  -flto=thin -emit-llvm -c -o src/hnswutils.bc src/hnswutils.c
/usr/bin/clang -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -O2  -I. -I./ -I/data/japin/codes/postgres/build/pg/include/server -I/data/japin/codes/postgres/build/pg/include/internal  -D_GNU_SOURCE -I/usr/include/libxml2  -flto=thin -emit-llvm -c -o src/hnswvacuum.bc src/hnswvacuum.c
/usr/bin/clang -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -O2  -I. -I./ -I/data/japin/codes/postgres/build/pg/include/server -I/data/japin/codes/postgres/build/pg/include/internal  -D_GNU_SOURCE -I/usr/include/libxml2  -flto=thin -emit-llvm -c -o src/ivfbuild.bc src/ivfbuild.c
/usr/bin/clang -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -O2  -I. -I./ -I/data/japin/codes/postgres/build/pg/include/server -I/data/japin/codes/postgres/build/pg/include/internal  -D_GNU_SOURCE -I/usr/include/libxml2  -flto=thin -emit-llvm -c -o src/ivfflat.bc src/ivfflat.c
/usr/bin/clang -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -O2  -I. -I./ -I/data/japin/codes/postgres/build/pg/include/server -I/data/japin/codes/postgres/build/pg/include/internal  -D_GNU_SOURCE -I/usr/include/libxml2  -flto=thin -emit-llvm -c -o src/ivfinsert.bc src/ivfinsert.c
/usr/bin/clang -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -O2  -I. -I./ -I/data/japin/codes/postgres/build/pg/include/server -I/data/japin/codes/postgres/build/pg/include/internal  -D_GNU_SOURCE -I/usr/include/libxml2  -flto=thin -emit-llvm -c -o src/ivfkmeans.bc src/ivfkmeans.c
/usr/bin/clang -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -O2  -I. -I./ -I/data/japin/codes/postgres/build/pg/include/server -I/data/japin/codes/postgres/build/pg/include/internal  -D_GNU_SOURCE -I/usr/include/libxml2  -flto=thin -emit-llvm -c -o src/ivfscan.bc src/ivfscan.c
/usr/bin/clang -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -O2  -I. -I./ -I/data/japin/codes/postgres/build/pg/include/server -I/data/japin/codes/postgres/build/pg/include/internal  -D_GNU_SOURCE -I/usr/include/libxml2  -flto=thin -emit-llvm -c -o src/ivfutils.bc src/ivfutils.c
/usr/bin/clang -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -O2  -I. -I./ -I/data/japin/codes/postgres/build/pg/include/server -I/data/japin/codes/postgres/build/pg/include/internal  -D_GNU_SOURCE -I/usr/include/libxml2  -flto=thin -emit-llvm -c -o src/ivfvacuum.bc src/ivfvacuum.c
/usr/bin/clang -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -O2  -I. -I./ -I/data/japin/codes/postgres/build/pg/include/server -I/data/japin/codes/postgres/build/pg/include/internal  -D_GNU_SOURCE -I/usr/include/libxml2  -flto=thin -emit-llvm -c -o src/sparsevec.bc src/sparsevec.c
/usr/bin/clang -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -O2  -I. -I./ -I/data/japin/codes/postgres/build/pg/include/server -I/data/japin/codes/postgres/build/pg/include/internal  -D_GNU_SOURCE -I/usr/include/libxml2  -flto=thin -emit-llvm -c -o src/vector.bc src/vector.c
src/vector.c:568:1: warning: unknown attribute 'target_clones' ignored [-Wunknown-attributes]
VECTOR_TARGET_CLONES static float
^~~~~~~~~~~~~~~~~~~~
src/vector.c:38:45: note: expanded from macro 'VECTOR_TARGET_CLONES'
#define VECTOR_TARGET_CLONES __attribute__((target_clones("default", "fma")))
                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/vector.c:615:1: warning: unknown attribute 'target_clones' ignored [-Wunknown-attributes]
VECTOR_TARGET_CLONES static float
^~~~~~~~~~~~~~~~~~~~
src/vector.c:38:45: note: expanded from macro 'VECTOR_TARGET_CLONES'
#define VECTOR_TARGET_CLONES __attribute__((target_clones("default", "fma")))
                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/vector.c:657:1: warning: unknown attribute 'target_clones' ignored [-Wunknown-attributes]
VECTOR_TARGET_CLONES static double
^~~~~~~~~~~~~~~~~~~~
src/vector.c:38:45: note: expanded from macro 'VECTOR_TARGET_CLONES'
#define VECTOR_TARGET_CLONES __attribute__((target_clones("default", "fma")))
                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/vector.c:733:1: warning: unknown attribute 'target_clones' ignored [-Wunknown-attributes]
VECTOR_TARGET_CLONES static float
^~~~~~~~~~~~~~~~~~~~
src/vector.c:38:45: note: expanded from macro 'VECTOR_TARGET_CLONES'
#define VECTOR_TARGET_CLONES __attribute__((target_clones("default", "fma")))
                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4 warnings generated.
japin@b97a6632-06dc-427e-aa18-cbd95d4bbfae:~/codes/extensions/pgvector$ pg_config
BINDIR = /data/japin/codes/postgres/build/pg/bin
DOCDIR = /data/japin/codes/postgres/build/pg/share/doc
HTMLDIR = /data/japin/codes/postgres/build/pg/share/doc
INCLUDEDIR = /data/japin/codes/postgres/build/pg/include
PKGINCLUDEDIR = /data/japin/codes/postgres/build/pg/include
INCLUDEDIR-SERVER = /data/japin/codes/postgres/build/pg/include/server
LIBDIR = /data/japin/codes/postgres/build/pg/lib
PKGLIBDIR = /data/japin/codes/postgres/build/pg/lib
LOCALEDIR = /data/japin/codes/postgres/build/pg/share/locale
MANDIR = /data/japin/codes/postgres/build/pg/share/man
SHAREDIR = /data/japin/codes/postgres/build/pg/share
SYSCONFDIR = /data/japin/codes/postgres/build/pg/etc
PGXS = /data/japin/codes/postgres/build/pg/lib/pgxs/src/makefiles/pgxs.mk
CONFIGURE =  '--prefix=/data/japin/codes/postgres/build/pg' '--enable-tap-tests' '--enable-debug' '--enable-cassert' '--enable-depend' '--enable-dtrace' '--with-icu' '--with-llvm' '--with-openssl' '--with-python' '--with-libxml' '--with-libxslt' '--with-lz4' '--with-pam' 'CFLAGS=-Wmissing-prototypes -Wincompatible-pointer-types'
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 -Wshadow=compatible-local -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -Wmissing-prototypes -Wincompatible-pointer-types
CFLAGS_SL = -fPIC
LDFLAGS = -L/usr/lib/llvm-12/lib -Wl,--as-needed -Wl,-rpath,'/data/japin/codes/postgres/build/pg/lib',--enable-new-dtags
LDFLAGS_EX =
LDFLAGS_SL =
LIBS = -lpgcommon -lpgport -llz4 -lxslt -lxml2 -lpam -lssl -lcrypto -lz -lreadline -lm
VERSION = PostgreSQL 16.2

@ankane ankane closed this as completed in 69f4929 May 8, 2024
@ankane
Copy link
Member

ankane commented May 8, 2024

Thanks @japinli. It looks like support for target_clones was added in Clang 14 (llvm/llvm-project@9deab60), so restored the attribute check in the commit above.

@japinli
Copy link
Contributor Author

japinli commented May 8, 2024

Thanks @japinli. It looks like support for target_clones was added in Clang 14 (llvm/llvm-project@9deab60), so restored the attribute check in the commit above.

Thanks for your quick fix.

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

No branches or pull requests

2 participants