Python 2.7.1 (r271:86832, Jun 16 2011, 16:59:05)[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwinType "help", "copyright", "credits" or "license" for more information.>>> from pysqlite2 import dbapi2 as sqlite3>>> print sqlite3.sqlite_version3.7.15.2>>> import apsw>>> print apsw.sqlitelibversion()3.7.15.2>>> apsw_con = apsw.Connection(":memory:")>>> apsw_con.createscalarfunction("times_two", lambda x: 2*x, 1)>>> con = sqlite3.connect(apsw_con)Segmentation fault: 11
> (a) building a standalone sqlite3.so
$ ./configure
$ make
You'll end up with .libs/libsqlite3.so
$ python setup.py build_ext -I .../wherever -L .../wherever install
llvm-gcc-4.2 -Wl,-F. -bundle -undefined dynamic_lookup -Wl,-F. -arch i386 -arch x86_64 build/temp.macosx-10.7-intel-2.7/src/apsw.o -L/Users/sriramkarra/Downloads/software/unix/sqlite-autoconf-3071502/.libs/ -L/Users/sriramkarra/Downloads/software/unix/sqlite-autoconf-3071502/.libs -lsqlite3 -o build/lib.macosx-10.7-intel-2.7/apsw.sold: warning: ignoring file /Users/sriramkarra/Downloads/software/unix/sqlite-autoconf-3071502/.libs//libsqlite3.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
>
file was built for unsupported file format which is not the architecture
> being linked (i386)
You have to give the relevant flags to SQLite's configure to make it build
for all architectures (aka universal binary). This or similar variant may
work (untested):
$ ./configure CFLAGS="-arch i386 -arch x86_64"
$ make
Cardassia:sqlite-autoconf-3071502 sriramkarra$ makeif /bin/sh ./libtool --tag=CC --mode=compile gcc -DPACKAGE_NAME=\"sqlite\" -DPACKAGE_TARNAME=\"sqlite\" -DPACKAGE_VERSION=\"3.7.15.2\" -DPACKAGE_STRING=\"sqlite\ 3.7.15.2\" -DPACKAGE_BUGREPORT=\"http://www.sqlite.org\" -DPACKAGE_URL=\"\" -DPACKAGE=\"sqlite\" -DVERSION=\"3.7.15.2\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DHAVE_FDATASYNC=1 -DHAVE_USLEEP=1 -DHAVE_LOCALTIME_R=1 -DHAVE_GMTIME_R=1 -DHAVE_DECL_STRERROR_R=1 -DHAVE_STRERROR_R=1 -DHAVE_READLINE=1 -I. -I. -D_REENTRANT=1 -DSQLITE_THREADSAFE=1 -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_RTREE -arch i386 -arch x86_64 -MT sqlite3.lo -MD -MP -MF ".deps/sqlite3.Tpo" -c -o sqlite3.lo sqlite3.c; \then mv -f ".deps/sqlite3.Tpo" ".deps/sqlite3.Plo"; else rm -f ".deps/sqlite3.Tpo"; exit 1; fimkdir .libsgcc -DPACKAGE_NAME=\"sqlite\" -DPACKAGE_TARNAME=\"sqlite\" -DPACKAGE_VERSION=\"3.7.15.2\" "-DPACKAGE_STRING=\"sqlite 3.7.15.2\"" -DPACKAGE_BUGREPORT=\"http://www.sqlite.org\" -DPACKAGE_URL=\"\" -DPACKAGE=\"sqlite\" -DVERSION=\"3.7.15.2\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DHAVE_FDATASYNC=1 -DHAVE_USLEEP=1 -DHAVE_LOCALTIME_R=1 -DHAVE_GMTIME_R=1 -DHAVE_DECL_STRERROR_R=1 -DHAVE_STRERROR_R=1 -DHAVE_READLINE=1 -I. -I. -D_REENTRANT=1 -DSQLITE_THREADSAFE=1 -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_RTREE -arch i386 -arch x86_64 -MT sqlite3.lo -MD -MP -MF .deps/sqlite3.Tpo -c sqlite3.c -fno-common -DPIC -o .libs/sqlite3.ollvm-gcc-4.2: -E, -S, -save-temps and -M options are not allowed with multiple -arch flagsmake: *** [sqlite3.lo] Error 1
On 28/02/13 23:43, Sriram Karra wrote:> I get this error: llvm-gcc-4.2: -E, -S, -save-temps and -M options areI googled that error and got this resolution:
> not allowed with multiple -arch flags"
./configure --disable-dependency-tracking