Way to find out which Compilation Options were used to build SQLite
Asked Answered
W

4

20

During my performance tests I found out the the SQLite version which Apple provides on the iPhone 3.0 is significantly faster then my self compiled amalgamation SQLite version. So my question is, is there a way to find out which compilation options Apple did use?

Is there a test app which prints out all the default set pragams and sqlite3_config setting?

Wildee answered 19/5, 2009 at 7:14 Comment(0)
W
1

It looks like the only different in the pragma settings is the cache_size which is default 2000 but on the iPhone it is 500.

On some systems it's possible to get read the compiler setting with this: objdump --full-contents --section .GCC.command.line

Wildee answered 1/6, 2009 at 13:5 Comment(0)
N
20

You can use the compile_options pragma (or the related functions as mentioned in the linked documentation) to view the compile-time options that were used when building SQLite. However, the availability of this pragma (and the related functions) seems to depend on whether it was enabled at compile-time or not. The SQLite documentation says:

Support for the diagnostic functions sqlite3_compileoption_used() and sqlite3_compileoption_get() may be omitted by specifying the SQLITE_OMIT_COMPILEOPTION_DIAGS option at compile time.

So it is likely that your distribution did not enable this feature at compile time, which means you may not be able to view the options.

Nisan answered 7/1, 2013 at 15:41 Comment(0)
C
3

From command line:

# echo "PRAGMA compile_options;" | sqlite3

COMPILER=gcc-10.2.0
ENABLE_COLUMN_METADATA
ENABLE_DBPAGE_VTAB
ENABLE_DBSTAT_VTAB
ENABLE_FTS3_PARENTHESIS
ENABLE_FTS4
ENABLE_FTS5
ENABLE_GEOPOLY
ENABLE_JSON1
ENABLE_PREUPDATE_HOOK
ENABLE_RTREE
ENABLE_SESSION
ENABLE_STAT4
ENABLE_UNLOCK_NOTIFY
ENABLE_UPDATE_DELETE_LIMIT
OMIT_LOOKASIDE
SECURE_DELETE
SOUNDEX
TEMP_STORE=1
THREADSAFE=1
USE_ALLOCA
USE_FCNTL_TRACE
Centerboard answered 25/5, 2023 at 13:36 Comment(0)
E
2

THere is no way to ask libsqlite for its exact configuration short of trying all the possible permutations and testing each to see which behaves the same (unless Apple has made custom modifications). The best you can get to call sqlite3_libversion which returns sqlite's version number.

Emarie answered 19/5, 2009 at 10:50 Comment(0)
W
1

It looks like the only different in the pragma settings is the cache_size which is default 2000 but on the iPhone it is 500.

On some systems it's possible to get read the compiler setting with this: objdump --full-contents --section .GCC.command.line

Wildee answered 1/6, 2009 at 13:5 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.