asg017 / sqlite-vss

A SQLite extension for efficient vector search, based on Faiss!
MIT License
1.59k stars 59 forks source link

Can't compile on Mac (x86 CPU) #56

Open polterguy opened 1 year ago

polterguy commented 1 year ago

Following your recipe to the last detail, and nothing seems to work. It give me ...

This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by sqlite configure 3.40.1, which was
generated by GNU Autoconf 2.71.  Invocation command line was

  $ ./configure

## --------- ##
## Platform. ##
## --------- ##

hostname = Thomass-MacBook-Air.local
uname -m = x86_64
uname -r = 20.6.0
uname -s = Darwin
uname -v = Darwin Kernel Version 20.6.0: Thu Mar  9 20:39:26 PST 2023; root:xnu-7195.141.49.700.6~1/RELEASE_X86_64

/usr/bin/uname -p = i386
/bin/uname -X     = unknown

/bin/arch              = unknown
/usr/bin/arch -k       = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo      = Mach kernel version:
     Darwin Kernel Version 20.6.0: Thu Mar  9 20:39:26 PST 2023; root:xnu-7195.141.49.700.6~1/RELEASE_X86_64
Kernel configured for up to 8 processors.
4 processors are physically available.
8 processors are logically available.
Processor type: x86_64h (Intel x86-64h Haswell)
Processors active: 0 1 2 3 4 5 6 7
Primary memory available: 8.00 gigabytes
Default processor set: 362 tasks, 2086 threads, 8 processors
Load average: 4.23, Mach factor: 4.26
/bin/machine           = unknown
/usr/bin/oslevel       = unknown
/bin/universe          = unknown

PATH: /Users/thomashansen/.gem/ruby/2.6.0/bin/
PATH: /usr/local/bin/
PATH: /usr/bin/
PATH: /bin/
PATH: /usr/sbin/
PATH: /sbin/
PATH: /usr/local/go/bin/
PATH: /usr/local/MacGPG2/bin/
PATH: /usr/local/share/dotnet/
PATH: ~/.dotnet/tools/
PATH: /Users/thomashansen/.gem/ruby/2.6.0/bin/
PATH: /Users/thomashansen/.rvm/bin/
PATH: /Users/thomashansen/.rvm/bin/

## ----------- ##
## Core tests. ##
## ----------- ##

configure:2438: looking for aux files: config.guess config.sub ltmain.sh compile missing install-sh
configure:2451:  trying ././
configure:2480:   ././config.guess found
configure:2480:   ././config.sub found
configure:2480:   ././ltmain.sh found
configure:2480:   ././compile found
configure:2480:   ././missing found
configure:2462:   ././install-sh found
configure:2613: checking for a BSD-compatible install
configure:2686: result: /usr/local/bin/ginstall -c
configure:2697: checking whether build environment is sane
configure:2752: result: yes
configure:2911: checking for a race-free mkdir -p
configure:2955: result: /usr/local/bin/gmkdir -p
configure:2962: checking for gawk
configure:2997: result: no
configure:2962: checking for mawk
configure:2997: result: no
configure:2962: checking for nawk
configure:2997: result: no
configure:2962: checking for awk
configure:2983: found /usr/bin/awk
configure:2994: result: awk
configure:3005: checking whether make sets $(MAKE)
configure:3028: result: yes
configure:3058: checking whether make supports nested variables
configure:3076: result: yes
configure:3226: checking whether make supports the include directive
configure:3241: make -f confmf.GNU && cat confinc.out
this is the am__doit target
configure:3244: $? = 0
configure:3263: result: yes (GNU style)
configure:3339: checking for gcc
configure:3371: result: /usr/local/opt/llvm/bin/clang
configure:3724: checking for C compiler version
configure:3733: /usr/local/opt/llvm/bin/clang --version >&5
Homebrew clang version 16.0.5
Target: x86_64-apple-darwin20.6.0
Thread model: posix
InstalledDir: /usr/local/opt/llvm/bin
configure:3744: $? = 0
configure:3733: /usr/local/opt/llvm/bin/clang -v >&5
Homebrew clang version 16.0.5
Target: x86_64-apple-darwin20.6.0
Thread model: posix
InstalledDir: /usr/local/opt/llvm/bin
configure:3744: $? = 0
configure:3733: /usr/local/opt/llvm/bin/clang -V >&5
clang-16: error: argument to '-V' is missing (expected 1 value)
clang-16: error: no input files
configure:3744: $? = 1
configure:3733: /usr/local/opt/llvm/bin/clang -qversion >&5
clang-16: error: unknown argument '-qversion'; did you mean '--version'?
clang-16: error: no input files
configure:3744: $? = 1
configure:3733: /usr/local/opt/llvm/bin/clang -version >&5
clang-16: error: unknown argument '-version'; did you mean '--version'?
clang-16: error: no input files
configure:3744: $? = 1
configure:3764: checking whether the C compiler works
configure:3786: /usr/local/opt/llvm/bin/clang  -I/usr/local/opt/llvm/include -L/usr/local/opt/llvm/lib conftest.c  >&5
ld: library not found for -lSystem
clang-16: error: linker command failed with exit code 1 (use -v to see invocation)
configure:3790: $? = 1
configure:3830: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "sqlite"
| #define PACKAGE_TARNAME "sqlite"
| #define PACKAGE_VERSION "3.40.1"
| #define PACKAGE_STRING "sqlite 3.40.1"
| #define PACKAGE_BUGREPORT "http://www.sqlite.org"
| #define PACKAGE_URL ""
| #define PACKAGE "sqlite"
| #define VERSION "3.40.1"
| /* end confdefs.h.  */
| 
| int
| main (void)
| {
| 
|   ;
|   return 0;
| }
configure:3835: error: in `/Users/thomashansen/Documents/projects/magic/sqlite-vss/vendor/sqlite':
configure:3837: error: C compiler cannot create executables
See `config.log' for more details

## ---------------- ##
## Cache variables. ##
## ---------------- ##

ac_cv_env_CC_set=set
ac_cv_env_CC_value=/usr/local/opt/llvm/bin/clang
ac_cv_env_CFLAGS_set=
ac_cv_env_CFLAGS_value=
ac_cv_env_CPPFLAGS_set=set
ac_cv_env_CPPFLAGS_value=-I/usr/local/opt/llvm/include
ac_cv_env_LDFLAGS_set=set
ac_cv_env_LDFLAGS_value=-L/usr/local/opt/llvm/lib
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_LT_SYS_LIBRARY_PATH_set=
ac_cv_env_LT_SYS_LIBRARY_PATH_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=
ac_cv_env_host_alias_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_path_install='/usr/local/bin/ginstall -c'
ac_cv_path_mkdir=/usr/local/bin/gmkdir
ac_cv_prog_AWK=awk
ac_cv_prog_ac_ct_CC=/usr/local/opt/llvm/bin/clang
ac_cv_prog_make_make_set=yes
am_cv_make_support_nested_variables=yes

## ----------------- ##
## Output variables. ##
## ----------------- ##

ACLOCAL='${SHELL} '\''/Users/thomashansen/Documents/projects/magic/sqlite-vss/vendor/sqlite/missing'\'' aclocal-1.16'
AMDEPBACKSLASH='\'
AMDEP_FALSE='#'
AMDEP_TRUE=''
AMTAR='$${TAR-tar}'
AM_BACKSLASH='\'
AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
AM_DEFAULT_VERBOSITY='1'
AM_V='$(V)'
AR=''
AUTOCONF='${SHELL} '\''/Users/thomashansen/Documents/projects/magic/sqlite-vss/vendor/sqlite/missing'\'' autoconf'
AUTOHEADER='${SHELL} '\''/Users/thomashansen/Documents/projects/magic/sqlite-vss/vendor/sqlite/missing'\'' autoheader'
AUTOMAKE='${SHELL} '\''/Users/thomashansen/Documents/projects/magic/sqlite-vss/vendor/sqlite/missing'\'' automake-1.16'
AWK='awk'
BUILD_CFLAGS=''
CC='/usr/local/opt/llvm/bin/clang'
CCDEPMODE=''
CFLAGS=''
CPPFLAGS='-I/usr/local/opt/llvm/include'
CSCOPE='cscope'
CTAGS='ctags'
CYGPATH_W='echo'
DEFS=''
DEPDIR='.deps'
DLLTOOL=''
DSYMUTIL=''
DUMPBIN=''
ECHO_C='\c'
ECHO_N=''
ECHO_T=''
EGREP=''
ETAGS='etags'
EXEEXT=''
EXTRA_SHELL_OBJ=''
FGREP=''
GREP=''
INSTALL_DATA='${INSTALL} -m 644'
INSTALL_PROGRAM='${INSTALL}'
INSTALL_SCRIPT='${INSTALL}'
INSTALL_STRIP_PROGRAM='$(install_sh) -c -s'
LD=''
LDFLAGS='-L/usr/local/opt/llvm/lib'
LIBOBJS=''
LIBS=''
LIBTOOL=''
LIPO=''
LN_S=''
LTLIBOBJS=''
LT_SYS_LIBRARY_PATH=''
MAKEINFO='${SHELL} '\''/Users/thomashansen/Documents/projects/magic/sqlite-vss/vendor/sqlite/missing'\'' makeinfo'
MANIFEST_TOOL=''
MKDIR_P='/usr/local/bin/gmkdir -p'
NM=''
NMEDIT=''
OBJDUMP=''
OBJEXT=''
OTOOL64=''
OTOOL=''
PACKAGE='sqlite'
PACKAGE_BUGREPORT='http://www.sqlite.org'
PACKAGE_NAME='sqlite'
PACKAGE_STRING='sqlite 3.40.1'
PACKAGE_TARNAME='sqlite'
PACKAGE_URL=''
PACKAGE_VERSION='3.40.1'
PATH_SEPARATOR=':'
RANLIB=''
READLINE_LIBS=''
SED=''
SET_MAKE=''
SHELL='/bin/sh'
SHELL_CFLAGS=''
STRIP=''
VERSION='3.40.1'
ac_ct_AR=''
ac_ct_CC='/usr/local/opt/llvm/bin/clang'
ac_ct_DUMPBIN=''
am__EXEEXT_FALSE=''
am__EXEEXT_TRUE=''
am__fastdepCC_FALSE=''
am__fastdepCC_TRUE=''
am__include='include'
am__isrc=''
am__leading_dot='.'
am__nodep='_no'
am__quote=''
am__tar='$${TAR-tar} chof - "$$tardir"'
am__untar='$${TAR-tar} xf -'
bindir='${exec_prefix}/bin'
build=''
build_alias=''
build_cpu=''
build_os=''
build_vendor=''
datadir='${datarootdir}'
datarootdir='${prefix}/share'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
dvidir='${docdir}'
exec_prefix='NONE'
host=''
host_alias=''
host_cpu=''
host_os=''
host_vendor=''
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
install_sh='${SHELL} /Users/thomashansen/Documents/projects/magic/sqlite-vss/vendor/sqlite/install-sh'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mandir='${datarootdir}/man'
mkdir_p='$(MKDIR_P)'
oldincludedir='/usr/include'
pdfdir='${docdir}'
prefix='NONE'
program_transform_name='s,x,x,'
psdir='${docdir}'
runstatedir='${localstatedir}/run'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
sysconfdir='${prefix}/etc'
target_alias=''

## ----------- ##
## confdefs.h. ##
## ----------- ##

/* confdefs.h */
#define PACKAGE_NAME "sqlite"
#define PACKAGE_TARNAME "sqlite"
#define PACKAGE_VERSION "3.40.1"
#define PACKAGE_STRING "sqlite 3.40.1"
#define PACKAGE_BUGREPORT "http://www.sqlite.org"
#define PACKAGE_URL ""
#define PACKAGE "sqlite"
#define VERSION "3.40.1"

configure: exit 77
learning4life commented 1 year ago

I am not a mac user and this can be a compiler issue, but your CPU is listed as "Intel x86-64h Haswell"

Your CPU has to support Advanced Vector Extensions 2 (AVX2).

Haswell processors (only Core and Xeon branded), Q2 2013 support AVX2 based on: https://en.wikipedia.org/wiki/Advanced_Vector_Extensions#CPUs_with_AVX2

As a temporary fix edit the sqlite-vss/CMakeLists.txt and replace faiss_avx2 with faiss, as described here: https://github.com/asg017/sqlite-vss/blob/main/docs.md