From mne at qosmotec.com Mon Feb 1 05:03:05 2016 From: mne at qosmotec.com (Marcel Nehring) Date: Mon Feb 1 05:04:26 2016 Subject: [odb-users] AW: SQL Epiloge In-Reply-To: References: Message-ID: <021970097dcb4160b536f368956ad4e8@QEX.qosmotec.com> Hi, another small issue with this: if the epilogue file does not contain a trailing new line, this will break the comment ODB inserts after the file contents in the resulting database schema file. At least sqlplus complains about invalid syntax. Regards, Marcel -----Urspr?ngliche Nachricht----- Von: odb-users-bounces@codesynthesis.com [mailto:odb-users-bounces@codesynthesis.com] Im Auftrag von Marcel Nehring Gesendet: Freitag, 29. Januar 2016 16:58 An: odb-users@codesynthesis.com Betreff: [odb-users] SQL Epiloge Hi, I noticed some small things regarding the --sql-epilogue-file command line option of the ODB compiler. * Providing this option more than once is silently ignored and only the first file specified will be appended. If it would be possible to use this (and the similar options) more than once it could be helpful. If this is on purpose maybe adding a warning message for clarification would be nice. * If the provided file uses both, carriage return and line feed to start a new line this will result in each new line to be doubled (i.e. empty lines) in the resulting database schema file. Regards, Marcel From albert.gu at ringcentral.com Mon Feb 1 01:58:56 2016 From: albert.gu at ringcentral.com (Albert (Jinku) Gu) Date: Mon Feb 1 14:23:32 2016 Subject: [odb-users] Re: ODB Crashed in a multi-threaded environment In-Reply-To: <1514EAEB-F0D1-4D3D-805A-9A17436A26B5@ringcentral.com> References: <1514EAEB-F0D1-4D3D-805A-9A17436A26B5@ringcentral.com> Message-ID: By the way, there is another link says: > Sharing a single instance of odb::database between multiple threads > is the recommended way. By default, it will use the connection pool > and re-use connections for different threads, as required. However, in our app, we share a single instance of odb::database between multiple threads, and use the connection pool. One thread is used for querying the database, the other thread is responsible for reading and writing database. According to the instruction, it should work. After debugging, I find that the transaction in another thread is taken as the current thread?s by mistake. Is there anything wrong? For your information: http://www.codesynthesis.com/pipermail/odb-users/2014-April/001821.html Regards, Albert On Feb 1, 2016, at 9:45 AM, Albert (Jinku) Gu > wrote: Hi guys, According to these two links: * http://www.codesynthesis.com/pipermail/odb-users/2011-June/000124.html * http://www.codesynthesis.com/pipermail/odb-users/2014-November/002242.html We can know that odb::database is thread safe. With the connection pool, ODB will assign different odd::sqlite::connection instance to different threads. In our app, there are two threads with a shared odd::sqlite::database instance, one thread is responsible for writing and reading, the other one is for reading only. Each of them will apply a connection before executing a transaction. Sometimes, these two threads will access the same table, maybe the same row in database. At this time, odb will crash. And the exception message is ?transaction already in progress in this thread?. Am I doing something wrong? How can I resolve this issue? Any help will be appreciated! Regards, Albert From barry.li at ringcentral.com Mon Feb 1 20:58:36 2016 From: barry.li at ringcentral.com (Barry Li) Date: Tue Feb 2 08:00:53 2016 Subject: [odb-users] how to support inheritance with odb Message-ID: Skipped content of type multipart/related-------------- next part -------------- A non-text attachment was scrubbed... Name: PastedGraphic-1.tiff Type: image/tiff Size: 31172 bytes Desc: PastedGraphic-1.tiff Url : http://codesynthesis.com/pipermail/odb-users/attachments/20160202/8159a45d/PastedGraphic-1-0001.tiff From boris at codesynthesis.com Tue Feb 2 08:27:37 2016 From: boris at codesynthesis.com (Boris Kolpackov) Date: Tue Feb 2 08:27:38 2016 Subject: [odb-users] ODB Crashed in a multi-threaded environment In-Reply-To: <1514EAEB-F0D1-4D3D-805A-9A17436A26B5@ringcentral.com> References: <1514EAEB-F0D1-4D3D-805A-9A17436A26B5@ringcentral.com> Message-ID: Hi Albert, Albert (Jinku) Gu writes: > And the exception message is ?transaction already in progress in this > thread?. This means you have tried to create a nested ODB transaction, something along these lines: void f () { transaction t (db.begin ()); // Exception. ... } void g () { transaction t (db.begin ()); f (); } Boris From steve.chen at ringcentral.com Tue Feb 2 08:11:39 2016 From: steve.chen at ringcentral.com (Steve Chen) Date: Tue Feb 2 08:33:10 2016 Subject: [odb-users] Regarding Sqlite WAL model support in ODB Message-ID: <2A5F8CC8-D64C-443D-AA53-11A7AA9E38BD@ringcentral.com> Hi, Our mobile application (iOS & Android) is using the ODB, and in order to improve the performance of reading & writing data, we want to support ?WAL? model, per sqlite official document https://www.sqlite.org/wal.html, "WAL provides more concurrency as readers do not block writers and a writer does not block readers. Reading and writing can proceed concurrently.? We used following code: m_db = std::shared_ptr(new odb::sqlite::database(dbFile, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | SQLITE_OPEN_WAL));; But it seems does not work. If reader is trying to read data but writer is also writing some big data, then reader will get a ?db operation timeout? exception. Any suggestion? How to support WAL in ODB? From boris at codesynthesis.com Tue Feb 2 08:40:16 2016 From: boris at codesynthesis.com (Boris Kolpackov) Date: Tue Feb 2 08:40:17 2016 Subject: [odb-users] Re: how to support inheritance with odb In-Reply-To: References: Message-ID: Hi Barry, Barry Li writes: > hi , > SOS !!!!! > can you help me ? we face a big issue with odd. A couple of points: 1. Don't send any images to the mailing list. See posting guidelines for details: http://codesynthesis.com/support/posting-guidelines.xhtml 2. Take the time to check your email for mistakes. If you don't have time for this simple courtesy, why do you expect someone to have time to answer your questions? The tool is called ODB, not 'odd'. 3. Finally, check the manual if the question you are asking is already answered there. In this particular case, Chapter 8, "Inheritance". Boris From gautier.duval at gmail.com Tue Feb 2 08:44:27 2016 From: gautier.duval at gmail.com (gautier duval) Date: Tue Feb 2 09:03:08 2016 Subject: [odb-users] Tool to convert existing SQL to C++/ODB classes Message-ID: Hi I was interested in using your product ODB but i would like to knwo if there is an existing tool/command/ simple way to generate some C++/ODB classes from an existing SQL code / schema/tables? edit : see http://www.codesynthesis.com/pipermail/odb-users/2013-May/001291.html Thanks by advance Best Regards, Gautier Duval From boris at codesynthesis.com Tue Feb 2 09:15:14 2016 From: boris at codesynthesis.com (Boris Kolpackov) Date: Tue Feb 2 09:15:16 2016 Subject: [odb-users] Regarding Sqlite WAL model support in ODB In-Reply-To: <2A5F8CC8-D64C-443D-AA53-11A7AA9E38BD@ringcentral.com> References: <2A5F8CC8-D64C-443D-AA53-11A7AA9E38BD@ringcentral.com> Message-ID: Hi Steve, Steve Chen writes: > m_db = std::shared_ptr( > new odb::sqlite::database( > dbFile, > SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | SQLITE_OPEN_WAL)); I don't think the SQLITE_OPEN_WAL flag is meant to be passed to sqlite2_open_v2(). Quoting SQLite C API Reference[1]: [...] #define SQLITE_OPEN_PRIVATECACHE 0x00040000 /* Ok for sqlite3_open_v2() */ #define SQLITE_OPEN_WAL 0x00080000 /* VFS only */ As discussed in the SQLite WAL page[2], the way to convert a database to the WAL mode is with a PRAGMA: m_db->execute ("PRAGMA journal_mode=WAL"); Also, that promise from the WAL doc you have quoted: "WAL provides more concurrency as readers do not block writers and a writer does not block readers. Reading and writing can proceed concurrently." Sounds a lot better than the reality. In particular, check the "Isolation And Concurrency" section in the Isolation in SQLite[3]. Finally, note that ODB supports SQLite's unlock notification feature which is another way to improve concurrency in SQLite. [1] https://www.sqlite.org/capi3ref.html#SQLITE_OPEN_AUTOPROXY [2] https://www.sqlite.org/wal.html [3] https://www.sqlite.org/isolation.html [4] https://www.sqlite.org/unlock_notify.html Boris From odb at a-cunningham.com Tue Feb 2 10:24:00 2016 From: odb at a-cunningham.com (Andrew Cunningham) Date: Tue Feb 2 10:24:07 2016 Subject: [odb-users] Re Threading... Message-ID: The "current transaction" ( an important concept to ODB) is local to the thread - it is kept in TLS -Thread Local Storage. ODB assumes you will be keeping a connection/transaction local to that thread, not sharing between threads So if you start a transaction in one thread, that transaction will not be the "current" transaction in another thread. In my case ( a single user SQLite database), I have one global transaction/connection/session. When I start a thread , I "force" the current transaction/connection/session for that new thread to the global transaction/connection/session. By the way, there is another link says: > > > Sharing a single instance of odb::database between multiple threads > > is the recommended way. By default, it will use the connection pool > > and re-use connections for different threads, as required. > > However, in our app, we share a single instance of odb::database between > multiple threads, and use the connection pool. > > One thread is used for querying the database, the other thread is > responsible for reading and writing database. According to the instruction, > it should work. > > After debugging, I find that the transaction in another thread is taken as > the current thread?s by mistake. > > I > **************************************** > From sverre at awion.dk Tue Feb 2 20:01:15 2016 From: sverre at awion.dk (Sverre Eplov) Date: Tue Feb 2 20:01:25 2016 Subject: [odb-users] Build libodb on OS X References: <76EFB87E-E526-4D18-A768-1C8F89C4D0F2@bsf.dk> Message-ID: <2D0B8F05-41B2-4FCE-B3AD-83E10B55ACEB@awion.dk> Hi all, I?ve run into some strange things The system is OS X 10.11.3 (15D21) Clang: Apple LLVM version 7.0.2 (clang-700.1.81) Target: x86_64-apple-darwin15.3.0 Thread model: posix libtool 2.6.4 autoconf 2.69 automake 1.15 Story is, that I wanted to build from GIT to get the latest and hottest off the press. When that did not turn out so well, I wanted to revert to builds from the downloaded source tar files. When I try to execute ?./configure?, in a folder where libodb source code has been unpacked from tar file, it fails during check for the C preprocessor - the strange thing is, that it is the generated testfile, which contains an error - the last line in the file is ?Syntax Error? (which the C preprocessor chokes on, which seems fair enough.) The Config log is attached at the bottom of this text. Anyone know how to whack that kind of deamon ? Output from Config.log when executing ?./configure?: This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by libodb configure 2.4.0, which was generated by GNU Autoconf 2.69. Invocation command line was $ ./configure CC=clang CPP=clang ## --------- ## ## Platform. ## ## --------- ## hostname = Blackie.local uname -m = x86_64 uname -r = 15.3.0 uname -s = Darwin uname -v = Darwin Kernel Version 15.3.0: Thu Dec 10 18:40:58 PST 2015; root:xnu-3248.30.4~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 15.3.0: Thu Dec 10 18:40:58 PST 2015; root:xnu-3248.30.4~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: 16.00 gigabytes Default processor set: 249 tasks, 1340 threads, 8 processors Load average: 0.85, Mach factor: 7.14 /bin/machine = unknown /usr/bin/oslevel = unknown /bin/universe = unknown PATH: /Users/sverre/bin PATH: /usr/local/bin PATH: /usr/bin PATH: /bin PATH: /usr/sbin PATH: /sbin PATH: /opt/X11/bin PATH: /Library/TeX/texbin ## ----------- ## ## Core tests. ## ## ----------- ## configure:2311: checking for a BSD-compatible install configure:2379: result: /usr/bin/install -c configure:2390: checking whether build environment is sane configure:2445: result: yes configure:2596: checking for a thread-safe mkdir -p configure:2635: result: config/install-sh -c -d configure:2642: checking for gawk configure:2672: result: no configure:2642: checking for mawk configure:2672: result: no configure:2642: checking for nawk configure:2672: result: no configure:2642: checking for awk configure:2658: found /usr/bin/awk configure:2669: result: awk configure:2680: checking whether make sets $(MAKE) configure:2702: result: yes configure:2783: checking how to create a ustar tar archive configure:2796: tar --version bsdtar 2.8.3 - libarchive 2.8.3 configure:2799: $? = 0 configure:2839: tardir=conftest.dir && eval tar --format=ustar -chf - "$tardir" >conftest.tar configure:2842: $? = 0 configure:2846: tar -xf - &5 Apple LLVM version 7.0.2 (clang-700.1.81) Target: x86_64-apple-darwin15.3.0 Thread model: posix configure:3256: $? = 0 configure:3245: clang -v >&5 Apple LLVM version 7.0.2 (clang-700.1.81) Target: x86_64-apple-darwin15.3.0 Thread model: posix configure:3256: $? = 0 configure:3245: clang -V >&5 clang: error: argument to '-V' is missing (expected 1 value) clang: error: no input files configure:3256: $? = 1 configure:3245: clang -qversion >&5 clang: error: unknown argument: '-qversion' clang: error: no input files configure:3256: $? = 1 configure:3276: checking whether the C compiler works configure:3298: clang conftest.c >&5 configure:3302: $? = 0 configure:3350: result: yes configure:3353: checking for C compiler default output file name configure:3355: result: a.out configure:3361: checking for suffix of executables configure:3368: clang -o conftest conftest.c >&5 configure:3372: $? = 0 configure:3394: result: configure:3416: checking whether we are cross compiling configure:3424: clang -o conftest conftest.c >&5 configure:3428: $? = 0 configure:3435: ./conftest configure:3439: $? = 0 configure:3454: result: no configure:3459: checking for suffix of object files configure:3481: clang -c conftest.c >&5 configure:3485: $? = 0 configure:3506: result: o configure:3510: checking whether we are using the GNU C compiler configure:3529: clang -c conftest.c >&5 configure:3529: $? = 0 configure:3538: result: yes configure:3547: checking whether clang accepts -g configure:3567: clang -c -g conftest.c >&5 configure:3567: $? = 0 configure:3608: result: yes configure:3625: checking for clang option to accept ISO C89 configure:3688: clang -c -g -O2 conftest.c >&5 configure:3688: $? = 0 configure:3701: result: none needed configure:3723: checking dependency style of clang configure:3834: result: gcc3 configure:3899: checking for ar configure:3915: found /usr/bin/ar configure:3926: result: ar configure:3952: checking the archiver (ar) interface configure:3962: clang -c -g -O2 conftest.c >&5 configure:3962: $? = 0 configure:3964: ar cru libconftest.a conftest.o >&5 configure:3967: $? = 0 configure:3990: result: ar configure:4040: checking build system type configure:4054: result: x86_64-apple-darwin15.3.0 configure:4074: checking host system type configure:4087: result: x86_64-apple-darwin15.3.0 configure:4128: checking how to print strings configure:4155: result: printf configure:4176: checking for a sed that does not truncate output configure:4240: result: /usr/bin/sed configure:4258: checking for grep that handles long lines and -e configure:4316: result: /usr/bin/grep configure:4321: checking for egrep configure:4383: result: /usr/bin/grep -E configure:4388: checking for fgrep configure:4450: result: /usr/bin/grep -F configure:4485: checking for ld used by clang configure:4552: result: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld configure:4559: checking if the linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) is GNU ld configure:4574: result: no configure:4586: checking for BSD- or MS-compatible name lister (nm) configure:4635: result: /usr/bin/nm configure:4765: checking the name lister (/usr/bin/nm) interface configure:4772: clang -c -g -O2 conftest.c >&5 configure:4775: /usr/bin/nm "conftest.o" configure:4778: output 00000000000001f8 S _some_variable configure:4785: result: BSD nm configure:4788: checking whether ln -s works configure:4792: result: yes configure:4800: checking the maximum length of command line arguments configure:4931: result: 196608 configure:4948: checking whether the shell understands some XSI constructs configure:4958: result: yes configure:4962: checking whether the shell understands "+=" configure:4968: result: yes configure:5003: checking how to convert x86_64-apple-darwin15.3.0 file names to x86_64-apple-darwin15.3.0 format configure:5043: result: func_convert_file_noop configure:5050: checking how to convert x86_64-apple-darwin15.3.0 file names to toolchain format configure:5070: result: func_convert_file_noop configure:5077: checking for /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld option to reload object files configure:5084: result: -r configure:5158: checking for objdump configure:5188: result: no configure:5214: checking how to recognize dependent libraries configure:5412: result: pass_all configure:5497: checking for dlltool configure:5527: result: no configure:5554: checking how to associate runtime and link libraries configure:5581: result: printf %s\n configure:5705: checking for archiver @FILE support configure:5722: clang -c -g -O2 conftest.c >&5 configure:5722: $? = 0 configure:5725: ar cru libconftest.a @conftest.lst >&5 ar: @conftest.lst: No such file or directory configure:5728: $? = 1 configure:5748: result: no configure:5806: checking for strip configure:5822: found /usr/bin/strip configure:5833: result: strip configure:5905: checking for ranlib configure:5921: found /usr/bin/ranlib configure:5932: result: ranlib configure:6034: checking command to parse /usr/bin/nm output from clang object configure:6154: clang -c -g -O2 conftest.c >&5 configure:6157: $? = 0 configure:6161: /usr/bin/nm conftest.o \| sed -n -e 's/^.*[ ]\([BCDEGRST][BCDEGRST]*\)[ ][ ]*\([_A-Za-z][_A-Za-z0-9]*\)$/\1 \2 \2/p' | sed '/ __gnu_lto/d' \> conftest.nm configure:6164: $? = 0 cannot find nm_test_var in conftest.nm configure:6154: clang -c -g -O2 conftest.c >&5 configure:6157: $? = 0 configure:6161: /usr/bin/nm conftest.o \| sed -n -e 's/^.*[ ]\([BCDEGRST][BCDEGRST]*\)[ ][ ]*_\([_A-Za-z][_A-Za-z0-9]*\)$/\1 _\2 \2/p' | sed '/ __gnu_lto/d' \> conftest.nm configure:6164: $? = 0 configure:6230: clang -o conftest -g -O2 conftest.c conftstm.o >&5 warning: (x86_64) could not find object file symbol for symbol _main configure:6233: $? = 0 configure:6271: result: ok configure:6308: checking for sysroot configure:6338: result: no configure:6601: checking for mt configure:6631: result: no configure:6651: checking if : is a manifest tool configure:6657: : '-?' configure:6665: result: no configure:6721: checking for dsymutil configure:6737: found /usr/bin/dsymutil configure:6748: result: dsymutil configure:6813: checking for nmedit configure:6829: found /usr/bin/nmedit configure:6840: result: nmedit configure:6905: checking for lipo configure:6921: found /usr/bin/lipo configure:6932: result: lipo configure:6997: checking for otool configure:7013: found /usr/bin/otool configure:7024: result: otool configure:7089: checking for otool64 configure:7119: result: no configure:7164: checking for -single_module linker flag clang -g -O2 -o libconftest.dylib -dynamiclib -Wl,-single_module conftest.c configure:7197: result: yes configure:7200: checking for -exported_symbols_list linker flag configure:7220: clang -o conftest -g -O2 -Wl,-exported_symbols_list,conftest.sym conftest.c >&5 configure:7220: $? = 0 configure:7230: result: yes configure:7233: checking for -force_load linker flag clang -g -O2 -c -o conftest.o conftest.c ar cru libconftest.a conftest.o ranlib libconftest.a clang -g -O2 -o conftest conftest.c -Wl,-force_load,./libconftest.a configure:7265: result: yes configure:7307: checking how to run the C preprocessor configure:7377: result: clang configure:7397: clang conftest.c conftest.c:16:8: error: unknown type name 'Syntax' Syntax error ^ conftest.c:16:20: error: expected ';' after top level declarator Syntax error ^ ; 2 errors generated. configure:7397: $? = 1 configure: failed program was: | /* confdefs.h */ | #define PACKAGE_NAME "libodb" | #define PACKAGE_TARNAME "libodb" | #define PACKAGE_VERSION "2.4.0" | #define PACKAGE_STRING "libodb 2.4.0" | #define PACKAGE_BUGREPORT "odb-users@codesynthesis.com" | #define PACKAGE_URL "" | #define PACKAGE "libodb" | #define VERSION "2.4.0" | /* end confdefs.h. */ | #ifdef __STDC__ | # include | #else | # include | #endif | Syntax error configure:7397: clang conftest.c conftest.c:16:8: error: unknown type name 'Syntax' Syntax error ^ conftest.c:16:20: error: expected ';' after top level declarator Syntax error ^ ; 2 errors generated. configure:7397: $? = 1 configure: failed program was: | /* confdefs.h */ | #define PACKAGE_NAME "libodb" | #define PACKAGE_TARNAME "libodb" | #define PACKAGE_VERSION "2.4.0" | #define PACKAGE_STRING "libodb 2.4.0" | #define PACKAGE_BUGREPORT "odb-users@codesynthesis.com" | #define PACKAGE_URL "" | #define PACKAGE "libodb" | #define VERSION "2.4.0" | /* end confdefs.h. */ | #ifdef __STDC__ | # include | #else | # include | #endif | Syntax error configure:7427: error: in `/Users/sverre/Packed/CPP/ODB/libodb-2.4.0': configure:7429: error: C preprocessor "clang" fails sanity check See `config.log' for more details ## ---------------- ## ## Cache variables. ## ## ---------------- ## ac_cv_build=x86_64-apple-darwin15.3.0 ac_cv_c_compiler_gnu=yes ac_cv_env_CCC_set= ac_cv_env_CCC_value= ac_cv_env_CC_set=set ac_cv_env_CC_value=clang ac_cv_env_CFLAGS_set= ac_cv_env_CFLAGS_value= ac_cv_env_CPPFLAGS_set= ac_cv_env_CPPFLAGS_value= ac_cv_env_CPP_set=set ac_cv_env_CPP_value=clang ac_cv_env_CXXCPP_set= ac_cv_env_CXXCPP_value= ac_cv_env_CXXFLAGS_set= ac_cv_env_CXXFLAGS_value= ac_cv_env_CXX_set=set ac_cv_env_CXX_value=/usr/bin/clang++ ac_cv_env_LDFLAGS_set= ac_cv_env_LDFLAGS_value= ac_cv_env_LIBS_set= ac_cv_env_LIBS_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_host=x86_64-apple-darwin15.3.0 ac_cv_objext=o ac_cv_path_EGREP='/usr/bin/grep -E' ac_cv_path_FGREP='/usr/bin/grep -F' ac_cv_path_GREP=/usr/bin/grep ac_cv_path_SED=/usr/bin/sed ac_cv_path_install='/usr/bin/install -c' ac_cv_prog_AWK=awk ac_cv_prog_CPP=clang ac_cv_prog_ac_ct_AR=ar ac_cv_prog_ac_ct_CC=clang ac_cv_prog_ac_ct_DSYMUTIL=dsymutil ac_cv_prog_ac_ct_LIPO=lipo ac_cv_prog_ac_ct_NMEDIT=nmedit ac_cv_prog_ac_ct_OTOOL=otool ac_cv_prog_ac_ct_RANLIB=ranlib ac_cv_prog_ac_ct_STRIP=strip ac_cv_prog_cc_c89= ac_cv_prog_cc_g=yes ac_cv_prog_make_make_set=yes am_cv_CC_dependencies_compiler_type=gcc3 am_cv_ar_interface=ar am_cv_prog_tar_ustar=gnutar lt_cv_apple_cc_single_mod=yes lt_cv_ar_at_file=no lt_cv_deplibs_check_method=pass_all lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_ld_exported_symbols_list=yes lt_cv_ld_force_load=yes lt_cv_ld_reload_flag=-r lt_cv_nm_interface='BSD nm' lt_cv_path_LD=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld lt_cv_path_NM=/usr/bin/nm lt_cv_path_mainfest_tool=no lt_cv_prog_gnu_ld=no lt_cv_sharedlib_from_linklib_cmd='printf %s\n' lt_cv_sys_global_symbol_pipe='sed -n -e '\''s/^.*[ ]\([BCDEGRST][BCDEGRST]*\)[ ][ ]*_\([_A-Za-z][_A-Za-z0-9]*\)$/\1 _\2 \2/p'\'' | sed '\''/ __gnu_lto/d'\''' lt_cv_sys_global_symbol_to_c_name_address='sed -n -e '\''s/^: \([^ ]*\)[ ]*$/ {\"\1\", (void *) 0},/p'\'' -e '\''s/^[BCDEGRST]* \([^ ]*\) \([^ ]*\)$/ {"\2", (void *) \&\2},/p'\''' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='sed -n -e '\''s/^: \([^ ]*\)[ ]*$/ {\"\1\", (void *) 0},/p'\'' -e '\''s/^[BCDEGRST]* \([^ ]*\) \(lib[^ ]*\)$/ {"\2", (void *) \&\2},/p'\'' -e '\''s/^[BCDEGRST]* \([^ ]*\) \([^ ]*\)$/ {"lib\2", (void *) \&\2},/p'\''' lt_cv_sys_global_symbol_to_cdecl='sed -n -e '\''s/^T .* \(.*\)$/extern int \1();/p'\'' -e '\''s/^[BCDEGRST]* .* \(.*\)$/extern char \1;/p'\''' lt_cv_sys_max_cmd_len=196608 lt_cv_to_host_file_cmd=func_convert_file_noop lt_cv_to_tool_file_cmd=func_convert_file_noop ## ----------------- ## ## Output variables. ## ## ----------------- ## ACLOCAL='${SHELL} /Users/sverre/Packed/CPP/ODB/libodb-2.4.0/config/missing --run aclocal-1.12' AMDEPBACKSLASH='\' AMDEP_FALSE='#' AMDEP_TRUE='' AMTAR='$${TAR-tar}' AR='ar' AS='' AUTOCONF='${SHELL} /Users/sverre/Packed/CPP/ODB/libodb-2.4.0/config/missing --run autoconf' AUTOHEADER='${SHELL} /Users/sverre/Packed/CPP/ODB/libodb-2.4.0/config/missing --run autoheader' AUTOMAKE='${SHELL} /Users/sverre/Packed/CPP/ODB/libodb-2.4.0/config/missing --run automake-1.12' AWK='awk' CC='clang' CCDEPMODE='depmode=gcc3' CFLAGS='-g -O2' CPP='clang' CPPFLAGS='' CXX='/usr/bin/clang++' CXXCPP='' CXXDEPMODE='' CXXFLAGS='' CYGPATH_W='echo' DEFS='' DEPDIR='.deps' DLLTOOL='false' DSYMUTIL='dsymutil' DUMPBIN='' ECHO_C='\c' ECHO_N='' ECHO_T='' EGREP='/usr/bin/grep -E' EXEEXT='' FGREP='/usr/bin/grep -F' GREP='/usr/bin/grep' INSTALL_DATA='${INSTALL} -m 644' INSTALL_PROGRAM='${INSTALL}' INSTALL_SCRIPT='${INSTALL}' INSTALL_STRIP_PROGRAM='$(install_sh) -c -s' LD='/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld' LDFLAGS='' LIBOBJS='' LIBS='' LIBTOOL='' LIPO='lipo' LN_S='ln -s' LTLIBOBJS='' MAKEINFO='${SHELL} /Users/sverre/Packed/CPP/ODB/libodb-2.4.0/config/missing --run makeinfo' MANIFEST_TOOL=':' MKDIR_P='config/install-sh -c -d' NM='/usr/bin/nm' NMEDIT='nmedit' OBJDUMP='false' OBJEXT='o' ODB_THREADS_NONE_FALSE='' ODB_THREADS_NONE_TRUE='' ODB_THREADS_POSIX_FALSE='' ODB_THREADS_POSIX_TRUE='' ODB_THREADS_WIN32_FALSE='' ODB_THREADS_WIN32_TRUE='' ODB_WIN32_FALSE='' ODB_WIN32_TRUE='' OTOOL64=':' OTOOL='otool' PACKAGE='libodb' PACKAGE_BUGREPORT='odb-users@codesynthesis.com' PACKAGE_NAME='libodb' PACKAGE_STRING='libodb 2.4.0' PACKAGE_TARNAME='libodb' PACKAGE_URL='' PACKAGE_VERSION='2.4.0' PATH_SEPARATOR=':' PTHREAD_CXX='' PTHREAD_CXXFLAGS='' PTHREAD_LIBS='' RANLIB='ranlib' SED='/usr/bin/sed' SET_MAKE='' SHELL='/bin/sh' STRIP='strip' VERSION='2.4.0' ac_ct_AR='ar' ac_ct_CC='clang' ac_ct_CXX='' ac_ct_DUMPBIN='' acx_pthread_config='' am__EXEEXT_FALSE='' am__EXEEXT_TRUE='' am__fastdepCC_FALSE='#' am__fastdepCC_TRUE='' am__fastdepCXX_FALSE='' am__fastdepCXX_TRUE='' am__include='include' am__isrc='' am__leading_dot='.' am__nodep='_no' am__quote='' am__tar='tar --format=ustar -chf - "$$tardir"' am__untar='tar -xf -' bindir='${exec_prefix}/bin' build='x86_64-apple-darwin15.3.0' build_alias='' build_cpu='x86_64' build_os='darwin15.3.0' build_vendor='apple' datadir='${datarootdir}' datarootdir='${prefix}/share' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' dvidir='${docdir}' exec_prefix='NONE' host='x86_64-apple-darwin15.3.0' host_alias='' host_cpu='x86_64' host_os='darwin15.3.0' host_vendor='apple' htmldir='${docdir}' includedir='${prefix}/include' infodir='${datarootdir}/info' install_sh='${SHELL} /Users/sverre/Packed/CPP/ODB/libodb-2.4.0/config/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}' pkgconfigdir='' prefix='NONE' program_transform_name='s,x,x,' psdir='${docdir}' sbindir='${exec_prefix}/sbin' sharedstatedir='${prefix}/com' sysconfdir='${prefix}/etc' target_alias='' ## ----------- ## ## confdefs.h. ## ## ----------- ## /* confdefs.h */ #define PACKAGE_NAME "libodb" #define PACKAGE_TARNAME "libodb" #define PACKAGE_VERSION "2.4.0" #define PACKAGE_STRING "libodb 2.4.0" #define PACKAGE_BUGREPORT "odb-users@codesynthesis.com" #define PACKAGE_URL "" #define PACKAGE "libodb" #define VERSION "2.4.0" configure: exit 1 From sverre at awion.dk Wed Feb 3 03:30:31 2016 From: sverre at awion.dk (Sverre Eplov) Date: Wed Feb 3 03:30:43 2016 Subject: [odb-users] Build libodb on OS X (Solved) In-Reply-To: <2D0B8F05-41B2-4FCE-B3AD-83E10B55ACEB@awion.dk> References: <76EFB87E-E526-4D18-A768-1C8F89C4D0F2@bsf.dk> <2D0B8F05-41B2-4FCE-B3AD-83E10B55ACEB@awion.dk> Message-ID: <8FDA5D5A-6998-46DB-8033-0282E57FF04B@awion.dk> Sooo ? as I delved into what the configure scripts was testing, I found out that it was ?preprocessor ONLY?. So on a mad impulse I tried: ./configure CC=clang CPP=?clang -E? That worked ;) br, /Sverre > On 03-02-2016, at 02.01, Sverre Eplov wrote: > > > Hi all, > > I?ve run into some strange things > > The system is OS X 10.11.3 (15D21) > > Clang: Apple LLVM version 7.0.2 (clang-700.1.81) > Target: x86_64-apple-darwin15.3.0 > Thread model: posix > > libtool 2.6.4 > autoconf 2.69 > automake 1.15 > > > Story is, that I wanted to build from GIT to get the latest and hottest off the press. When that did not turn out so well, I wanted to revert to builds from the downloaded source tar files. > > > When I try to execute ?./configure?, in a folder where libodb source code has been unpacked from tar file, it fails during check for the C preprocessor - the strange thing is, that it is the generated testfile, which contains an error - the last line in the file is ?Syntax Error? (which the C preprocessor chokes on, which seems fair enough.) > > The Config log is attached at the bottom of this text. > > Anyone know how to whack that kind of deamon ? > > > > > Output from Config.log when executing ?./configure?: > > > > This file contains any messages produced by compilers while > running configure, to aid debugging if configure makes a mistake. > > It was created by libodb configure 2.4.0, which was > generated by GNU Autoconf 2.69. Invocation command line was > > $ ./configure CC=clang CPP=clang > > ## --------- ## > ## Platform. ## > ## --------- ## > > hostname = Blackie.local > uname -m = x86_64 > uname -r = 15.3.0 > uname -s = Darwin > uname -v = Darwin Kernel Version 15.3.0: Thu Dec 10 18:40:58 PST 2015; root:xnu-3248.30.4~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 15.3.0: Thu Dec 10 18:40:58 PST 2015; root:xnu-3248.30.4~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: 16.00 gigabytes > Default processor set: 249 tasks, 1340 threads, 8 processors > Load average: 0.85, Mach factor: 7.14 > /bin/machine = unknown > /usr/bin/oslevel = unknown > /bin/universe = unknown > > PATH: /Users/sverre/bin > PATH: /usr/local/bin > PATH: /usr/bin > PATH: /bin > PATH: /usr/sbin > PATH: /sbin > PATH: /opt/X11/bin > PATH: /Library/TeX/texbin > > > ## ----------- ## > ## Core tests. ## > ## ----------- ## > > configure:2311: checking for a BSD-compatible install > configure:2379: result: /usr/bin/install -c > configure:2390: checking whether build environment is sane > configure:2445: result: yes > configure:2596: checking for a thread-safe mkdir -p > configure:2635: result: config/install-sh -c -d > configure:2642: checking for gawk > configure:2672: result: no > configure:2642: checking for mawk > configure:2672: result: no > configure:2642: checking for nawk > configure:2672: result: no > configure:2642: checking for awk > configure:2658: found /usr/bin/awk > configure:2669: result: awk > configure:2680: checking whether make sets $(MAKE) > configure:2702: result: yes > configure:2783: checking how to create a ustar tar archive > configure:2796: tar --version > bsdtar 2.8.3 - libarchive 2.8.3 > configure:2799: $? = 0 > configure:2839: tardir=conftest.dir && eval tar --format=ustar -chf - "$tardir" >conftest.tar > configure:2842: $? = 0 > configure:2846: tar -xf - configure:2849: $? = 0 > configure:2862: result: gnutar > configure:2881: checking for style of include used by make > configure:2909: result: GNU > configure:2980: checking for gcc > configure:3007: result: clang > configure:3236: checking for C compiler version > configure:3245: clang --version >&5 > Apple LLVM version 7.0.2 (clang-700.1.81) > Target: x86_64-apple-darwin15.3.0 > Thread model: posix > configure:3256: $? = 0 > configure:3245: clang -v >&5 > Apple LLVM version 7.0.2 (clang-700.1.81) > Target: x86_64-apple-darwin15.3.0 > Thread model: posix > configure:3256: $? = 0 > configure:3245: clang -V >&5 > clang: error: argument to '-V' is missing (expected 1 value) > clang: error: no input files > configure:3256: $? = 1 > configure:3245: clang -qversion >&5 > clang: error: unknown argument: '-qversion' > clang: error: no input files > configure:3256: $? = 1 > configure:3276: checking whether the C compiler works > configure:3298: clang conftest.c >&5 > configure:3302: $? = 0 > configure:3350: result: yes > configure:3353: checking for C compiler default output file name > configure:3355: result: a.out > configure:3361: checking for suffix of executables > configure:3368: clang -o conftest conftest.c >&5 > configure:3372: $? = 0 > configure:3394: result: > configure:3416: checking whether we are cross compiling > configure:3424: clang -o conftest conftest.c >&5 > configure:3428: $? = 0 > configure:3435: ./conftest > configure:3439: $? = 0 > configure:3454: result: no > configure:3459: checking for suffix of object files > configure:3481: clang -c conftest.c >&5 > configure:3485: $? = 0 > configure:3506: result: o > configure:3510: checking whether we are using the GNU C compiler > configure:3529: clang -c conftest.c >&5 > configure:3529: $? = 0 > configure:3538: result: yes > configure:3547: checking whether clang accepts -g > configure:3567: clang -c -g conftest.c >&5 > configure:3567: $? = 0 > configure:3608: result: yes > configure:3625: checking for clang option to accept ISO C89 > configure:3688: clang -c -g -O2 conftest.c >&5 > configure:3688: $? = 0 > configure:3701: result: none needed > configure:3723: checking dependency style of clang > configure:3834: result: gcc3 > configure:3899: checking for ar > configure:3915: found /usr/bin/ar > configure:3926: result: ar > configure:3952: checking the archiver (ar) interface > configure:3962: clang -c -g -O2 conftest.c >&5 > configure:3962: $? = 0 > configure:3964: ar cru libconftest.a conftest.o >&5 > configure:3967: $? = 0 > configure:3990: result: ar > configure:4040: checking build system type > configure:4054: result: x86_64-apple-darwin15.3.0 > configure:4074: checking host system type > configure:4087: result: x86_64-apple-darwin15.3.0 > configure:4128: checking how to print strings > configure:4155: result: printf > configure:4176: checking for a sed that does not truncate output > configure:4240: result: /usr/bin/sed > configure:4258: checking for grep that handles long lines and -e > configure:4316: result: /usr/bin/grep > configure:4321: checking for egrep > configure:4383: result: /usr/bin/grep -E > configure:4388: checking for fgrep > configure:4450: result: /usr/bin/grep -F > configure:4485: checking for ld used by clang > configure:4552: result: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld > configure:4559: checking if the linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) is GNU ld > configure:4574: result: no > configure:4586: checking for BSD- or MS-compatible name lister (nm) > configure:4635: result: /usr/bin/nm > configure:4765: checking the name lister (/usr/bin/nm) interface > configure:4772: clang -c -g -O2 conftest.c >&5 > configure:4775: /usr/bin/nm "conftest.o" > configure:4778: output > 00000000000001f8 S _some_variable > configure:4785: result: BSD nm > configure:4788: checking whether ln -s works > configure:4792: result: yes > configure:4800: checking the maximum length of command line arguments > configure:4931: result: 196608 > configure:4948: checking whether the shell understands some XSI constructs > configure:4958: result: yes > configure:4962: checking whether the shell understands "+=" > configure:4968: result: yes > configure:5003: checking how to convert x86_64-apple-darwin15.3.0 file names to x86_64-apple-darwin15.3.0 format > configure:5043: result: func_convert_file_noop > configure:5050: checking how to convert x86_64-apple-darwin15.3.0 file names to toolchain format > configure:5070: result: func_convert_file_noop > configure:5077: checking for /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld option to reload object files > configure:5084: result: -r > configure:5158: checking for objdump > configure:5188: result: no > configure:5214: checking how to recognize dependent libraries > configure:5412: result: pass_all > configure:5497: checking for dlltool > configure:5527: result: no > configure:5554: checking how to associate runtime and link libraries > configure:5581: result: printf %s\n > configure:5705: checking for archiver @FILE support > configure:5722: clang -c -g -O2 conftest.c >&5 > configure:5722: $? = 0 > configure:5725: ar cru libconftest.a @conftest.lst >&5 > ar: @conftest.lst: No such file or directory > configure:5728: $? = 1 > configure:5748: result: no > configure:5806: checking for strip > configure:5822: found /usr/bin/strip > configure:5833: result: strip > configure:5905: checking for ranlib > configure:5921: found /usr/bin/ranlib > configure:5932: result: ranlib > configure:6034: checking command to parse /usr/bin/nm output from clang object > configure:6154: clang -c -g -O2 conftest.c >&5 > configure:6157: $? = 0 > configure:6161: /usr/bin/nm conftest.o \| sed -n -e 's/^.*[ ]\([BCDEGRST][BCDEGRST]*\)[ ][ ]*\([_A-Za-z][_A-Za-z0-9]*\)$/\1 \2 \2/p' | sed '/ __gnu_lto/d' \> conftest.nm > configure:6164: $? = 0 > cannot find nm_test_var in conftest.nm > configure:6154: clang -c -g -O2 conftest.c >&5 > configure:6157: $? = 0 > configure:6161: /usr/bin/nm conftest.o \| sed -n -e 's/^.*[ ]\([BCDEGRST][BCDEGRST]*\)[ ][ ]*_\([_A-Za-z][_A-Za-z0-9]*\)$/\1 _\2 \2/p' | sed '/ __gnu_lto/d' \> conftest.nm > configure:6164: $? = 0 > configure:6230: clang -o conftest -g -O2 conftest.c conftstm.o >&5 > warning: (x86_64) could not find object file symbol for symbol _main > configure:6233: $? = 0 > configure:6271: result: ok > configure:6308: checking for sysroot > configure:6338: result: no > configure:6601: checking for mt > configure:6631: result: no > configure:6651: checking if : is a manifest tool > configure:6657: : '-?' > configure:6665: result: no > configure:6721: checking for dsymutil > configure:6737: found /usr/bin/dsymutil > configure:6748: result: dsymutil > configure:6813: checking for nmedit > configure:6829: found /usr/bin/nmedit > configure:6840: result: nmedit > configure:6905: checking for lipo > configure:6921: found /usr/bin/lipo > configure:6932: result: lipo > configure:6997: checking for otool > configure:7013: found /usr/bin/otool > configure:7024: result: otool > configure:7089: checking for otool64 > configure:7119: result: no > configure:7164: checking for -single_module linker flag > clang -g -O2 -o libconftest.dylib -dynamiclib -Wl,-single_module conftest.c > configure:7197: result: yes > configure:7200: checking for -exported_symbols_list linker flag > configure:7220: clang -o conftest -g -O2 -Wl,-exported_symbols_list,conftest.sym conftest.c >&5 > configure:7220: $? = 0 > configure:7230: result: yes > configure:7233: checking for -force_load linker flag > clang -g -O2 -c -o conftest.o conftest.c > ar cru libconftest.a conftest.o > ranlib libconftest.a > clang -g -O2 -o conftest conftest.c -Wl,-force_load,./libconftest.a > configure:7265: result: yes > configure:7307: checking how to run the C preprocessor > configure:7377: result: clang > configure:7397: clang conftest.c > conftest.c:16:8: error: unknown type name 'Syntax' > Syntax error > ^ > conftest.c:16:20: error: expected ';' after top level declarator > Syntax error > ^ > ; > 2 errors generated. > configure:7397: $? = 1 > configure: failed program was: > | /* confdefs.h */ > | #define PACKAGE_NAME "libodb" > | #define PACKAGE_TARNAME "libodb" > | #define PACKAGE_VERSION "2.4.0" > | #define PACKAGE_STRING "libodb 2.4.0" > | #define PACKAGE_BUGREPORT "odb-users@codesynthesis.com" > | #define PACKAGE_URL "" > | #define PACKAGE "libodb" > | #define VERSION "2.4.0" > | /* end confdefs.h. */ > | #ifdef __STDC__ > | # include > | #else > | # include > | #endif > | Syntax error > configure:7397: clang conftest.c > conftest.c:16:8: error: unknown type name 'Syntax' > Syntax error > ^ > conftest.c:16:20: error: expected ';' after top level declarator > Syntax error > ^ > ; > 2 errors generated. > configure:7397: $? = 1 > configure: failed program was: > | /* confdefs.h */ > | #define PACKAGE_NAME "libodb" > | #define PACKAGE_TARNAME "libodb" > | #define PACKAGE_VERSION "2.4.0" > | #define PACKAGE_STRING "libodb 2.4.0" > | #define PACKAGE_BUGREPORT "odb-users@codesynthesis.com" > | #define PACKAGE_URL "" > | #define PACKAGE "libodb" > | #define VERSION "2.4.0" > | /* end confdefs.h. */ > | #ifdef __STDC__ > | # include > | #else > | # include > | #endif > | Syntax error > configure:7427: error: in `/Users/sverre/Packed/CPP/ODB/libodb-2.4.0': > configure:7429: error: C preprocessor "clang" fails sanity check > See `config.log' for more details > > ## ---------------- ## > ## Cache variables. ## > ## ---------------- ## > > ac_cv_build=x86_64-apple-darwin15.3.0 > ac_cv_c_compiler_gnu=yes > ac_cv_env_CCC_set= > ac_cv_env_CCC_value= > ac_cv_env_CC_set=set > ac_cv_env_CC_value=clang > ac_cv_env_CFLAGS_set= > ac_cv_env_CFLAGS_value= > ac_cv_env_CPPFLAGS_set= > ac_cv_env_CPPFLAGS_value= > ac_cv_env_CPP_set=set > ac_cv_env_CPP_value=clang > ac_cv_env_CXXCPP_set= > ac_cv_env_CXXCPP_value= > ac_cv_env_CXXFLAGS_set= > ac_cv_env_CXXFLAGS_value= > ac_cv_env_CXX_set=set > ac_cv_env_CXX_value=/usr/bin/clang++ > ac_cv_env_LDFLAGS_set= > ac_cv_env_LDFLAGS_value= > ac_cv_env_LIBS_set= > ac_cv_env_LIBS_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_host=x86_64-apple-darwin15.3.0 > ac_cv_objext=o > ac_cv_path_EGREP='/usr/bin/grep -E' > ac_cv_path_FGREP='/usr/bin/grep -F' > ac_cv_path_GREP=/usr/bin/grep > ac_cv_path_SED=/usr/bin/sed > ac_cv_path_install='/usr/bin/install -c' > ac_cv_prog_AWK=awk > ac_cv_prog_CPP=clang > ac_cv_prog_ac_ct_AR=ar > ac_cv_prog_ac_ct_CC=clang > ac_cv_prog_ac_ct_DSYMUTIL=dsymutil > ac_cv_prog_ac_ct_LIPO=lipo > ac_cv_prog_ac_ct_NMEDIT=nmedit > ac_cv_prog_ac_ct_OTOOL=otool > ac_cv_prog_ac_ct_RANLIB=ranlib > ac_cv_prog_ac_ct_STRIP=strip > ac_cv_prog_cc_c89= > ac_cv_prog_cc_g=yes > ac_cv_prog_make_make_set=yes > am_cv_CC_dependencies_compiler_type=gcc3 > am_cv_ar_interface=ar > am_cv_prog_tar_ustar=gnutar > lt_cv_apple_cc_single_mod=yes > lt_cv_ar_at_file=no > lt_cv_deplibs_check_method=pass_all > lt_cv_file_magic_cmd='$MAGIC_CMD' > lt_cv_file_magic_test_file= > lt_cv_ld_exported_symbols_list=yes > lt_cv_ld_force_load=yes > lt_cv_ld_reload_flag=-r > lt_cv_nm_interface='BSD nm' > lt_cv_path_LD=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld > lt_cv_path_NM=/usr/bin/nm > lt_cv_path_mainfest_tool=no > lt_cv_prog_gnu_ld=no > lt_cv_sharedlib_from_linklib_cmd='printf %s\n' > lt_cv_sys_global_symbol_pipe='sed -n -e '\''s/^.*[ ]\([BCDEGRST][BCDEGRST]*\)[ ][ ]*_\([_A-Za-z][_A-Za-z0-9]*\)$/\1 _\2 \2/p'\'' | sed '\''/ __gnu_lto/d'\''' > lt_cv_sys_global_symbol_to_c_name_address='sed -n -e '\''s/^: \([^ ]*\)[ ]*$/ {\"\1\", (void *) 0},/p'\'' -e '\''s/^[BCDEGRST]* \([^ ]*\) \([^ ]*\)$/ {"\2", (void *) \&\2},/p'\''' > lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='sed -n -e '\''s/^: \([^ ]*\)[ ]*$/ {\"\1\", (void *) 0},/p'\'' -e '\''s/^[BCDEGRST]* \([^ ]*\) \(lib[^ ]*\)$/ {"\2", (void *) \&\2},/p'\'' -e '\''s/^[BCDEGRST]* \([^ ]*\) \([^ ]*\)$/ {"lib\2", (void *) \&\2},/p'\''' > lt_cv_sys_global_symbol_to_cdecl='sed -n -e '\''s/^T .* \(.*\)$/extern int \1();/p'\'' -e '\''s/^[BCDEGRST]* .* \(.*\)$/extern char \1;/p'\''' > lt_cv_sys_max_cmd_len=196608 > lt_cv_to_host_file_cmd=func_convert_file_noop > lt_cv_to_tool_file_cmd=func_convert_file_noop > > ## ----------------- ## > ## Output variables. ## > ## ----------------- ## > > ACLOCAL='${SHELL} /Users/sverre/Packed/CPP/ODB/libodb-2.4.0/config/missing --run aclocal-1.12' > AMDEPBACKSLASH='\' > AMDEP_FALSE='#' > AMDEP_TRUE='' > AMTAR='$${TAR-tar}' > AR='ar' > AS='' > AUTOCONF='${SHELL} /Users/sverre/Packed/CPP/ODB/libodb-2.4.0/config/missing --run autoconf' > AUTOHEADER='${SHELL} /Users/sverre/Packed/CPP/ODB/libodb-2.4.0/config/missing --run autoheader' > AUTOMAKE='${SHELL} /Users/sverre/Packed/CPP/ODB/libodb-2.4.0/config/missing --run automake-1.12' > AWK='awk' > CC='clang' > CCDEPMODE='depmode=gcc3' > CFLAGS='-g -O2' > CPP='clang' > CPPFLAGS='' > CXX='/usr/bin/clang++' > CXXCPP='' > CXXDEPMODE='' > CXXFLAGS='' > CYGPATH_W='echo' > DEFS='' > DEPDIR='.deps' > DLLTOOL='false' > DSYMUTIL='dsymutil' > DUMPBIN='' > ECHO_C='\c' > ECHO_N='' > ECHO_T='' > EGREP='/usr/bin/grep -E' > EXEEXT='' > FGREP='/usr/bin/grep -F' > GREP='/usr/bin/grep' > INSTALL_DATA='${INSTALL} -m 644' > INSTALL_PROGRAM='${INSTALL}' > INSTALL_SCRIPT='${INSTALL}' > INSTALL_STRIP_PROGRAM='$(install_sh) -c -s' > LD='/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld' > LDFLAGS='' > LIBOBJS='' > LIBS='' > LIBTOOL='' > LIPO='lipo' > LN_S='ln -s' > LTLIBOBJS='' > MAKEINFO='${SHELL} /Users/sverre/Packed/CPP/ODB/libodb-2.4.0/config/missing --run makeinfo' > MANIFEST_TOOL=':' > MKDIR_P='config/install-sh -c -d' > NM='/usr/bin/nm' > NMEDIT='nmedit' > OBJDUMP='false' > OBJEXT='o' > ODB_THREADS_NONE_FALSE='' > ODB_THREADS_NONE_TRUE='' > ODB_THREADS_POSIX_FALSE='' > ODB_THREADS_POSIX_TRUE='' > ODB_THREADS_WIN32_FALSE='' > ODB_THREADS_WIN32_TRUE='' > ODB_WIN32_FALSE='' > ODB_WIN32_TRUE='' > OTOOL64=':' > OTOOL='otool' > PACKAGE='libodb' > PACKAGE_BUGREPORT='odb-users@codesynthesis.com' > PACKAGE_NAME='libodb' > PACKAGE_STRING='libodb 2.4.0' > PACKAGE_TARNAME='libodb' > PACKAGE_URL='' > PACKAGE_VERSION='2.4.0' > PATH_SEPARATOR=':' > PTHREAD_CXX='' > PTHREAD_CXXFLAGS='' > PTHREAD_LIBS='' > RANLIB='ranlib' > SED='/usr/bin/sed' > SET_MAKE='' > SHELL='/bin/sh' > STRIP='strip' > VERSION='2.4.0' > ac_ct_AR='ar' > ac_ct_CC='clang' > ac_ct_CXX='' > ac_ct_DUMPBIN='' > acx_pthread_config='' > am__EXEEXT_FALSE='' > am__EXEEXT_TRUE='' > am__fastdepCC_FALSE='#' > am__fastdepCC_TRUE='' > am__fastdepCXX_FALSE='' > am__fastdepCXX_TRUE='' > am__include='include' > am__isrc='' > am__leading_dot='.' > am__nodep='_no' > am__quote='' > am__tar='tar --format=ustar -chf - "$$tardir"' > am__untar='tar -xf -' > bindir='${exec_prefix}/bin' > build='x86_64-apple-darwin15.3.0' > build_alias='' > build_cpu='x86_64' > build_os='darwin15.3.0' > build_vendor='apple' > datadir='${datarootdir}' > datarootdir='${prefix}/share' > docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' > dvidir='${docdir}' > exec_prefix='NONE' > host='x86_64-apple-darwin15.3.0' > host_alias='' > host_cpu='x86_64' > host_os='darwin15.3.0' > host_vendor='apple' > htmldir='${docdir}' > includedir='${prefix}/include' > infodir='${datarootdir}/info' > install_sh='${SHELL} /Users/sverre/Packed/CPP/ODB/libodb-2.4.0/config/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}' > pkgconfigdir='' > prefix='NONE' > program_transform_name='s,x,x,' > psdir='${docdir}' > sbindir='${exec_prefix}/sbin' > sharedstatedir='${prefix}/com' > sysconfdir='${prefix}/etc' > target_alias='' > > ## ----------- ## > ## confdefs.h. ## > ## ----------- ## > > /* confdefs.h */ > #define PACKAGE_NAME "libodb" > #define PACKAGE_TARNAME "libodb" > #define PACKAGE_VERSION "2.4.0" > #define PACKAGE_STRING "libodb 2.4.0" > #define PACKAGE_BUGREPORT "odb-users@codesynthesis.com" > #define PACKAGE_URL "" > #define PACKAGE "libodb" > #define VERSION "2.4.0" > > configure: exit 1 > > > From albert.gu at ringcentral.com Tue Feb 2 09:40:46 2016 From: albert.gu at ringcentral.com (Albert (Jinku) Gu) Date: Wed Feb 3 09:41:37 2016 Subject: [odb-users] ODB Crashed in a multi-threaded environment In-Reply-To: References: <1514EAEB-F0D1-4D3D-805A-9A17436A26B5@ringcentral.com> Message-ID: <195EBE48-9C47-4D77-A3F3-05B93FFD4257@ringcentral.com> Hi Boris, Thank you very much for your reply! >From the mail list, we can only get some main ideas. Is our ODB support one thread dedicated to writing/reading, and the second one only for reading at the same time? Or, is there any detailed steps/guidelines to say how we can support concurrency with ODB? Eg. How to compile the sqlite for iOS and support multi-threads. If there is an example, especially an iOS or Android example, that would be much better. Thank you in advance! Regards, Albert > On Feb 2, 2016, at 9:27 PM, Boris Kolpackov wrote: > > Hi Albert, > > Albert (Jinku) Gu writes: > >> And the exception message is ?transaction already in progress in this >> thread?. > > This means you have tried to create a nested ODB transaction, something > along these lines: > > void f () > { > transaction t (db.begin ()); // Exception. > ... > } > > void g () > { > transaction t (db.begin ()); > f (); > } > > Boris From albert.gu at ringcentral.com Tue Feb 2 10:08:53 2016 From: albert.gu at ringcentral.com (Albert (Jinku) Gu) Date: Wed Feb 3 09:41:37 2016 Subject: [odb-users] ODB Crashed in a multi-threaded environment In-Reply-To: References: <1514EAEB-F0D1-4D3D-805A-9A17436A26B5@ringcentral.com> Message-ID: Hi Boris, To be more specifically, if we want to support the multi-threads in ODB-sqlite, could you please help check if there is anything wrong with our compile script? Let?s take the armv7 as an example: ios_armv7: cd ./libodb-2.4.0; ./configure CXX=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ LD=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld AR=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar CXXFLAGS="-Os -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk -target armv7-apple-darwin -std=c++11 -stdlib=libc++ -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/" CPPFLAGS="-I/`pwd`/../install/include" LDFLAGS="-L/`pwd`/../install/lib -arch armv7 -stdlib=libc++ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk" --prefix=`pwd`/../install --disable-shared --host=arm-apple-darwin cd ./libodb-2.4.0; make clean; make; make install cd ./libodb-sqlite-2.4.0; ./configure CXX=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang LD=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld AR=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar CXXFLAGS="-Os -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk -target armv7-apple-darwin -std=c++11 -stdlib=libc++ -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/" LDFLAGS="-arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk -stdlib=libc++" --prefix=`pwd`/../install --disable-shared --host=arm-apple-darwin CXXCPP="" --with-libodb=../libodb-2.4.0 cd ./libodb-sqlite-2.4.0; make clean; make; make install rm -rf ./install/libs/ios/lib_armv7 mkdir ./install/libs/ios/lib_armv7 mv ./install/lib/* ./install/libs/ios/lib_armv7 Thanks in advance! Regards, Albert > On Feb 2, 2016, at 9:27 PM, Boris Kolpackov wrote: > > Hi Albert, > > Albert (Jinku) Gu writes: > >> And the exception message is ?transaction already in progress in this >> thread?. > > This means you have tried to create a nested ODB transaction, something > along these lines: > > void f () > { > transaction t (db.begin ()); // Exception. > ... > } > > void g () > { > transaction t (db.begin ()); > f (); > } > > Boris From duo at bsf.dk Tue Feb 2 19:51:22 2016 From: duo at bsf.dk (Sverre Eplov) Date: Wed Feb 3 09:41:38 2016 Subject: [odb-users] Build libodb on OS X Message-ID: <76EFB87E-E526-4D18-A768-1C8F89C4D0F2@bsf.dk> Hi all, I?ve run into some strange things The system is OS X 10.11.3 (15D21) Clang: Apple LLVM version 7.0.2 (clang-700.1.81) Target: x86_64-apple-darwin15.3.0 Thread model: posix libtool 2.6.4 autoconf 2.69 automake 1.15 Story is, that I wanted to build from GIT to get the latest and hottest off the press. When that did not turn out so well, I wanted to revert to builds from the downloaded source tar files. When I try to execute ?./configure?, in a folder where libodb source code has been unpacked from tar file, it fails during check for the C preprocessor - the strange thing is, that it is the generated testfile, which contains an error - the last line in the file is ?Syntax Error? (which the C preprocessor chokes on, which seems fair enough.) The Config log is attached at the bottom of this text. Anyone know how to whack that kind of deamon ? Ouput from Config.log when executing ?./configure? This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by libodb configure 2.4.0, which was generated by GNU Autoconf 2.69. Invocation command line was $ ./configure CC=clang CPP=clang ## --------- ## ## Platform. ## ## --------- ## hostname = Blackie.local uname -m = x86_64 uname -r = 15.3.0 uname -s = Darwin uname -v = Darwin Kernel Version 15.3.0: Thu Dec 10 18:40:58 PST 2015; root:xnu-3248.30.4~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 15.3.0: Thu Dec 10 18:40:58 PST 2015; root:xnu-3248.30.4~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: 16.00 gigabytes Default processor set: 249 tasks, 1340 threads, 8 processors Load average: 0.85, Mach factor: 7.14 /bin/machine = unknown /usr/bin/oslevel = unknown /bin/universe = unknown PATH: /Users/sverre/bin PATH: /usr/local/bin PATH: /usr/bin PATH: /bin PATH: /usr/sbin PATH: /sbin PATH: /opt/X11/bin PATH: /Library/TeX/texbin ## ----------- ## ## Core tests. ## ## ----------- ## configure:2311: checking for a BSD-compatible install configure:2379: result: /usr/bin/install -c configure:2390: checking whether build environment is sane configure:2445: result: yes configure:2596: checking for a thread-safe mkdir -p configure:2635: result: config/install-sh -c -d configure:2642: checking for gawk configure:2672: result: no configure:2642: checking for mawk configure:2672: result: no configure:2642: checking for nawk configure:2672: result: no configure:2642: checking for awk configure:2658: found /usr/bin/awk configure:2669: result: awk configure:2680: checking whether make sets $(MAKE) configure:2702: result: yes configure:2783: checking how to create a ustar tar archive configure:2796: tar --version bsdtar 2.8.3 - libarchive 2.8.3 configure:2799: $? = 0 configure:2839: tardir=conftest.dir && eval tar --format=ustar -chf - "$tardir" >conftest.tar configure:2842: $? = 0 configure:2846: tar -xf - &5 Apple LLVM version 7.0.2 (clang-700.1.81) Target: x86_64-apple-darwin15.3.0 Thread model: posix configure:3256: $? = 0 configure:3245: clang -v >&5 Apple LLVM version 7.0.2 (clang-700.1.81) Target: x86_64-apple-darwin15.3.0 Thread model: posix configure:3256: $? = 0 configure:3245: clang -V >&5 clang: error: argument to '-V' is missing (expected 1 value) clang: error: no input files configure:3256: $? = 1 configure:3245: clang -qversion >&5 clang: error: unknown argument: '-qversion' clang: error: no input files configure:3256: $? = 1 configure:3276: checking whether the C compiler works configure:3298: clang conftest.c >&5 configure:3302: $? = 0 configure:3350: result: yes configure:3353: checking for C compiler default output file name configure:3355: result: a.out configure:3361: checking for suffix of executables configure:3368: clang -o conftest conftest.c >&5 configure:3372: $? = 0 configure:3394: result: configure:3416: checking whether we are cross compiling configure:3424: clang -o conftest conftest.c >&5 configure:3428: $? = 0 configure:3435: ./conftest configure:3439: $? = 0 configure:3454: result: no configure:3459: checking for suffix of object files configure:3481: clang -c conftest.c >&5 configure:3485: $? = 0 configure:3506: result: o configure:3510: checking whether we are using the GNU C compiler configure:3529: clang -c conftest.c >&5 configure:3529: $? = 0 configure:3538: result: yes configure:3547: checking whether clang accepts -g configure:3567: clang -c -g conftest.c >&5 configure:3567: $? = 0 configure:3608: result: yes configure:3625: checking for clang option to accept ISO C89 configure:3688: clang -c -g -O2 conftest.c >&5 configure:3688: $? = 0 configure:3701: result: none needed configure:3723: checking dependency style of clang configure:3834: result: gcc3 configure:3899: checking for ar configure:3915: found /usr/bin/ar configure:3926: result: ar configure:3952: checking the archiver (ar) interface configure:3962: clang -c -g -O2 conftest.c >&5 configure:3962: $? = 0 configure:3964: ar cru libconftest.a conftest.o >&5 configure:3967: $? = 0 configure:3990: result: ar configure:4040: checking build system type configure:4054: result: x86_64-apple-darwin15.3.0 configure:4074: checking host system type configure:4087: result: x86_64-apple-darwin15.3.0 configure:4128: checking how to print strings configure:4155: result: printf configure:4176: checking for a sed that does not truncate output configure:4240: result: /usr/bin/sed configure:4258: checking for grep that handles long lines and -e configure:4316: result: /usr/bin/grep configure:4321: checking for egrep configure:4383: result: /usr/bin/grep -E configure:4388: checking for fgrep configure:4450: result: /usr/bin/grep -F configure:4485: checking for ld used by clang configure:4552: result: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld configure:4559: checking if the linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) is GNU ld configure:4574: result: no configure:4586: checking for BSD- or MS-compatible name lister (nm) configure:4635: result: /usr/bin/nm configure:4765: checking the name lister (/usr/bin/nm) interface configure:4772: clang -c -g -O2 conftest.c >&5 configure:4775: /usr/bin/nm "conftest.o" configure:4778: output 00000000000001f8 S _some_variable configure:4785: result: BSD nm configure:4788: checking whether ln -s works configure:4792: result: yes configure:4800: checking the maximum length of command line arguments configure:4931: result: 196608 configure:4948: checking whether the shell understands some XSI constructs configure:4958: result: yes configure:4962: checking whether the shell understands "+=" configure:4968: result: yes configure:5003: checking how to convert x86_64-apple-darwin15.3.0 file names to x86_64-apple-darwin15.3.0 format configure:5043: result: func_convert_file_noop configure:5050: checking how to convert x86_64-apple-darwin15.3.0 file names to toolchain format configure:5070: result: func_convert_file_noop configure:5077: checking for /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld option to reload object files configure:5084: result: -r configure:5158: checking for objdump configure:5188: result: no configure:5214: checking how to recognize dependent libraries configure:5412: result: pass_all configure:5497: checking for dlltool configure:5527: result: no configure:5554: checking how to associate runtime and link libraries configure:5581: result: printf %s\n configure:5705: checking for archiver @FILE support configure:5722: clang -c -g -O2 conftest.c >&5 configure:5722: $? = 0 configure:5725: ar cru libconftest.a @conftest.lst >&5 ar: @conftest.lst: No such file or directory configure:5728: $? = 1 configure:5748: result: no configure:5806: checking for strip configure:5822: found /usr/bin/strip configure:5833: result: strip configure:5905: checking for ranlib configure:5921: found /usr/bin/ranlib configure:5932: result: ranlib configure:6034: checking command to parse /usr/bin/nm output from clang object configure:6154: clang -c -g -O2 conftest.c >&5 configure:6157: $? = 0 configure:6161: /usr/bin/nm conftest.o \| sed -n -e 's/^.*[ ]\([BCDEGRST][BCDEGRST]*\)[ ][ ]*\([_A-Za-z][_A-Za-z0-9]*\)$/\1 \2 \2/p' | sed '/ __gnu_lto/d' \> conftest.nm configure:6164: $? = 0 cannot find nm_test_var in conftest.nm configure:6154: clang -c -g -O2 conftest.c >&5 configure:6157: $? = 0 configure:6161: /usr/bin/nm conftest.o \| sed -n -e 's/^.*[ ]\([BCDEGRST][BCDEGRST]*\)[ ][ ]*_\([_A-Za-z][_A-Za-z0-9]*\)$/\1 _\2 \2/p' | sed '/ __gnu_lto/d' \> conftest.nm configure:6164: $? = 0 configure:6230: clang -o conftest -g -O2 conftest.c conftstm.o >&5 warning: (x86_64) could not find object file symbol for symbol _main configure:6233: $? = 0 configure:6271: result: ok configure:6308: checking for sysroot configure:6338: result: no configure:6601: checking for mt configure:6631: result: no configure:6651: checking if : is a manifest tool configure:6657: : '-?' configure:6665: result: no configure:6721: checking for dsymutil configure:6737: found /usr/bin/dsymutil configure:6748: result: dsymutil configure:6813: checking for nmedit configure:6829: found /usr/bin/nmedit configure:6840: result: nmedit configure:6905: checking for lipo configure:6921: found /usr/bin/lipo configure:6932: result: lipo configure:6997: checking for otool configure:7013: found /usr/bin/otool configure:7024: result: otool configure:7089: checking for otool64 configure:7119: result: no configure:7164: checking for -single_module linker flag clang -g -O2 -o libconftest.dylib -dynamiclib -Wl,-single_module conftest.c configure:7197: result: yes configure:7200: checking for -exported_symbols_list linker flag configure:7220: clang -o conftest -g -O2 -Wl,-exported_symbols_list,conftest.sym conftest.c >&5 configure:7220: $? = 0 configure:7230: result: yes configure:7233: checking for -force_load linker flag clang -g -O2 -c -o conftest.o conftest.c ar cru libconftest.a conftest.o ranlib libconftest.a clang -g -O2 -o conftest conftest.c -Wl,-force_load,./libconftest.a configure:7265: result: yes configure:7307: checking how to run the C preprocessor configure:7377: result: clang configure:7397: clang conftest.c conftest.c:16:8: error: unknown type name 'Syntax' Syntax error ^ conftest.c:16:20: error: expected ';' after top level declarator Syntax error ^ ; 2 errors generated. configure:7397: $? = 1 configure: failed program was: | /* confdefs.h */ | #define PACKAGE_NAME "libodb" | #define PACKAGE_TARNAME "libodb" | #define PACKAGE_VERSION "2.4.0" | #define PACKAGE_STRING "libodb 2.4.0" | #define PACKAGE_BUGREPORT "odb-users@codesynthesis.com" | #define PACKAGE_URL "" | #define PACKAGE "libodb" | #define VERSION "2.4.0" | /* end confdefs.h. */ | #ifdef __STDC__ | # include | #else | # include | #endif | Syntax error configure:7397: clang conftest.c conftest.c:16:8: error: unknown type name 'Syntax' Syntax error ^ conftest.c:16:20: error: expected ';' after top level declarator Syntax error ^ ; 2 errors generated. configure:7397: $? = 1 configure: failed program was: | /* confdefs.h */ | #define PACKAGE_NAME "libodb" | #define PACKAGE_TARNAME "libodb" | #define PACKAGE_VERSION "2.4.0" | #define PACKAGE_STRING "libodb 2.4.0" | #define PACKAGE_BUGREPORT "odb-users@codesynthesis.com" | #define PACKAGE_URL "" | #define PACKAGE "libodb" | #define VERSION "2.4.0" | /* end confdefs.h. */ | #ifdef __STDC__ | # include | #else | # include | #endif | Syntax error configure:7427: error: in `/Users/sverre/Packed/CPP/ODB/libodb-2.4.0': configure:7429: error: C preprocessor "clang" fails sanity check See `config.log' for more details ## ---------------- ## ## Cache variables. ## ## ---------------- ## ac_cv_build=x86_64-apple-darwin15.3.0 ac_cv_c_compiler_gnu=yes ac_cv_env_CCC_set= ac_cv_env_CCC_value= ac_cv_env_CC_set=set ac_cv_env_CC_value=clang ac_cv_env_CFLAGS_set= ac_cv_env_CFLAGS_value= ac_cv_env_CPPFLAGS_set= ac_cv_env_CPPFLAGS_value= ac_cv_env_CPP_set=set ac_cv_env_CPP_value=clang ac_cv_env_CXXCPP_set= ac_cv_env_CXXCPP_value= ac_cv_env_CXXFLAGS_set= ac_cv_env_CXXFLAGS_value= ac_cv_env_CXX_set=set ac_cv_env_CXX_value=/usr/bin/clang++ ac_cv_env_LDFLAGS_set= ac_cv_env_LDFLAGS_value= ac_cv_env_LIBS_set= ac_cv_env_LIBS_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_host=x86_64-apple-darwin15.3.0 ac_cv_objext=o ac_cv_path_EGREP='/usr/bin/grep -E' ac_cv_path_FGREP='/usr/bin/grep -F' ac_cv_path_GREP=/usr/bin/grep ac_cv_path_SED=/usr/bin/sed ac_cv_path_install='/usr/bin/install -c' ac_cv_prog_AWK=awk ac_cv_prog_CPP=clang ac_cv_prog_ac_ct_AR=ar ac_cv_prog_ac_ct_CC=clang ac_cv_prog_ac_ct_DSYMUTIL=dsymutil ac_cv_prog_ac_ct_LIPO=lipo ac_cv_prog_ac_ct_NMEDIT=nmedit ac_cv_prog_ac_ct_OTOOL=otool ac_cv_prog_ac_ct_RANLIB=ranlib ac_cv_prog_ac_ct_STRIP=strip ac_cv_prog_cc_c89= ac_cv_prog_cc_g=yes ac_cv_prog_make_make_set=yes am_cv_CC_dependencies_compiler_type=gcc3 am_cv_ar_interface=ar am_cv_prog_tar_ustar=gnutar lt_cv_apple_cc_single_mod=yes lt_cv_ar_at_file=no lt_cv_deplibs_check_method=pass_all lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_ld_exported_symbols_list=yes lt_cv_ld_force_load=yes lt_cv_ld_reload_flag=-r lt_cv_nm_interface='BSD nm' lt_cv_path_LD=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld lt_cv_path_NM=/usr/bin/nm lt_cv_path_mainfest_tool=no lt_cv_prog_gnu_ld=no lt_cv_sharedlib_from_linklib_cmd='printf %s\n' lt_cv_sys_global_symbol_pipe='sed -n -e '\''s/^.*[ ]\([BCDEGRST][BCDEGRST]*\)[ ][ ]*_\([_A-Za-z][_A-Za-z0-9]*\)$/\1 _\2 \2/p'\'' | sed '\''/ __gnu_lto/d'\''' lt_cv_sys_global_symbol_to_c_name_address='sed -n -e '\''s/^: \([^ ]*\)[ ]*$/ {\"\1\", (void *) 0},/p'\'' -e '\''s/^[BCDEGRST]* \([^ ]*\) \([^ ]*\)$/ {"\2", (void *) \&\2},/p'\''' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='sed -n -e '\''s/^: \([^ ]*\)[ ]*$/ {\"\1\", (void *) 0},/p'\'' -e '\''s/^[BCDEGRST]* \([^ ]*\) \(lib[^ ]*\)$/ {"\2", (void *) \&\2},/p'\'' -e '\''s/^[BCDEGRST]* \([^ ]*\) \([^ ]*\)$/ {"lib\2", (void *) \&\2},/p'\''' lt_cv_sys_global_symbol_to_cdecl='sed -n -e '\''s/^T .* \(.*\)$/extern int \1();/p'\'' -e '\''s/^[BCDEGRST]* .* \(.*\)$/extern char \1;/p'\''' lt_cv_sys_max_cmd_len=196608 lt_cv_to_host_file_cmd=func_convert_file_noop lt_cv_to_tool_file_cmd=func_convert_file_noop ## ----------------- ## ## Output variables. ## ## ----------------- ## ACLOCAL='${SHELL} /Users/sverre/Packed/CPP/ODB/libodb-2.4.0/config/missing --run aclocal-1.12' AMDEPBACKSLASH='\' AMDEP_FALSE='#' AMDEP_TRUE='' AMTAR='$${TAR-tar}' AR='ar' AS='' AUTOCONF='${SHELL} /Users/sverre/Packed/CPP/ODB/libodb-2.4.0/config/missing --run autoconf' AUTOHEADER='${SHELL} /Users/sverre/Packed/CPP/ODB/libodb-2.4.0/config/missing --run autoheader' AUTOMAKE='${SHELL} /Users/sverre/Packed/CPP/ODB/libodb-2.4.0/config/missing --run automake-1.12' AWK='awk' CC='clang' CCDEPMODE='depmode=gcc3' CFLAGS='-g -O2' CPP='clang' CPPFLAGS='' CXX='/usr/bin/clang++' CXXCPP='' CXXDEPMODE='' CXXFLAGS='' CYGPATH_W='echo' DEFS='' DEPDIR='.deps' DLLTOOL='false' DSYMUTIL='dsymutil' DUMPBIN='' ECHO_C='\c' ECHO_N='' ECHO_T='' EGREP='/usr/bin/grep -E' EXEEXT='' FGREP='/usr/bin/grep -F' GREP='/usr/bin/grep' INSTALL_DATA='${INSTALL} -m 644' INSTALL_PROGRAM='${INSTALL}' INSTALL_SCRIPT='${INSTALL}' INSTALL_STRIP_PROGRAM='$(install_sh) -c -s' LD='/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld' LDFLAGS='' LIBOBJS='' LIBS='' LIBTOOL='' LIPO='lipo' LN_S='ln -s' LTLIBOBJS='' MAKEINFO='${SHELL} /Users/sverre/Packed/CPP/ODB/libodb-2.4.0/config/missing --run makeinfo' MANIFEST_TOOL=':' MKDIR_P='config/install-sh -c -d' NM='/usr/bin/nm' NMEDIT='nmedit' OBJDUMP='false' OBJEXT='o' ODB_THREADS_NONE_FALSE='' ODB_THREADS_NONE_TRUE='' ODB_THREADS_POSIX_FALSE='' ODB_THREADS_POSIX_TRUE='' ODB_THREADS_WIN32_FALSE='' ODB_THREADS_WIN32_TRUE='' ODB_WIN32_FALSE='' ODB_WIN32_TRUE='' OTOOL64=':' OTOOL='otool' PACKAGE='libodb' PACKAGE_BUGREPORT='odb-users@codesynthesis.com' PACKAGE_NAME='libodb' PACKAGE_STRING='libodb 2.4.0' PACKAGE_TARNAME='libodb' PACKAGE_URL='' PACKAGE_VERSION='2.4.0' PATH_SEPARATOR=':' PTHREAD_CXX='' PTHREAD_CXXFLAGS='' PTHREAD_LIBS='' RANLIB='ranlib' SED='/usr/bin/sed' SET_MAKE='' SHELL='/bin/sh' STRIP='strip' VERSION='2.4.0' ac_ct_AR='ar' ac_ct_CC='clang' ac_ct_CXX='' ac_ct_DUMPBIN='' acx_pthread_config='' am__EXEEXT_FALSE='' am__EXEEXT_TRUE='' am__fastdepCC_FALSE='#' am__fastdepCC_TRUE='' am__fastdepCXX_FALSE='' am__fastdepCXX_TRUE='' am__include='include' am__isrc='' am__leading_dot='.' am__nodep='_no' am__quote='' am__tar='tar --format=ustar -chf - "$$tardir"' am__untar='tar -xf -' bindir='${exec_prefix}/bin' build='x86_64-apple-darwin15.3.0' build_alias='' build_cpu='x86_64' build_os='darwin15.3.0' build_vendor='apple' datadir='${datarootdir}' datarootdir='${prefix}/share' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' dvidir='${docdir}' exec_prefix='NONE' host='x86_64-apple-darwin15.3.0' host_alias='' host_cpu='x86_64' host_os='darwin15.3.0' host_vendor='apple' htmldir='${docdir}' includedir='${prefix}/include' infodir='${datarootdir}/info' install_sh='${SHELL} /Users/sverre/Packed/CPP/ODB/libodb-2.4.0/config/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}' pkgconfigdir='' prefix='NONE' program_transform_name='s,x,x,' psdir='${docdir}' sbindir='${exec_prefix}/sbin' sharedstatedir='${prefix}/com' sysconfdir='${prefix}/etc' target_alias='' ## ----------- ## ## confdefs.h. ## ## ----------- ## /* confdefs.h */ #define PACKAGE_NAME "libodb" #define PACKAGE_TARNAME "libodb" #define PACKAGE_VERSION "2.4.0" #define PACKAGE_STRING "libodb 2.4.0" #define PACKAGE_BUGREPORT "odb-users@codesynthesis.com" #define PACKAGE_URL "" #define PACKAGE "libodb" #define VERSION "2.4.0" configure: exit 1 From abv150ci at gmail.com Wed Feb 3 16:17:29 2016 From: abv150ci at gmail.com (=?UTF-8?Q?Aar=C3=B3n_Bueno_Villares?=) Date: Wed Feb 3 16:18:16 2016 Subject: [odb-users] About MySQL type decimal Message-ID: If I define the type of a field as a `DECIMAL(4, 2)` (for a MySQL engine), what must be the C++ type of that field, `string`, `float`/`double` or both? Because the docs says nothing about decimals. Does ODB also test or round the value of the field? For example, if my value has a value of 235.34 (or "23.457"), does ODB make any kind of checking or rounding of the value? Or is it the responsability of MySQL? Best regards, Aaron. From boris at codesynthesis.com Thu Feb 4 03:10:51 2016 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu Feb 4 03:10:52 2016 Subject: [odb-users] Tool to convert existing SQL to C++/ODB classes In-Reply-To: References: Message-ID: Hi Gautier, gautier duval writes: > if there is an existing tool/command/ simple way to generate > some C++/ODB classes from an existing SQL code / schema/tables? No, there is no such support in ODB. While we were considering this idea and may even implement something like this in the future, currently we really have no bandwidth for a project like this. Boris From boris at codesynthesis.com Thu Feb 4 03:20:14 2016 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu Feb 4 03:20:15 2016 Subject: [odb-users] Build libodb on OS X (Solved) In-Reply-To: <8FDA5D5A-6998-46DB-8033-0282E57FF04B@awion.dk> References: <76EFB87E-E526-4D18-A768-1C8F89C4D0F2@bsf.dk> <2D0B8F05-41B2-4FCE-B3AD-83E10B55ACEB@awion.dk> <8FDA5D5A-6998-46DB-8033-0282E57FF04B@awion.dk> Message-ID: Hi Sverre, Sverre Eplov writes: > ./configure CC=clang CPP=?clang -E? I bet if you just specified CXX=clang++ (there are no C files in libodb, only C++, so setting CC doesn't change anything) and let configure decide which preprocessor to use automatically, everything would have worked fine. Sometimes less is really more ;-). Boris From sverre at awion.dk Thu Feb 4 04:03:36 2016 From: sverre at awion.dk (Sverre Eplov) Date: Thu Feb 4 04:03:47 2016 Subject: [odb-users] Build libodb on OS X (Solved) In-Reply-To: References: <76EFB87E-E526-4D18-A768-1C8F89C4D0F2@bsf.dk> <2D0B8F05-41B2-4FCE-B3AD-83E10B55ACEB@awion.dk> <8FDA5D5A-6998-46DB-8033-0282E57FF04B@awion.dk> Message-ID: <569477770.6741.1454576617123.JavaMail.open-xchange@ox.netsite.dk> Hi Boris, I should have mentioned that in while attempting to get the configure sy output when doing './configure CXX=clang++& .... checking for -force_load linker fl checking how to run the C preprocessor... /usr/bin/clang++< configure: error: in `/Users/sverre/tmp/package-1.1.0': con check See `config.log' for more details .... < So without the specific specifications for the CC compiler and prepro cessor, the configure attempts to use the C++ compiler to check for C prepr Error" Btw, I've managed t I need to recompile odb u won't work with the librari I need to work out an efficent wa libraries using clang, and then how to compi libcutl I need to figure out how to compile and l GCC, even though the one installed on the system is compile clang. br, /Sverre Den 4. februar 2016 klokken 09:20 skrev Bo : Hi Sverre, < > ./configure I bet if you just specified in libodb, only C++, so setting CC d configure decide which preprocessor have worked fine. Sometimes less Boris From boris at codesynthesis.com Thu Feb 4 04:20:15 2016 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu Feb 4 04:20:16 2016 Subject: [odb-users] About MySQL type decimal In-Reply-To: References: Message-ID: Hi Aar?n, Aar?n Bueno Villares writes: > If I define the type of a field as a `DECIMAL(4, 2)` (for a MySQL engine), > what must be the C++ type of that field, `string`, `float`/`double` or > both? Because the docs says nothing about decimals. Added to the manual: "The only built-in mapping provided for the MySQL DECIMAL type is to std::string/char[N], for example: #pragma db object class object { ... #pragma db type ("DECIMAL(6,3)") std::string value_; }; You can, however, map DECIMAL to a custom C++ type by providing a suitable odb::mysql::value_traits specialization." > Does ODB also test or round the value of the field? No. It just puts whatever MySQL sent into the string and similarly sends to MySQL whatever you put into the string. Boris From boris at codesynthesis.com Thu Feb 4 04:44:45 2016 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu Feb 4 04:44:47 2016 Subject: [odb-users] ODB Crashed in a multi-threaded environment In-Reply-To: <195EBE48-9C47-4D77-A3F3-05B93FFD4257@ringcentral.com> References: <1514EAEB-F0D1-4D3D-805A-9A17436A26B5@ringcentral.com> <195EBE48-9C47-4D77-A3F3-05B93FFD4257@ringcentral.com> Message-ID: Hi Albert, Albert (Jinku) Gu writes: > Or, is there any detailed steps/guidelines to say how we can support > concurrency with ODB? With SQLite, it boils down to two things: 1. Make sure that you build SQLite with -DSQLITE_ENABLE_UNLOCK_NOTIFY=1 See, for example, this Android guide: http://wiki.codesynthesis.com/Using_ODB_on_Android Also, when building libodb-sqlite, watch out for messages at the end of the ./configure output -- it warns you if the unlock notification is not supported by the SQLite build that you are using. 2. Follow the multi-threading guidelines outlined in the ODB manual. Specifically, don't share connections (or worse, transactions) between threads. Only share the database and let its connecton pool hand out a connecion to each thread. Also note that SQLite concurrency is generally quite poor, especially for write-heavy applications. Boris From neuroproc at gmail.com Thu Feb 4 05:20:15 2016 From: neuroproc at gmail.com (Artem Shershen) Date: Thu Feb 4 07:34:31 2016 Subject: [odb-users] '14: unable to open database file' in Android Message-ID: Hello. I have issue like this http://www.codesynthesis.com/pipermail/odb-users/2013-November/001587.html If I do persist two times in one transaction I get the '14: unable to open database file' error. (on Windows works fine) I found that this error pass when persist operation call custom trigger ( created through db.execute() ) I use this way for sqlite FTS features. I need to update my virtual FTS tables when insert/update/delete on my content tables. What solutions can you offer? Thanks. From albert.gu at ringcentral.com Thu Feb 4 06:24:22 2016 From: albert.gu at ringcentral.com (Albert (Jinku) Gu) Date: Thu Feb 4 07:34:31 2016 Subject: [odb-users] ODB Crashed in a multi-threaded environment In-Reply-To: References: <1514EAEB-F0D1-4D3D-805A-9A17436A26B5@ringcentral.com> <195EBE48-9C47-4D77-A3F3-05B93FFD4257@ringcentral.com> Message-ID: <17A09B64-EA0A-4B3E-B8FC-A989E4C1834D@ringcentral.com> Hi Boris, Thank you for your detailed instruction. Will try it. Regards, Albert > On Feb 4, 2016, at 5:44 PM, Boris Kolpackov wrote: > > Hi Albert, > > Albert (Jinku) Gu writes: > >> Or, is there any detailed steps/guidelines to say how we can support >> concurrency with ODB? > > With SQLite, it boils down to two things: > > 1. Make sure that you build SQLite with -DSQLITE_ENABLE_UNLOCK_NOTIFY=1 > > See, for example, this Android guide: > > http://wiki.codesynthesis.com/Using_ODB_on_Android > > Also, when building libodb-sqlite, watch out for messages at the end > of the ./configure output -- it warns you if the unlock notification > is not supported by the SQLite build that you are using. > > 2. Follow the multi-threading guidelines outlined in the ODB manual. > Specifically, don't share connections (or worse, transactions) > between threads. Only share the database and let its connecton pool > hand out a connecion to each thread. > > Also note that SQLite concurrency is generally quite poor, especially > for write-heavy applications. > > Boris From boris at codesynthesis.com Thu Feb 4 08:34:14 2016 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu Feb 4 08:34:13 2016 Subject: [odb-users] AW: SQL Epiloge In-Reply-To: <021970097dcb4160b536f368956ad4e8@QEX.qosmotec.com> References: <021970097dcb4160b536f368956ad4e8@QEX.qosmotec.com> Message-ID: Hi Marcel, I've implemented support for multiple files and fixed the lack of final newline issue. I probably also fixed the newline multiplication issue, though not 100% sure. Would you like to test a pre-release and confirm? Boris From boris at codesynthesis.com Thu Feb 4 09:23:19 2016 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu Feb 4 09:23:18 2016 Subject: [odb-users] '14: unable to open database file' in Android In-Reply-To: References: Message-ID: Hi Artem, Artem Shershen writes: > What solutions can you offer? Googgle for this error + "Andorid" -- there are tons of stackoverflow questions and they all indicate some Android-specific permission issues. Boris From sverre at awion.dk Thu Feb 4 11:45:21 2016 From: sverre at awion.dk (Sverre Eplov) Date: Thu Feb 4 11:45:31 2016 Subject: [odb-users] Build libodb on OS X (Solved) Message-ID: <9F08251F-0126-458F-9AF5-598DA2D00639@awion.dk> I should have mentioned that in my post, but I already tried that while attempting to get the configure systems check to work - the output when doing './configure CXX=clang++" is: .... checking for -force_load linker flag... yes checking how to run the C preprocessor... /usr/bin/clang++ configure: error: in `/Users/sverre/tmp/package-1.1.0': configure: error: C preprocessor "/usr/bin/clang++" fails sanity check See `config.log' for more details .... So without the specific specifications for the CC compiler and preprocessor, the configure script attempts to use the C++ compiler to check for C preprossor, and does a full compile (which chokes on the "Syntax Error" in the file to be compiled). Btw, I've managed to compile the libraries from GIT using clang, now I need to recompile odb using GCC - the binary download of odb 2.4.0 won't work with the libraries compiled from GIT. (Version mismatch). I need to work out an efficent way to recompile and install all libraries using clang, and then how to compile odb with GCC. It's libcutl I need to figure out how to compile and link to odb with GCC, even though the one installed on the system is compiled with clang. br, /Sverre >> Hi Sverre, >> >> Sverre Eplov writes: >> >> > ./configure CC=clang CPP=?clang -E? >> >> I bet if you just specified CXX=clang++ (there are no C files in libodb, >> only C++, so setting CC doesn't change anything) and let configure >> decide which preprocessor to use automatically, everything would have >> worked fine. Sometimes less is really more ;-). >> >> Boris From mne at qosmotec.com Thu Feb 4 12:17:17 2016 From: mne at qosmotec.com (Marcel Nehring) Date: Thu Feb 4 12:17:59 2016 Subject: AW: [odb-users] AW: SQL Epiloge In-Reply-To: References: <021970097dcb4160b536f368956ad4e8@QEX.qosmotec.com> Message-ID: Hi Boris, great work! I don't "need" a pre-release since it was no problem to find other ways to fulfill my needs. However, if you want me to test and verify the fix I can certainly do so. Regards, Marcel -----Urspr?ngliche Nachricht----- Von: Boris Kolpackov [mailto:boris@codesynthesis.com] Gesendet: Donnerstag, 4. Februar 2016 14:34 An: Marcel Nehring Cc: odb-users@codesynthesis.com Betreff: Re: [odb-users] AW: SQL Epiloge Hi Marcel, I've implemented support for multiple files and fixed the lack of final newline issue. I probably also fixed the newline multiplication issue, though not 100% sure. Would you like to test a pre-release and confirm? Boris From sverre at awion.dk Thu Feb 4 19:01:24 2016 From: sverre at awion.dk (Sverre Eplov) Date: Thu Feb 4 19:01:44 2016 Subject: [odb-users] ODB plugin error when executing Message-ID: <646A5BEE-BB14-4E84-B128-3735B8E9D6CA@awion.dk> Hi, I?ve compiled odb from GIT, commit d1b34452 I?m using GCC version: "g++-5 (Homebrew gcc 5.3.0) 5.3.0" on OS X 10.11.3 When I try to use odb on the ?person.h? file from odb sample code, I get: ---------------------------------------- odb --database pgsql -I/usr/local/include person.h person.h:*** WARNING *** there are active plugins, do not report this as a bug unless you can reproduce it without enabling any plugins. Event | Plugins PLUGIN_START_UNIT | odb PLUGIN_PRAGMAS | odb PLUGIN_OVERRIDE_GATE | odb In file included from /usr/local/include/odb/container-traits.hxx:211:0, from :9: /usr/local/include/odb/std-deque-traits.hxx:66:1: internal compiler error: Abort trap: 6 } ^ g++-5: internal compiler error: Abort trap: 6 (program cc1plus) ---------------------------------------- Any suggestions on what I?ve goofed up? ---------------------------------------- To get a working ODB on my system, I did as follows: In a directory with odb checked out, master branch Using libcutl from develop folder, as it is compiled statically with GCC. (The one installed on /usr/? is compiled with clang) 1) Create source distribution make dist dist_prefix=~/tmp/odb Configuring external dependency on 'cli' for 'odb'. Would you like to configure dependency on the installed version of 'cli' as opposed to the development build? [y]: configuring 'odb' Please select the C++ compiler you would like to use: (1) GNU C++ (g++) (2) Intel C++ (icc) (3) Other C++ compiler [1]: Would you like the C++ compiler to optimize generated code? [y]: Would you like the C++ compiler to generate debug information? [y]: Embed dynamic library paths into executables (rpath)? [y]: Please enter any extra C++ preprocessor options. []: Please enter any extra C++ compiler options. []: -I/usr/local/include Please enter any extra C++ linker options. []: Please enter any extra C++ libraries. []: Configuring external dependency on 'libcutl' for 'odb'. Would you like to configure dependency on the installed version of 'libcutl' as opposed to the development build? [y]: n Please enter the src_root for 'libcutl'. []: /Users/sverre/Packed/CPP/ODB/git/libcutl Please enter the out_root for 'libcutl'. [/Users/sverre/Packed/CPP/ODB/git/libcutl]: configuring 'odb' Please enter the g++ binary you would like to use, for example 'g++-3.4', '/usr/local/bin/g++' or 'distcc g++'. [g++]: g++-5 Please select the optimization level you would like to use: (1) -O1 [Tries to reduce code size and execution time, without performing any optimizations that take a great deal of compilation time.] (2) -O2 [Performs nearly all supported optimizations that do not involve a space-speed tradeoff.] (3) -O3 [Optimize even more.] (4) -Os [Optimize for size.] [2]: (source files are then created in ~/tmp/odb without errors) -------------------------------------------------------- 2) build and install odb cd ~/tmp/odb ./bootstrap ./configure --with-libcutl=/Users/sverre/Packed/CPP/ODB/git/libcutl CC=gcc-5 CPP='gcc-5 -E' CXX=g++-5 CXXCPP='g++-5 -E' CPPFLAGS=-I/usr/local/include (exempt from ./configure output) ?. checking whether g++-5 supports plugins... yes checking whether to install ODB plugin into default GCC plugin directory... no checking for GCC plugin headers... yes checking for libcutl... yes ?. make install (executes without errors) (exempt from compile step) ?. libtool: compile: g++-5 -DHAVE_CONFIG_H -I.. -I.. -I/usr/local/include -I/usr/local/Cellar/gcc/5.3.0/lib/gcc/5/gcc/x86_64-apple-darwin15.2.0/5.3.0/plugin/include -I/Users/sverre/Packed/CPP/ODB/git/libcutl -g -O2 -MT cxx-lexer.lo -MD -MP -MF .deps/cxx-lexer.Tpo -c cxx-lexer.cxx -fno-common -DPIC -o .libs/cxx-lexer.o ?. -------------------------------------------------------- 3) Check odb otool -L `which odb` /usr/local/bin/odb: /usr/local/opt/gcc/lib/gcc/5/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.21.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1) /usr/local/lib/gcc/5/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0) odb --version ODB object-relational mapping (ORM) compiler for C++ 2.5.0.a4 Copyright (c) 2009-2015 Code Synthesis Tools CC This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. From boris at codesynthesis.com Fri Feb 5 08:24:17 2016 From: boris at codesynthesis.com (Boris Kolpackov) Date: Fri Feb 5 08:24:17 2016 Subject: [odb-users] Build libodb on OS X (Solved) In-Reply-To: <9F08251F-0126-458F-9AF5-598DA2D00639@awion.dk> References: <9F08251F-0126-458F-9AF5-598DA2D00639@awion.dk> Message-ID: Hi Sverre, Sverre Eplov writes: > So without the specific specifications for the CC compiler and > preprocessor, the configure script attempts to use the C++ compiler > to check for C preprossor, and does a full compile (which chokes > on the "Syntax Error" in the file to be compiled). That's strange. Perhaps you've generated the configure script yourself (with some outdated version of autotools)? > It's libcutl I need to figure out how to compile and link to odb with > GCC, even though the one installed on the system is compiled with clang. You can install it somewhere else and override the include/library search paths with -I/-L. Boris From boris at codesynthesis.com Fri Feb 5 08:30:26 2016 From: boris at codesynthesis.com (Boris Kolpackov) Date: Fri Feb 5 08:30:26 2016 Subject: [odb-users] ODB plugin error when executing In-Reply-To: <646A5BEE-BB14-4E84-B128-3735B8E9D6CA@awion.dk> References: <646A5BEE-BB14-4E84-B128-3735B8E9D6CA@awion.dk> Message-ID: Hi Sverre, Sverre Eplov writes: > When I try to use odb on the ?person.h? file from odb sample code, I get: > > g++-5: internal compiler error: Abort trap: 6 (program cc1plus) I don't know. There is just so many things that go wrong these days on Mac OS, that I honestly don't have the resources to try and track it down. See here for some details: http://www.codesynthesis.com/products/odb/doc/install-macosx.xhtml How about I package a pre-release of ODB from the current master using our "release procedures"? You can then try that. I know this is not as good as being able to pull the latest any time you feel like, but that's the best we can do for now. Hopefully, not for long, thought: https://build2.org Boris From sverre at awion.dk Fri Feb 5 08:56:35 2016 From: sverre at awion.dk (Sverre Eplov) Date: Fri Feb 5 08:56:45 2016 Subject: [odb-users] ODB plugin error when executing In-Reply-To: References: <646A5BEE-BB14-4E84-B128-3735B8E9D6CA@awion.dk> Message-ID: <8D5F0B7F-5B16-40B8-BEF7-25825C0B87CA@awion.dk> Hi Boris, since my last post I?ve looked into your GIT repos and found the ?etc? projects with the scripts you use to build. (I assume ;)). I have worked out how your projects are placed in your ?work? folder, and structured my accordingly, so I have the ?dist.sh? script working for the libXXX projects, both GCC and Clang. That cleared up a lot of stuff - if it not too much trouble, it would be very nice with a binary odb which matches current master branch. I think I have an idea about how to get it to work with my own build, but it *would* be more fun to be able to play around the working code instead of chasing ghosts. When you are contemplating switching build systems, would you mind sharing the thoughts you have ? I?m using CMAKE quite a lot, I havent looked at the one you referred to, I?ll look it over. Have a nice weekend, /Sverre > On 05-02-2016, at 14.30, Boris Kolpackov wrote: > > Hi Sverre, > > Sverre Eplov writes: > >> When I try to use odb on the ?person.h? file from odb sample code, I get: >> >> g++-5: internal compiler error: Abort trap: 6 (program cc1plus) > > I don't know. There is just so many things that go wrong these days on Mac > OS, that I honestly don't have the resources to try and track it down. See > here for some details: > > http://www.codesynthesis.com/products/odb/doc/install-macosx.xhtml > > How about I package a pre-release of ODB from the current master using > our "release procedures"? You can then try that. > > I know this is not as good as being able to pull the latest any time > you feel like, but that's the best we can do for now. Hopefully, not > for long, thought: > > https://build2.org > > Boris From boris at codesynthesis.com Fri Feb 5 09:09:56 2016 From: boris at codesynthesis.com (Boris Kolpackov) Date: Fri Feb 5 09:09:56 2016 Subject: [odb-users] Re: odb and gcc 6.0 In-Reply-To: References: Message-ID: Hi Dave, [CC'ed odb-users] Dave Johansen writes: > Fedora rawhide just updated to gcc 6.0. I tried to rebuild but it ran into > some errors. You can find the build.log at: > https://koji.fedoraproject.org/koji/taskinfo?taskID=12725095 Ok, I've made it compile with the latest snapshot. Here is the patch: http://scm.codesynthesis.com/?p=odb/odb.git;a=commit;h=511dcf67322ad87fb32f97d1cf7725c129e83898 A couple of notes: 1. GCC 6 is C++14 by default, so you may want to compile with -std=c++03 or pass -Wno-deprecated-declarations to suppress auto_ptr warnings. 2. While it compiles and prints usage, I could not make it compile any code; std::locale() throws bad_alloc. I didn't spend too much time on this since it is still early in the release process and it is probably quite buggy. But maybe the Fedora build has some extra patches, so let me know how it goes. Boris From davejohansen at gmail.com Sat Feb 6 16:32:07 2016 From: davejohansen at gmail.com (Dave Johansen) Date: Sat Feb 6 16:32:14 2016 Subject: [odb-users] Re: odb and gcc 6.0 In-Reply-To: References: Message-ID: On Fri, Feb 5, 2016 at 7:09 AM, Boris Kolpackov wrote: > Hi Dave, > > [CC'ed odb-users] > > Dave Johansen writes: > > > Fedora rawhide just updated to gcc 6.0. I tried to rebuild but it ran > into > > some errors. You can find the build.log at: > > https://koji.fedoraproject.org/koji/taskinfo?taskID=12725095 > > Ok, I've made it compile with the latest snapshot. Here is the patch: > > > http://scm.codesynthesis.com/?p=odb/odb.git;a=commit;h=511dcf67322ad87fb32f97d1cf7725c129e83898 Thanks for getting around to that, but I'm still getting a build error even with that patch: parser.cxx: In member function 'semantics::type& parser::impl::create_type(tree, parser::impl::access, const path&, size_t, size_t)': parser.cxx:1838:7: error: reference to 'array' is ambiguous array& a (unit_->new_node (file, line, clmn, t, size)); ^~~~~ And these two: parser.cxx:1838:24: error: parse error in template argument list array& a (unit_->new_node (file, line, clmn, t, size)); ^~~~~~~~~~~~~~~ parser.cxx:1838:66: error: no matching function for call to 'semantics::unit::new_node(const path&, size_t&, size_t&, tree_node*&, long long unsigned int&)' array& a (unit_->new_node (file, line, clmn, t, size)); > > > A couple of notes: > > 1. GCC 6 is C++14 by default, so you may want to compile with -std=c++03 or > pass -Wno-deprecated-declarations to suppress auto_ptr warnings. > The warnings are ok and, like you pointed out, I can supress them if they become too annoying. > > 2. While it compiles and prints usage, I could not make it compile any > code; > std::locale() throws bad_alloc. I didn't spend too much time on this > since > it is still early in the release process and it is probably quite buggy. > But maybe the Fedora build has some extra patches, so let me know how it > goes. That's interesting. gcc 6.0 is still not a stable release, so it might be a bug in gcc or the underlying C++ library. Hopefully, once I get things to build, then I can do some testing and this isn't an issue or is easily resolve. Thanks, Dave From a.pasternak at mt-robot.com Mon Feb 8 10:44:28 2016 From: a.pasternak at mt-robot.com (Andreas Pasternak) Date: Mon Feb 8 10:44:32 2016 Subject: [odb-users] Enum encapsulation + getters / setters + query Message-ID: <56B8B7DC.4060101@mt-robot.com> Hello all, I have some library which encapsulates enums. I was able to persist etc. this types by writing: typedef safe_enum Some_Enum; Some_Enum event_type; #pragma db value(Some_Enum) definition #pragma db member(Some_Enum::val) get(underlying) set(set) underlying and set gets and sets the real C style enum. But when I want to use this now in a query I get the error (all other types of queries work): /../odb_query.h:370:23: error: no match for ?operator==? (operand types are ?const odb::query_columns< SomeClass, (odb::database_id)0u, odb::access::object_traits_impl< SomeClass, (odb::database_id)0u> >::d_class_::event_type_class_1_? and ?SomeClass {safe_enum}?) query::d.event_type == s.d().event_type() && Operator== is defined in safe_enum. Any hints on how to fix that? Thank you! From boris at codesynthesis.com Mon Feb 8 11:41:36 2016 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon Feb 8 11:41:41 2016 Subject: [odb-users] Re: odb and gcc 6.0 In-Reply-To: References: Message-ID: Hi Dave, Dave Johansen writes: > Thanks for getting around to that, but I'm still getting a build error even > with that patch: Ok, I actually only tested it in the C++03 mode. Here is another patch that makes it buildable in C++14: http://scm.codesynthesis.com/?p=odb/odb.git;a=commit;h=61d13eb53ade9f30a64892a901401bda5e42c335 Thanks, Boris From boris at codesynthesis.com Tue Feb 9 09:00:57 2016 From: boris at codesynthesis.com (Boris Kolpackov) Date: Tue Feb 9 09:01:01 2016 Subject: [odb-users] Enum encapsulation + getters / setters + query In-Reply-To: <56B8B7DC.4060101@mt-robot.com> References: <56B8B7DC.4060101@mt-robot.com> Message-ID: Hi Andreas, Andreas Pasternak writes: > typedef safe_enum Some_Enum; > Some_Enum event_type; > > #pragma db value(Some_Enum) definition > #pragma db member(Some_Enum::val) get(underlying) set(set) > > /../odb_query.h:370:23: error: no match for ?operator==? [...] You have mapped it as a composite type and ODB doesn't support comparing composite types to anything but themselves in queries (which is what you normally want). This mapping is also conceptually not quite correct (Some_Enum "is a" SomeEnum_impl, not "has a" SomeEnum_impl). In the upcoming version this will be pretty easy to implement using the type mapping pragma: #pragma db map type(Some_Enum) as(SomeEnum_impl) \ to((?).underlying ()) from(Some_Enum (?)) In the current version the only way to achieve the same is either by using virtual data members (but then you will have to repeat the same thing for each data member) or by providing a value_traits specialization. Neither option is particularly appealing, so maybe a pre-release is the answer? I can package one if you would like. Boris From davejohansen at gmail.com Tue Feb 9 22:54:14 2016 From: davejohansen at gmail.com (Dave Johansen) Date: Tue Feb 9 22:54:20 2016 Subject: [odb-users] Re: odb and gcc 6.0 In-Reply-To: References: Message-ID: On Mon, Feb 8, 2016 at 9:41 AM, Boris Kolpackov wrote: > Hi Dave, > > Dave Johansen writes: > > > Thanks for getting around to that, but I'm still getting a build error > even > > with that patch: > > Ok, I actually only tested it in the C++03 mode. Here is another patch that > makes it buildable in C++14: > > > http://scm.codesynthesis.com/?p=odb/odb.git;a=commit;h=61d13eb53ade9f30a64892a901401bda5e42c335 > http://koji.fedoraproject.org/koji/taskinfo?taskID=12920336 The build finished, so I'll have to play around with it once it propagates to the repos. From a.pasternak at mt-robot.com Thu Feb 11 03:32:21 2016 From: a.pasternak at mt-robot.com (Andreas Pasternak) Date: Thu Feb 11 03:32:25 2016 Subject: [odb-users] Enum encapsulation + getters / setters + query In-Reply-To: References: <56B8B7DC.4060101@mt-robot.com> Message-ID: <56BC4715.2090908@mt-robot.com> Hello Boris, Thank you for your fast and precise answer! It would be great if I could test a pre-release version. Best regards, Andreas On 09.02.2016 15:00, Boris Kolpackov wrote: > Hi Andreas, > > Andreas Pasternak writes: > >> typedef safe_enum Some_Enum; >> Some_Enum event_type; >> >> #pragma db value(Some_Enum) definition >> #pragma db member(Some_Enum::val) get(underlying) set(set) >> >> /../odb_query.h:370:23: error: no match for ?operator==? [...] > You have mapped it as a composite type and ODB doesn't support > comparing composite types to anything but themselves in queries > (which is what you normally want). > > This mapping is also conceptually not quite correct (Some_Enum > "is a" SomeEnum_impl, not "has a" SomeEnum_impl). > > In the upcoming version this will be pretty easy to implement > using the type mapping pragma: > > #pragma db map type(Some_Enum) as(SomeEnum_impl) \ > to((?).underlying ()) from(Some_Enum (?)) > > In the current version the only way to achieve the same is either > by using virtual data members (but then you will have to repeat > the same thing for each data member) or by providing a value_traits > specialization. Neither option is particularly appealing, so maybe > a pre-release is the answer? I can package one if you would like. > > Boris From a.pasternak at mt-robot.com Thu Feb 11 03:33:17 2016 From: a.pasternak at mt-robot.com (Andreas Pasternak) Date: Thu Feb 11 03:33:20 2016 Subject: [odb-users] Enum encapsulation + getters / setters + query In-Reply-To: <56BC4715.2090908@mt-robot.com> References: <56B8B7DC.4060101@mt-robot.com> <56BC4715.2090908@mt-robot.com> Message-ID: <56BC474D.7020807@mt-robot.com> PS: We are using Debian 8 On 11.02.2016 09:32, Andreas Pasternak wrote: > Hello Boris, > > Thank you for your fast and precise answer! > > It would be great if I could test a pre-release version. > > Best regards, > > Andreas > > On 09.02.2016 15:00, Boris Kolpackov wrote: >> Hi Andreas, >> >> Andreas Pasternak writes: >> >>> typedef safe_enum Some_Enum; >>> Some_Enum event_type; >>> >>> #pragma db value(Some_Enum) definition >>> #pragma db member(Some_Enum::val) get(underlying) set(set) >>> >>> /../odb_query.h:370:23: error: no match for ?operator==? [...] >> You have mapped it as a composite type and ODB doesn't support >> comparing composite types to anything but themselves in queries >> (which is what you normally want). >> >> This mapping is also conceptually not quite correct (Some_Enum >> "is a" SomeEnum_impl, not "has a" SomeEnum_impl). >> >> In the upcoming version this will be pretty easy to implement >> using the type mapping pragma: >> >> #pragma db map type(Some_Enum) as(SomeEnum_impl) \ >> to((?).underlying ()) from(Some_Enum (?)) >> >> In the current version the only way to achieve the same is either >> by using virtual data members (but then you will have to repeat >> the same thing for each data member) or by providing a value_traits >> specialization. Neither option is particularly appealing, so maybe >> a pre-release is the answer? I can package one if you would like. >> >> Boris > From mne at qosmotec.com Thu Feb 11 09:26:36 2016 From: mne at qosmotec.com (Marcel Nehring) Date: Thu Feb 11 09:27:14 2016 Subject: [odb-users] Problem with object loading view Message-ID: <5661afcc586d4a17baefa081971e1d70@QEX.qosmotec.com> Hi, I am trying to load a persistent object from the database. This objects contains pointers to other persistent objects which again contain pointers to persistent objects and so forth. Somewhere down this tree there is an object for which I configured a callback using the callback pragma. When this callback fires in case of a post load event I try to load an object loading view. The type of object contained in this view is the same as the initial object I am trying to load. So what happens is that ODB eventually tries to load objects of my type from the database while it is already loading objects of the very same type from the database (maybe even the exactly same object). This leads to the violation of an debug assertion. In the corresponding view_traits_impl::init() the statement is already locked when an instance of auto_lock is created, so that no lock is acquired. However, it is later tried to release the lock. Is this a bug in ODB or am I not allowed to use ODB like this? Any suggestions on how a solution might look like? Regards, Marcel From boris at codesynthesis.com Thu Feb 11 11:29:00 2016 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu Feb 11 11:29:15 2016 Subject: [odb-users] AW: SQL Epiloge In-Reply-To: References: <021970097dcb4160b536f368956ad4e8@QEX.qosmotec.com> Message-ID: Hi Marcel, Marcel Nehring writes: > I don't "need" a pre-release since it was no problem to find other > ways to fulfill my needs. However, if you want me to test and verify > the fix I can certainly do so. Ok, I finally got around to packaging it: http://codesynthesis.com/~boris/tmp/odb/pre-release/a5/ If you have a chance to give that newline duplication fix a go, that would be great. Thanks, Boris From boris at codesynthesis.com Thu Feb 11 11:39:03 2016 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu Feb 11 11:39:05 2016 Subject: [odb-users] ODB plugin error when executing In-Reply-To: <8D5F0B7F-5B16-40B8-BEF7-25825C0B87CA@awion.dk> References: <646A5BEE-BB14-4E84-B128-3735B8E9D6CA@awion.dk> <8D5F0B7F-5B16-40B8-BEF7-25825C0B87CA@awion.dk> Message-ID: Hi Sverre, Sverre Eplov writes: > since my last post I?ve looked into your GIT repos and found the ?etc? > projects with the scripts you use to build. (I assume ;)). I have worked > out how your projects are placed in your ?work? folder, and structured my > accordingly, so I have the ?dist.sh? script working for the libXXX projects, > both GCC and Clang. I am glad it was useful ;-). > That cleared up a lot of stuff - if it not too much trouble, it would > be very nice with a binary odb which matches current master branch. Here you go: http://codesynthesis.com/~boris/tmp/odb/pre-release/a5/ Note that it is not a binary for Mac OS. You will still need to build the ODB compiler from source. However, it is bootstrapped with the "blessed" versions of autotools which I would expect to clear that preprocessor issue. > When you are contemplating switching build systems, would you mind > sharing the thoughts you have? While it is still at the very early stage, in a nutshell, it is becoming an ever increasing pain to test, distribute, and support ODB on all the platform/compiler combinations. This thread is a good example of it ;-). Unfortunately, there doesn't seem to be a build system that provides a uniform and reliable build interface across all the platforms (some people believe CMake provides this but I disagree). So we've decided to try and fix this (and also make a package manager while at it). You can read more about the project in the FAQ: https://build2.org/faq.xhtml Boris From boris at codesynthesis.com Thu Feb 11 11:42:26 2016 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu Feb 11 11:42:27 2016 Subject: [odb-users] Enum encapsulation + getters / setters + query In-Reply-To: <56BC4715.2090908@mt-robot.com> References: <56B8B7DC.4060101@mt-robot.com> <56BC4715.2090908@mt-robot.com> Message-ID: Hi Andreas, Andreas Pasternak writes: > It would be great if I could test a pre-release version. Here it is: http://codesynthesis.com/~boris/tmp/odb/pre-release/a5/ Note that while you will need to build the ODB compiler binary yourself, it should be very straightforward on Debian (see the INSTALL file in the ODB package). Boris From vileung at cantor.com Thu Feb 11 13:07:46 2016 From: vileung at cantor.com (Leung, Vincent) Date: Thu Feb 11 13:08:03 2016 Subject: [odb-users] Boost Bimap support Message-ID: <9BF5076D9F336647894A76AC3B06B2073AD5B4EC@TBPINFN0203.cad.local> Is anyone familiar with this? I tried passing the -profile boost/bimap flag to the odb compiler with no success. The error message was Taker.hxx:27:25: error: unable to map C++ type '::boost::bimaps::bimap< int, int >' used in data member 'test' to a MySQL database type Taker.hxx:27:25: info: use '#pragma db type' to specify the database type But it works with normal map functions perfectly. Would really like to get this working. Thanks. Vince CONFIDENTIAL: This e-mail, including its contents and attachments, if any, are confidential. If you are not the named recipient please notify the sender and immediately delete it. You may not disseminate, distribute, or forward this e-mail message or disclose its contents to anybody else. Copyright and any other intellectual property rights in its contents are the sole property of Cantor Fitzgerald and its affiliates. E-mail transmission cannot be guaranteed to be secure or error-free. The sender therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission. If verification is required please request a hard-copy version. Although we routinely screen for viruses, addressees should check this e-mail and any attachments for viruses. We make no representation or warranty as to the absence of viruses in this e-mail or any attachments. Please note that to ensure regulatory compliance and for the protection of our customers and business, we may monitor and read e-mails sent to and from our server(s). Any prices or data contained herein are indicative and subject to change without notice; its accuracy is not guaranteed and should not be relied on. Reliance may not be placed on trade confirmations issued other than by the Operations Department. This e-mail was issued by Cantor Fitzgerald. Cantor Fitzgerald Europe ("CFE") is regulated by the Financial Conduct Authority ("FCA"). CFE is an unlimited liability company incorporated under the laws of England (company number 2505767) and VAT registration (number 577 406809). CFE's registered office is at One Churchill Place, London E14 5RB. For any issues arising from this email please reply to the sender. CFE appears on the FCA register under no 149380. The FCA register appears at http://www.fca.org.uk/register/. The FCA is a financial services industry regulator in the United Kingdom and is located at 25 The North Colonnade, Canary Wharf, London, E14 5HS. From davejohansen at gmail.com Thu Feb 11 21:33:26 2016 From: davejohansen at gmail.com (Dave Johansen) Date: Thu Feb 11 21:33:32 2016 Subject: [odb-users] Re: odb and gcc 6.0 In-Reply-To: References: Message-ID: On Tue, Feb 9, 2016 at 8:54 PM, Dave Johansen wrote: > On Mon, Feb 8, 2016 at 9:41 AM, Boris Kolpackov > wrote: > >> Hi Dave, >> >> Dave Johansen writes: >> >> > Thanks for getting around to that, but I'm still getting a build error >> even >> > with that patch: >> >> Ok, I actually only tested it in the C++03 mode. Here is another patch >> that >> makes it buildable in C++14: >> >> >> http://scm.codesynthesis.com/?p=odb/odb.git;a=commit;h=61d13eb53ade9f30a64892a901401bda5e42c335 >> > > http://koji.fedoraproject.org/koji/taskinfo?taskID=12920336 > The build finished, so I'll have to play around with it once it propagates > to the repos. > I just built several of the examples with sqlite and they ran just fine, so I'm guessing that they must have resolved that issue in Fedora and things appear to be working. From boris at codesynthesis.com Fri Feb 12 10:01:02 2016 From: boris at codesynthesis.com (Boris Kolpackov) Date: Fri Feb 12 10:01:03 2016 Subject: [odb-users] Re: odb and gcc 6.0 In-Reply-To: References: Message-ID: Hi Dave, Dave Johansen writes: > I just built several of the examples with sqlite and they ran just fine, so > I'm guessing that they must have resolved that issue in Fedora and things > appear to be working. Ok, that's good news. I am glad I didn't waste too much time chasing this. Boris From boris at codesynthesis.com Fri Feb 12 10:24:24 2016 From: boris at codesynthesis.com (Boris Kolpackov) Date: Fri Feb 12 10:24:26 2016 Subject: [odb-users] Boost Bimap support In-Reply-To: <9BF5076D9F336647894A76AC3B06B2073AD5B4EC@TBPINFN0203.cad.local> References: <9BF5076D9F336647894A76AC3B06B2073AD5B4EC@TBPINFN0203.cad.local> Message-ID: Hi Vincent, Leung, Vincent writes: > I tried passing the -profile boost/bimap flag to the odb compiler with > no success. The manual doesn't mention Boost bitmap as one of the supported libraries so it is a good indication that it is not supported by the profile. It will, however, be pretty easy to provide the necessary traits specialization. For an example, check how the Boost unordered_map is implemented. Boris From boris at codesynthesis.com Fri Feb 12 10:52:20 2016 From: boris at codesynthesis.com (Boris Kolpackov) Date: Fri Feb 12 10:52:22 2016 Subject: [odb-users] Problem with object loading view In-Reply-To: <5661afcc586d4a17baefa081971e1d70@QEX.qosmotec.com> References: <5661afcc586d4a17baefa081971e1d70@QEX.qosmotec.com> Message-ID: Hi Marcel, Marcel Nehring writes: > Is this a bug in ODB or am I not allowed to use ODB like this? I guess it is a bug/unsupported feature. The problem is with the recursive use of the view. There is currently no support for this and adding it won't be trivial. One possible way to resolve it would be to move the callback to the view itself (it should be ok to re-use the view in its own post_load). Alternatively, you could use lazy pointers and only load "one level deep" at a time. Boris From soroush.rabiei at gmail.com Sat Feb 13 05:52:40 2016 From: soroush.rabiei at gmail.com (Soroush Rabiei) Date: Sat Feb 13 05:53:06 2016 Subject: [odb-users] Mapping new types Message-ID: Hi I have mapped `std::chrono::system_clock::time_point' to oracle's `DATE' object using following conversion: namespace odb { > namespace oracle { > template <> > class value_traits { > public: > typedef std::chrono::system_clock::time_point value_type; > typedef value_type query_type; > typedef char image_type; > static void > set_value (value_type& v, > const char b[7], > bool is_null) { > tm time; > std::time_t time_info; > if(!is_null) { > short year; > unsigned char month; > unsigned char day; > unsigned char hour; > unsigned char minute; > unsigned char second; > details::get_date(b, > year, > month, > day, > hour, > minute, > second); > time.tm_year = static_cast(year-1900); > time.tm_mon = static_cast(month-1); > time.tm_mday = static_cast(day); > time.tm_hour= static_cast(hour); > time.tm_min= static_cast(minute); > time.tm_sec= static_cast(second); > time_info = timegm(&time); > } > else { > time_info = 0; > } > v = std::chrono::system_clock::from_time_t(time_info); > } > static void > set_image (char b[7], > bool& is_null, > const value_type& v) { > std::time_t time_info; > tm* time; > if(!is_null) { > time_info = std::chrono::system_clock::to_time_t(v); > time = gmtime(&time_info); > } > else { > time = 0; > } > short year = static_cast(time->tm_year); > unsigned char month = static_cast(time->tm_mon); > unsigned char day = static_cast(time->tm_mday); > unsigned char hour = static_cast(time->tm_hour); > unsigned char minute = static_cast char>(time->tm_min); > unsigned char second = static_cast char>(time->tm_sec); > details::set_date(b, > year+1900, > month+1, > day, > hour, > minute, > second); > //delete time; > } > }; > } > } And it works just fine. Now I need to map `std::chrono::high_resolution_clock::time_point' into oracle's `TIMESTAMP' object. Though I can't find any starting point. I know the binary structure of oracle's `TIMESTAMP' object (13 bytes). From boris at codesynthesis.com Sun Feb 14 23:31:14 2016 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Feb 14 23:31:14 2016 Subject: [odb-users] Mapping new types In-Reply-To: References: Message-ID: Hi Soroush, Soroush Rabiei writes: > Now I need to map `std::chrono::high_resolution_clock::time_point' into > oracle's `TIMESTAMP' object. Though I can't find any starting point. I > know the binary structure of oracle's `TIMESTAMP' object (13 bytes). You don't need the binary representation of Oracle TIMESTAMP since ODB binds it via a descriptor that is wrapped as odb::oracle::datetime in . See how the Boost profile maps posix_time. Boris From anhu.com at gmail.com Mon Feb 15 06:37:22 2016 From: anhu.com at gmail.com (An Hu) Date: Mon Feb 15 09:35:10 2016 Subject: [odb-users] Unresolved external symbol error when including *.hxx file with common declarations Message-ID: I must use the ODB framework in my project. I have 2 files: station.hxx and common.hxx with following content: common.hxx #ifndef COMMON_HXX #define COMMON_HXX #include #pragma db value struct ProcessAggregateName { #pragma db column("SHORTNAME") std::string SHORTNAME; #pragma db column("LONGNAME") std::string LONGNAME; #pragma db column("SECONDARYNAME") std::string SECONDARYNAME; }; #pragma db value struct Reporting { #pragma db column("OPERATIONALLOG") std::string OPERATIONALLOG; #pragma db column("PRINTER") std::string PRINTER; #pragma db column("HIGHLIGHTING") bool HIGHLIGHTING; #pragma db column("REPORTTYPE") std::string REPORTTYPE; }; #endif // COMMON_HXX station.hxx #ifndef STATION_HXX #define STATION_HXX #include #include "common.hxx" #pragma db object table("STATION") class station { public: station () {} #pragma db id column("ID") int ID; #pragma db column("OPERATINGDOMAIN") long OPERATINGDOMAIN; #pragma db column("NAME") ProcessAggregateName NAME; #pragma db column("EXPORTBASICDATA") bool EXPORTBASICDATA; #pragma db column("EXPORTPROCESSDATA") bool EXPORTPROCESSDATA; #pragma db column("IMPORTBASICDATA") bool IMPORTBASICDATA; #pragma db column("IMPORTPROCESSDATA") bool IMPORTPROCESSDATA; #pragma db column("REPORTING") Reporting REPORTING; }; #endif // STATION_HXX The reason for this: I want to use structures declared in common.hxx also in other files, so I wanted to concentrate them in the same header file and include it whereever I need them. My problem: if I do it this way, I get linker errors like these: error LNK2019: unresolved external symbol "public: static void __cdecl odb::access::composite_value_traits::bind(struct odb::mssql::bind *,struct odb::access::composite_value_traits::image_type &,enum odb::mssql::statement_kind)" (?bind@ ?$composite_value_traits@UProcessAggregateName@@$03@access@odb@ @SAXPAU0mssql@3@AAUimage_type@123@W4statement_kind@43@@Z) referenced in function "public: static void __cdecl odb::access::object_traits_impl::bind(struct odb::mssql::bind *,struct odb::access::object_traits_impl::image_type &,enum odb::mssql::statement_kind)" (?bind@?$object_traits_impl@Vstation @@$03@access@odb@@SAXPAU0mssql@3@AAUimage_type@123@W4statement_kind@43@@Z) error LNK2019: unresolved external symbol "public: static void __cdecl odb::access::composite_value_traits::init(struct odb::access::composite_value_traits::image_type &,struct ProcessAggregateName const &,enum odb::mssql::statement_kind)" (?init@ ?$composite_value_traits@UProcessAggregateName@@$03@access@odb@ @SAXAAUimage_type@123@ABUProcessAggregateName@@W4statement_kind@mssql@3@@Z) referenced in function "public: static void __cdecl odb::access::object_traits_impl::init(struct odb::access::object_traits_impl::image_type &,class station const &,enum odb::mssql::statement_kind)" (?init@?$object_traits_impl@Vstation @@$03@access@odb@@SAXAAUimage_type@123@ABVstation@@W4statement_kind@mssql@3@ @Z) If I copy the declaration of ProcessAggregateName and Reporting into station.hxx directly instead of including common.hxx, everything goes fine. What do I do wrong and how can I declare commonly used structures in a single header and include it in multiple *.hxx files? From mne at qosmotec.com Tue Feb 16 05:50:43 2016 From: mne at qosmotec.com (Marcel Nehring) Date: Tue Feb 16 05:51:20 2016 Subject: AW: [odb-users] Problem with object loading view In-Reply-To: References: <5661afcc586d4a17baefa081971e1d70@QEX.qosmotec.com> Message-ID: Hi Boris, thanks for your answer. I am not sure if you misunderstood me or I misunderstood you, but I don't think that there is a recursive use of the view. At least loading the view does not trigger another load of the same view while the first is not yet finished. However, I dug a little bit deeper into this and figured out that the problem only occurs if a polymorphic class is involved. Since I now understand the problem better, I was finally able to construct a small example to reproduce the problem. What happens is the following: * I manually load all instances of class Derived from the database. Derived has a polymorphic base class. * Loading an instance of Derived triggers loading of a class Foo due to object relationships. * Loading of a Foo triggers loading of a Bar, let's call it A. * Bars are collected in a BarCollection and they know of the collection they are a member of, so loading a Bar triggers loading of a BarCollection. * Loading of a BarCollection triggers loading of all contained Bars, including a Bar B. * When Bar B is fully loaded the post load callback fires. * Inside this callback I manually try to load a Derived, since loading of the Derived object from the first step is not yet finished it is not present in ODB's session cache. (If it were, it would work fine) * ODB tries to load the polymorphic object from the database, causing the assertion to fire. I guess the cached statement is still locked because we are still in the middle of loading the Derived instance from the first step. The code that reproduces this problem together with the data for the database that is needed to reproduce it is attached below. As I said, I am not sure if this is the problem that you already mentioned in you last message. Regards, Marcel // crash.h #pragma once /* INSERT INTO BASE (ID, TYPEID) VALUES (1, 'Derived'); INSERT INTO BASE (ID, TYPEID) VALUES (2, 'Derived'); INSERT INTO DERIVED (ID) VALUES (1); INSERT INTO DERIVED (ID) VALUES (2); INSERT INTO BARCOLLECTION (ID) VALUES (1); INSERT INTO BAR (ID, COLLECTION) VALUES (1, 1); INSERT INTO BAR (ID, COLLECTION) VALUES (2, 1); INSERT INTO FOO (ID, BAR, DERIVED) VALUES (1, 1, 1); INSERT INTO FOO (ID, BAR, DERIVED) VALUES (2, 2, 2); */ #include #include #include #include class Foo; class Bar; #pragma db object polymorphic pointer(std::shared_ptr) session class Base { public: virtual void foo() = 0; #pragma db id auto int m_id; }; #pragma db object pointer(std::shared_ptr) session class Derived : public Base { public: void foo() { /* no-op */ }; #pragma db inverse(m_derived) std::shared_ptr m_foo; }; #pragma db object pointer(std::shared_ptr) session class Foo { public: #pragma db id auto int m_id; std::shared_ptr m_bar; std::shared_ptr m_derived; }; #pragma db object pointer(std::shared_ptr) session class BarCollection { public: #pragma db id auto int m_id; #pragma db inverse(m_collection) std::vector> m_bars; }; #pragma db view object(Bar) object(Foo inner) object(Derived inner) session struct MyView { std::shared_ptr derived; }; #pragma db object callback(loadView) pointer(std::shared_ptr) session class Bar { public: void loadView(odb::callback_event event, odb::database& db); #pragma db id auto int m_id; std::shared_ptr m_collection; }; //crash.cpp #include "crash.h" #include "crash-odb.h" #include "odb/oracle/database.hxx" #include "odb/session.hxx" #include void Bar::loadView(odb::callback_event event, odb::database& db) { if (event == odb::callback_event::post_load) { auto resultSet(db.query(odb::query::Derived::id == m_id)); for (auto iter(resultSet.begin()); iter != resultSet.end(); ++iter) { auto relatedDerived = iter->derived; } } } int main(int argc, char ** argv) { std::shared_ptr db(new odb::oracle::database("odb", "secret", "XE", "localhost", 1521)); odb::session s; odb::transaction t(db->begin()); odb::result results(db->query()); for (auto iter(results.begin()); iter != results.end(); ++iter) { auto derived = iter.load(); std::cout << "Derived with ID " << derived->m_id << " loaded" << std::endl; } t.commit(); } From boris at codesynthesis.com Tue Feb 16 22:45:50 2016 From: boris at codesynthesis.com (Boris Kolpackov) Date: Tue Feb 16 22:45:49 2016 Subject: [odb-users] Unresolved external symbol error when including *.hxx file with common declarations In-Reply-To: References: Message-ID: Hi, An Hu writes: > The reason for this: I want to use structures declared in common.hxx also > in other files [...] > > error LNK2019: unresolved external symbol "public: static void __cdecl > odb::access::composite_value_traits::bind(struct odb::mssql::bind *,struct > odb::access::composite_value_traits::image_type &,enum > odb::mssql::statement_kind)" You need to compile common.hxx with the ODB compiler and then add the resulting common-odb.cxx file to your project. Boris From mne at qosmotec.com Thu Feb 18 10:01:25 2016 From: mne at qosmotec.com (Marcel Nehring) Date: Thu Feb 18 10:02:01 2016 Subject: [odb-users] Inconsistency in documentation? Message-ID: Hi, I think there is an inconsistency in the documentation. I am using sessions and the optimistic concurrency model. When I now want to discard local changes to persistent objects that I only performed in my local memory (i.e. overwrite my local state with the one from the database) I need to use ODB's database::load function taking a database ID and an object instance. I find it a bit strange that database::reload does not do this, but this is documented, so I guess there is a good reason for it. Anyhow, when using sessions, I thought that database::load always returns the current session's cached version. In 11.1 "Object Cache" it is stated, that "For as long as the session is in effect, any subsequent calls to load the same object will return the cached instance". In 3.9 "Loading Persistent Objects", however, it is stated that "In certain situations it may be necessary to reload the state of an object from the database [...] this is easy to achieve using the second load() function". Where "the second load function" is the one taking an ID and an existing instance. Ok, in 11.1 we speak of the same object being "returned" whereas the database::load() function's return type is void but this might be a bit subtle. At least I misunderstood it up until now. Regards, Marcel From mne at qosmotec.com Fri Feb 19 06:29:28 2016 From: mne at qosmotec.com (Marcel Nehring) Date: Fri Feb 19 06:30:07 2016 Subject: AW: [odb-users] AW: SQL Epiloge In-Reply-To: References: <021970097dcb4160b536f368956ad4e8@QEX.qosmotec.com> Message-ID: <5c63c49ef0184dc5bc9dc1fb88357a00@QEX.qosmotec.com> Hi Boris, I can confirm that providing the option --sql-epilogue-file multiple times works as expected. Also the issue with the comment seems to be fixed. I still see, however, that \r\n in my file is converted to \r\r\n in the generated schema definition. Regards, Marcel -----Urspr?ngliche Nachricht----- Von: Boris Kolpackov [mailto:boris@codesynthesis.com] Gesendet: Donnerstag, 11. Februar 2016 17:29 An: Marcel Nehring Cc: odb-users@codesynthesis.com Betreff: Re: [odb-users] AW: SQL Epiloge Hi Marcel, Marcel Nehring writes: > I don't "need" a pre-release since it was no problem to find other > ways to fulfill my needs. However, if you want me to test and verify > the fix I can certainly do so. Ok, I finally got around to packaging it: http://codesynthesis.com/~boris/tmp/odb/pre-release/a5/ If you have a chance to give that newline duplication fix a go, that would be great. Thanks, Boris From fabrizio.maj at it.atlascopco.com Thu Feb 18 10:36:24 2016 From: fabrizio.maj at it.atlascopco.com (Fabrizio Maj) Date: Fri Feb 19 09:55:07 2016 Subject: [odb-users] Compilation error in odb\lazy-ptr.ixx - ODB 2.4.0 - Visual C++ 12 - Windows 7 Message-ID: Hello, I am experiencing a compilation problem using odb::lazy_shared_ptr and also odb::lazy_weak_ptr. Calls to the load() method on both types provokes compilation errors like this: c:\projects\libsroot\libodb-2.4.0\odb-2.4.0-i686-windows\mingw\include\odb\lazy-ptr.ixx:1153:10: error: no match for 'operator=' (operand types are 'std::shared_ptr' and 'odb::object_traits::pointer_type {aka Child*}') p_ = i_.template load (true); // Reset id. ^ Similar errors appears both from the ODB compiler and from the VC compiler. The problem appears in function child() while parsing/compiling this entity class: PRAGMA_DB(object) class Parent { public: ... ChildPtr child() const { return m_child.load(); } private: ... odb::lazy_shared_ptr m_child; }; (ChildPtr is a typedef of std::shared_ptr) I have attached the VC solution, the batch file used to invoke the ODB compiler and the complete error log. It seems to me that the problem is that the conversion from the raw pointer returned by i_load<>() cannot be implicitly converted to a shared_ptr. Changing lines similar to the above inside lazy-ptr.ixx in the following way seems to fix the problem: template inline std::shared_ptr lazy_shared_ptr:: load () const { if (!p_ && i_) p_ = std::shared_ptr(i_.template load (true)); // Reset id. ADDED // p_ = i_.template load (true); // Reset id. REMOVED return p_; } Do you think that this fix is correct or am I missing something? Thank you and best regards, Fabrizio Maj Software Design ________________________________ Atlas Copco BLM s.r.l. Address: Phone: +39 02 91084159 E-mail: fabrizio.maj@it.atlascopco.com Visit us at: Follow us at: http://www.atlascopco.com Facebook / Twitter / LinkedIn / YouTube Committed to sustainable productivity -------------- next part -------------- A non-text attachment was scrubbed... Name: odb_weak_pointers_problem.zip Type: application/x-zip-compressed Size: 8296 bytes Desc: odb_weak_pointers_problem.zip Url : http://codesynthesis.com/pipermail/odb-users/attachments/20160218/438f9e0f/odb_weak_pointers_problem.bin From boris at codesynthesis.com Fri Feb 19 10:22:38 2016 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sat Feb 20 02:07:41 2016 Subject: [odb-users] Compilation error in odb\lazy-ptr.ixx - ODB 2.4.0 - Visual C++ 12 - Windows 7 In-Reply-To: References: Message-ID: Hi Fabrizio, Fabrizio Maj writes: > c:\projects\libsroot\libodb-2.4.0\odb-2.4.0-i686-windows\mingw\include\odb\lazy-ptr.ixx:1153:10: > error: no match for 'operator=' (operand types are 'std::shared_ptr' > and 'odb::object_traits::pointer_type {aka Child*}') > > p_ = i_.template load (true); // Reset id. You need to make std::shared_ptr the object pointer for Child. See Section 3.3, "Object and View Pointers". BTW, most malware these days is sent as .zip archives so we should probably avoid sending test cases in this format (quite a few organizations simply reject any email that contains a .zip attachment). Boris From andrew at a-cunningham.com Fri Feb 19 18:21:21 2016 From: andrew at a-cunningham.com (Andrew Cunningham) Date: Sun Feb 21 03:21:23 2016 Subject: [odb-users] Easiest transition from SQLite Message-ID: I want to experiment with moving my ODB/SQLite to MySQL, Postgres, MSSQL, Oracle.... The database would be hosted on the same machine as the client process. So typically what is the easiest/simplest server database to experiment with and set up? I don't use any SQLite specific functions, though I make heavy use of BLOB's and expect BLOB's to be up to 2GB. From chris at cwmmarketing.co.za Mon Feb 22 01:37:51 2016 From: chris at cwmmarketing.co.za (Chris Visser) Date: Mon Feb 22 01:38:05 2016 Subject: [odb-users] Problem with updating a transient object when adding a ptr in a to-many relationship Message-ID: <003a01d16d3b$8e08bb50$aa1a31f0$@cwmmarketing.co.za> Hi In the source code below I always get the exception thrown. I have tried several ways of doing it, and still I get an error. I tried the following methods: 1. As below, where I create the Address as a shared_ptr, persist, add to Person and update Person 2. Create the Address Object, persist, add to Person and update Person 3. Create Address as shared_ptr, add to Person and update Person. 4. Create Address as lazy_shared_ptr, persist (not persist), add to Person and update Person 5. Create address, persist, load again from DB as a shared_ptr or lazy_shared_ptr, add to Person and update Person. I have tried all combinations I can think of, and I always end up with the exception being thrown. What am I doing wrong here? NOTE: The below code is a fragment of what I really have. In reality the Person class has several vectors and shared_ptr's. But I only add one single element to one single vector. And then I get the error. Some of the class members are lazy_shared_ptr and it is not a good idea to actually load that ptr since it will incur a huge performance hit as well as memory drain. Think of it as a company, with a vector of employees, each having multiple address, phone numbers, projects, etc. But the principle of what I want to achieve is shown below. Please tell me what I am doing wrong here. Thanks Chris #pragma db object Class Person{ public: friend class odb::access; #pragma db id auto int m_Id; odb::vector> m_Addresses; } #pragma db object class Address { public: friend class odb::access; #pragma db id auto int m_Id; std::string m_AdddressLines; } int main() { std::shared_ptr db = ... typedef odb::query PersonQuery; typedef odb::result PersonResult; try{ odb::transaction t(db->begin); std::shared_ptr john = db->query_one(PersonQuery::Id = 1); std::shared_ptr
address(new Address()); Address->m_AddressLines = "Address of the person"; int addressId = db->persist(address); john->m_Addresses->push_back(address); db->update(john); t.commit(); } catch (odb::object_already_persisted& e) { std::cout << "Error: " << e.what() << std::endl; return 1; } return 0; } From boris at codesynthesis.com Mon Feb 22 08:17:10 2016 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon Feb 22 08:17:05 2016 Subject: [odb-users] Problem with updating a transient object when adding a ptr in a to-many relationship In-Reply-To: <003a01d16d3b$8e08bb50$aa1a31f0$@cwmmarketing.co.za> References: <003a01d16d3b$8e08bb50$aa1a31f0$@cwmmarketing.co.za> Message-ID: Hi Chris, Chris Visser writes: > In the source code below I always get the exception thrown. I don't see anything wrong with your code off the top of my head. Which database are you using? Also, exactly which line in that transaction throws the exception? Boris From boris at codesynthesis.com Mon Feb 22 08:22:16 2016 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon Feb 22 08:22:10 2016 Subject: [odb-users] AW: SQL Epiloge In-Reply-To: <5c63c49ef0184dc5bc9dc1fb88357a00@QEX.qosmotec.com> References: <021970097dcb4160b536f368956ad4e8@QEX.qosmotec.com> <5c63c49ef0184dc5bc9dc1fb88357a00@QEX.qosmotec.com> Message-ID: Hi Marcel, Marcel Nehring writes: > I can confirm that providing the option --sql-epilogue-file multiple > times works as expected. Also the issue with the comment seems to be > fixed. Great, thanks for testing this. > I still see, however, that \r\n in my file is converted to \r\r\n in > the generated schema definition. All we do in that code is call getline() and then write it out. So I am afraid this is MinGW's (un)helpful meddling with newlines and I am not sure what we can do about it. Boris From boris at codesynthesis.com Mon Feb 22 08:30:23 2016 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon Feb 22 08:30:17 2016 Subject: [odb-users] Inconsistency in documentation? In-Reply-To: References: Message-ID: Hi Marcel, Marcel Nehring writes: > I am using sessions and the optimistic concurrency model. When I now want to > discard local changes to persistent objects that I only performed in my > local memory (i.e. overwrite my local state with the one from the database) > I need to use ODB's database::load function taking a database ID and an > object instance. I find it a bit strange that database::reload does not do > this, but this is documented, so I guess there is a good reason for it. When optimistic concurrency is enabled, reload() is meant to be used to update the object's state but only if it has changed in the database. > Anyhow, when using sessions, I thought that database::load always returns > the current session's cached version. Yes, if you call the version that returns a dynamically-allocated instance. If you load into an existing instance, then it would be strange to return something else. > In 11.1 "Object Cache" it is stated, that "For as long as the session is > in effect, any subsequent calls to load the same object will return the > cached instance". In 3.9 "Loading Persistent Objects", however, it is > stated that "In certain situations it may be necessary to reload the > state of an object from the database [...] this is easy to achieve using > the second load() function". Where "the second load function" is the one > taking an ID and an existing instance. > > Ok, in 11.1 we speak of the same object being "returned" whereas the > database::load() function's return type is void but this might be a bit > subtle. At least I misunderstood it up until now. I am still not sure where it is misleading. With the first version of load() you say "load me an object with this id" and, if this object is already in the cache, that's what's returned. In the second version you say "load me an object with this id into this specific instance". It would be strange to load it into some other instance (e.g., one from the cache)? Boris From mne at qosmotec.com Mon Feb 22 12:35:30 2016 From: mne at qosmotec.com (Marcel Nehring) Date: Mon Feb 22 12:36:06 2016 Subject: AW: [odb-users] AW: SQL Epiloge In-Reply-To: References: <021970097dcb4160b536f368956ad4e8@QEX.qosmotec.com> <5c63c49ef0184dc5bc9dc1fb88357a00@QEX.qosmotec.com> Message-ID: Hi Boris, after all I don't think it causes any problems. And as far as our usage is concerned I started to use a single epilogue.sql to specify custom stuff. But within this epilogue.sql I only call another file. So I don't run into the case where ODB/MinGW meddles with my newlines. Regards, Marcel -----Urspr?ngliche Nachricht----- Von: Boris Kolpackov [mailto:boris@codesynthesis.com] Gesendet: Montag, 22. Februar 2016 14:22 An: Marcel Nehring Cc: odb-users@codesynthesis.com Betreff: Re: [odb-users] AW: SQL Epiloge Hi Marcel, Marcel Nehring writes: > I can confirm that providing the option --sql-epilogue-file multiple > times works as expected. Also the issue with the comment seems to be > fixed. Great, thanks for testing this. > I still see, however, that \r\n in my file is converted to \r\r\n in > the generated schema definition. All we do in that code is call getline() and then write it out. So I am afraid this is MinGW's (un)helpful meddling with newlines and I am not sure what we can do about it. Boris From chris at cwmmarketing.co.za Mon Feb 22 16:25:34 2016 From: chris at cwmmarketing.co.za (Chris Visser) Date: Mon Feb 22 16:25:45 2016 Subject: [odb-users] Problem with updating a transient object when adding a ptr in a to-many relationship In-Reply-To: References: <003a01d16d3b$8e08bb50$aa1a31f0$@cwmmarketing.co.za> Message-ID: <003a01d16db7$91209750$b361c5f0$@cwmmarketing.co.za> Hi I am using SQL Server, and the line giving the problem is db->update(John); Hope this helps. Regards Chris -----Original Message----- From: Boris Kolpackov [mailto:boris@codesynthesis.com] Sent: 22 February 2016 15:17 To: Chris Visser Cc: odb-users@codesynthesis.com Subject: Re: [odb-users] Problem with updating a transient object when adding a ptr in a to-many relationship Hi Chris, Chris Visser writes: > In the source code below I always get the exception thrown. I don't see anything wrong with your code off the top of my head. Which database are you using? Also, exactly which line in that transaction throws the exception? Boris ----- No virus found in this message. Checked by AVG - www.avg.com Version: 2016.0.7442 / Virus Database: 4537/11680 - Release Date: 02/22/16 From mne at qosmotec.com Tue Feb 23 04:14:00 2016 From: mne at qosmotec.com (Marcel Nehring) Date: Tue Feb 23 04:14:34 2016 Subject: AW: [odb-users] Inconsistency in documentation? In-Reply-To: References: Message-ID: Hi Boris, > With the first version of load() you say "load me an object with this id" and, > if this object is already in the cache, that's what's returned. > In the second version you say "load me an object with this id into this specific instance". > It would be strange to load it into some other instance (e.g., one from the cache)? Of course you are right. That is a very good argument ;) In my specific case it would have still worked (since I always pass the instance from the cache) that is probably why I didn't thought about this issue. What I originally meant was that 11.1 does not mention that only one version of load() respects the cache. Thanks for clarifying what reload() is intended for. Regards, Marcel From boris at codesynthesis.com Tue Feb 23 09:21:42 2016 From: boris at codesynthesis.com (Boris Kolpackov) Date: Tue Feb 23 09:21:48 2016 Subject: [odb-users] Problem with updating a transient object when adding a ptr in a to-many relationship In-Reply-To: <003a01d16db7$91209750$b361c5f0$@cwmmarketing.co.za> References: <003a01d16d3b$8e08bb50$aa1a31f0$@cwmmarketing.co.za> <003a01d16db7$91209750$b361c5f0$@cwmmarketing.co.za> Message-ID: Hi Chris, Chris Visser writes: > I am using SQL Server, and the line giving the problem is db->update(John); That would mean the object that 'John' points to is not persistent, for some reason. Try to print the object id of object(s) that are in John's vector and see if they are actually in the database. If that doesn't shed any light, then I will need a small but complete test case that I can use to reproduce the problem. Boris From boris at codesynthesis.com Tue Feb 23 09:39:24 2016 From: boris at codesynthesis.com (Boris Kolpackov) Date: Tue Feb 23 09:39:30 2016 Subject: [odb-users] Easiest transition from SQLite In-Reply-To: References: Message-ID: Hi Andrew, Andrew Cunningham writes: > I want to experiment with moving my ODB/SQLite to MySQL, Postgres, MSSQL, > Oracle.... > The database would be hosted on the same machine as the client process. > > So typically what is the easiest/simplest server database to experiment > with and set up? Any client-server database will be a lot more cumbersome to use in this setup than SQLite. Especially on Windows. Just a warning ;-). Also, while I have no experience with it whatsoever, MySQL has something called an embedded server. Maybe it's worth exploring... Next is MySQL vs PostgreSQL: my suggestion, is, unless you have a very good reason, to go with Postgres. Finally, SQL Server and Oracle will probably be even more difficult to setup, especially if you want to support multiple platforms. Boris From boris at codesynthesis.com Tue Feb 23 10:04:16 2016 From: boris at codesynthesis.com (Boris Kolpackov) Date: Tue Feb 23 10:04:21 2016 Subject: [odb-users] Inconsistency in documentation? In-Reply-To: References: Message-ID: Hi Marcel, Marcel Nehring writes: > What I originally meant was that 11.1 does not mention that only > one version of load() respects the cache. Ok, I've updated the manual to clarify this. Thanks, Boris From andrew at a-cunningham.com Tue Feb 23 12:26:23 2016 From: andrew at a-cunningham.com (Andrew Cunningham) Date: Wed Feb 24 10:41:48 2016 Subject: [odb-users] Easiest transition from SQLite In-Reply-To: References: Message-ID: Hi Boris, Thanks for the feedback. I experimented and , as you suggested I would find the case, I was able to get a MySQL/ODB test going pretty easily. SQL Server Express 2014 was a nightmare because of apparent conflicts with previous SQL Server editions installed on my machine. After hours of messing around ( nothing to do with ODB) to just add a system "Data Source" that used SQL Server Express 2014 I was forced to give up. Andrew On Tue, Feb 23, 2016 at 6:39 AM, Boris Kolpackov wrote: > Hi Andrew, > > Andrew Cunningham writes: > > > I want to experiment with moving my ODB/SQLite to MySQL, Postgres, MSSQL, > > Oracle.... > > The database would be hosted on the same machine as the client process. > > > > So typically what is the easiest/simplest server database to experiment > > with and set up? > > Any client-server database will be a lot more cumbersome to use in this > setup than SQLite. Especially on Windows. Just a warning ;-). > > Also, while I have no experience with it whatsoever, MySQL has something > called an embedded server. Maybe it's worth exploring... > > Next is MySQL vs PostgreSQL: my suggestion, is, unless you have a very > good reason, to go with Postgres. > > Finally, SQL Server and Oracle will probably be even more difficult to > setup, especially if you want to support multiple platforms. > > Boris > From chris at cwmmarketing.co.za Thu Feb 25 05:53:37 2016 From: chris at cwmmarketing.co.za (Chris Visser) Date: Thu Feb 25 05:53:48 2016 Subject: [odb-users] Problem with updating a transient object when adding a ptr in a to-many relationship In-Reply-To: References: <003a01d16d3b$8e08bb50$aa1a31f0$@cwmmarketing.co.za> <003a01d16db7$91209750$b361c5f0$@cwmmarketing.co.za> Message-ID: <007d01d16fba$c85d1a40$59174ec0$@cwmmarketing.co.za> Hi Boris I found the problem while writing a test case for you. My database was set up with the intermediary table having IDENTITY on the index column. Object_id INT Index INT IDENTITY Value varchar(255); It was stipulated as such in the #pragma for the fields to accommodate for the database attributes. But it caused the "object_already_persisted" exception. When I removed the IDENTITY setting on the Index column, everything worked fine. I also see that ODB handles the INDEX column the same as an IDENTITY column, and it is not needed to have it on the table. Regards Chris -----Original Message----- From: Boris Kolpackov [mailto:boris@codesynthesis.com] Sent: 23 February 2016 16:22 To: Chris Visser Cc: odb-users@codesynthesis.com Subject: Re: [odb-users] Problem with updating a transient object when adding a ptr in a to-many relationship Hi Chris, Chris Visser writes: > I am using SQL Server, and the line giving the problem is > db->update(John); That would mean the object that 'John' points to is not persistent, for some reason. Try to print the object id of object(s) that are in John's vector and see if they are actually in the database. If that doesn't shed any light, then I will need a small but complete test case that I can use to reproduce the problem. Boris ----- No virus found in this message. Checked by AVG - www.avg.com Version: 2016.0.7442 / Virus Database: 4537/11684 - Release Date: 02/23/16 From luisagiacomini.eu at gmail.com Thu Feb 25 11:37:35 2016 From: luisagiacomini.eu at gmail.com (Luisa Giacomini) Date: Thu Feb 25 11:49:05 2016 Subject: [odb-users] lazy pointers not working and update performance issue Message-ID: Hi Boris, I am quite new to odb and I have some performance issues. I am using sqlite with odb 2.3.0 (sqlite is mandatory, the odb version is due to a platform issue and I can eventually upgrade to 2.4.0 if really necessary) 1. The first problem is how to load the shared_ptr of an object, to be used as a foreign key into another object, without actually loading the object. I found on the manual the topic "lazy pointers" and it looks as if it exactly what I am looking for but it does not work. I tried this std::string str = "TERMINAL1"; lazy_shared_ptr er (db,str); //TERMINAL1 exists always SvTerminal svt; //SvTerminal has a field named mrid that is a shared_ptr vs Terminal svt.mrid(er.get_eager()); persist(svt); and yes, the shared_prt is null. What I am doing wrong? 2. I have found that the update instruction is quite slow; actually I have a table of 7000 elements, I load them, I modify a few fields and then call update one by one. The overall execution time is about 3sec, 1sec just for the updates. Is it possible to speed up the process, at least the update one with some kind of batch operation? Thanks in advance, Luisa. From boris at codesynthesis.com Fri Feb 26 09:28:46 2016 From: boris at codesynthesis.com (Boris Kolpackov) Date: Fri Feb 26 09:28:48 2016 Subject: [odb-users] lazy pointers not working and update performance issue In-Reply-To: References: Message-ID: Hi Luisa, Luisa Giacomini writes: > 1. The first problem is how to load the shared_ptr of an object, to be used > as a foreign key into another object, without actually loading the object. > I found on the manual the topic "lazy pointers" and it looks as if it > exactly what I am looking for but it does not work. > > I tried this > std::string str = "TERMINAL1"; > lazy_shared_ptr er (db,str); //TERMINAL1 exists always > SvTerminal svt; //SvTerminal has a field named mrid that is a > shared_ptr vs Terminal > svt.mrid(er.get_eager()); > persist(svt); > and yes, the shared_prt is null. What I am doing wrong? You need to make svt.mrid lazy_shared_ptr<> as well. You cannot convert a lazy pointer into a (non-NULL) eager one without loading the object. > 2. I have found that the update instruction is quite slow; actually I > have a table of 7000 elements, I load them, I modify a few fields and > then call update one by one. > The overall execution time is about 3sec, 1sec just for the updates. > Is it possible to speed up the process, at least the update one with > some kind of batch operation? SQLite doesn't support bulk operations (unlike, say, SQL Server and Oracle). A few things you can try, however: 1. Split the update into several smaller transaction, say 100 objects at a time. Chances are it takes so long because SQLite has to maintain a fairly large log. 2. Consider using object sections (Chapter 9, "Sections") to update only the few members that you have modified. Boris From andrew at a-cunningham.com Fri Feb 26 12:51:06 2016 From: andrew at a-cunningham.com (Andrew Cunningham) Date: Sat Feb 27 01:22:20 2016 Subject: [odb-users] Re: lazy pointers not working and update performance issue Message-ID: > > SQLite doesn't support bulk operations (unlike, say, SQL Server and >> Oracle). A few things you can try, however: >> >> 1. Split the update into several smaller transaction, say 100 objects >> at a time. Chances are it takes so long because SQLite has to maintain >> a fairly large log. >> >> 2. Consider using object sections (Chapter 9, "Sections") to update >> only the few members that you have modified. >> > I am using SQLIte and updating/persisting hundreds of thousands of objects in a few seconds. And this is all in one gigantic transaction and with a hideously complex object model/schema. ODB itself is *never *the bottleneck. You need to profile your code to see where it is spending it's time. From sexymimi64 at gmail.com Mon Feb 29 10:07:53 2016 From: sexymimi64 at gmail.com (=?UTF-8?Q?Michael_Mart=C3=ADn_Moro?=) Date: Mon Feb 29 10:08:20 2016 Subject: [odb-users] query_one assertion fail since postgres update Message-ID: Greetings, I'm running Archlinux here, and recently we've had an update of Postgresql (the current version is 9.5.1). There seems to be an issue with this new version and odb's `query_one` method. Everything else works fine, afaik, but each use of `query_one` in my application fails an assertion when I use 9.5.1 libs and database. I can perhaps help in fixing this issue, but I have no idea if it's already been reported (Archlinux made the update a few days ago already). The failing assertion is the following: /usr/include/odb/result.txx:36: bool odb::result::one(T&) [with T = User]: Assertion `++i == end ()' failed. I've recompiled everything from scratch (both odb's libs and my own). If this is news to you, I can later work on providing some test cases to reproduce the issue (if you even need those to reproduce the issue). Cheers, -- *Micha?l Mart?n Moro*