<div dir="ltr">Thank you for the detailed feedback. <div><br></div><div>I am torn between:</div><div><br></div><div>+ deleting sqlite from the BSP bset's <br></div><div>+ requiring tclsh to be installed <br></div><div>+ updating the RSB recipe for sqlite.<br></div><div><br></div><div>Given the desire to get a release out the door. I am prone to the first </div><div>option with a ticket for 5.2 to update sqlite and re-add it to the BSP</div><div>bsets.</div><div><br></div><div>Since you obviously use sqlite, if you could tackle updating the RSB </div><div>recipe, that would be great and avoid having to do something expedient</div><div>to get the release out the door.</div><div><br></div><div>Chris will eventually wake up in Sydney and chime in. :)</div><div><br></div><div>--joel</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Apr 2, 2020 at 1:36 PM Jonathan Brandmeyer <<a href="mailto:jbrandmeyer@planetiq.com">jbrandmeyer@planetiq.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>We just copied the amalgamation's single .c and .h file into our repository and built it as a single object into our application.  So the following recommendations come only from an amateur reading of the sources on current rtems-source-builder master.</div><div><br></div><div>3.8.8 is pretty old.  I'd just jump straight to 3.30.1, the current release.</div><div><br></div><div>Instead of downloading the sqlite-src zip, download sqlite-amalgamation or sqlite-autoconf and use that as a base.  I think the bset's configuration invocation is OK, except that I would set different CFLAGS as described in the next couple of paragraphs.  See also <a href="https://sqlite.org/amalgamation.html" target="_blank">https://sqlite.org/amalgamation.html</a></div><div><br></div><div>By default, the SQLite write-ahead-log relies on mmap to share some of its index structures between multiple processes.  It looks like the current RTEMS bset disables the WAL entirely.  Using the WAL gives much better performance than the rollback journal for write-intensive use cases.  We used SQLite to reliably buffer up and stitch together segments of our field software update process, which fits the WAL very well.  We set `-DSQLITE_MAX_MMAP_SIZE=0 -DSQLITE_DEFAULT_LOCKING_MODE=1` at compile time to avoid mmap's use since RTEMS has neither a VMM nor multiple address spaces.  It is still up to the application to choose either the WAL or the rollback journal.  See also <a href="https://sqlite.org/wal.html#noshm" target="_blank">https://sqlite.org/wal.html#noshm</a></div><div><br></div><div>We also added -DSQLITE_ENABLE_MEMSYS5 to our build, and used it to give SQLite its own memory spaces to operate on distinct from the rest of our application.  We explicitly provided it with its own MEMSYS5 heap, page cache, and lookaside pools.  RTEMS just needs to add the correct compile-time option to support this functionality.  It is still up to the application to configure and monitor those memory pools at runtime.  See also <a href="https://sqlite.org/malloc.html" target="_blank">https://sqlite.org/malloc.html</a></div><div><br></div><div>HTH,<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Apr 2, 2020 at 11:16 AM Joel Sherrill <<a href="mailto:joel@rtems.org" target="_blank">joel@rtems.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Apr 2, 2020, 12:09 PM Jonathan Brandmeyer <<a href="mailto:jbrandmeyer@planetiq.com" target="_blank">jbrandmeyer@planetiq.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>It depends on how you build it.  If you use the amalgamation, you aren't running the test suite, and you aren't building any of the other command-line tools that ship with sqlite, then I don't think you have to have TCL.</div></div></blockquote></div></div><div dir="auto"><br></div><div dir="auto">If the configuration command needs to change in the bset, could you suggest the command? It would be appreciated.</div><div dir="auto"><br></div><div dir="auto">--joel</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Apr 2, 2020 at 11:01 AM Joel Sherrill <<a href="mailto:joel@rtems.org" rel="noreferrer" target="_blank">joel@rtems.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi<div><br></div><div>It looks like tclsh is required to build sqlite. I filed this as a ticket since it is a bit of a broad issue. Added host dependency (docs, sb-check), no BSP bset builds without it installed, etc.</div><div><br></div><div>+ make -j 8 sqlite3.h <a href="http://libsqlite3.la" rel="noreferrer" target="_blank">libsqlite3.la</a><br>tclsh /home/joel/rtems-cron-5/rtems-source-builder/rtems/build/sqlite-3.8.8.1-powerpc-rtems5-1/build-xc/../sqlite-src-3080801/tool/mksqlite3h.tcl /home/joel/rtems-cron-5/rtems-source-builder/rtems/build/sqlite-3.8.8.1-powerpc-rtems5-1/build-xc/../sqlite-src-3080801 >sqlite3.h<br>gcc  -g -o mkkeywordhash -DSQLITE_OMIT_WAL=1 -DSQLITE_ENABLE_COLUMN_METADATA=1  /home/joel/rtems-cron-5/rtems-source-builder/rtems/build/sqlite-3.8.8.1-powerpc-rtems5-1/build-xc/../sqlite-src-3080801/tool/mkkeywordhash.c<br>gcc  -g -o lemon /home/joel/rtems-cron-5/rtems-source-builder/rtems/build/sqlite-3.8.8.1-powerpc-rtems5-1/build-xc/../sqlite-src-3080801/tool/lemon.c<br>/bin/sh: tclsh: command not found<br></div><div><br></div><div>--joel</div></div>
_______________________________________________<br>
devel mailing list<br>
<a href="mailto:devel@rtems.org" rel="noreferrer" target="_blank">devel@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/devel</a></blockquote></div><br clear="all"><br>-- <br><div dir="ltr">Jonathan Brandmeyer<br>Vice President of Software Engineering<br>PlanetiQ</div>
</blockquote></div></div></div>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr">Jonathan Brandmeyer<br>Vice President of Software Engineering<br>PlanetiQ</div>
</blockquote></div>