[Vm-dev] Re: updating and compiling the BerkeleyDB plugin

David T. Lewis lewis at mail.msen.com
Tue Apr 14 03:07:04 UTC 2015


Hi Paul,

Thanks for the clear instructions. I installed the 4.1.25 BerkeleyDB from the
Oracle site. That looks like the right place to start.

Are you working on a 32-bit Ubuntu system, or 64-bit? I'm working on a 64-bit
platform, and I think I'm seeing a few issues to be sorted out (nothing serious,
more or less what I'd expect on a plugin that has not be updated in a while):


[100%] Building C object BerkeleyDbPlugin/CMakeFiles/BerkeleyDbPlugin.dir/home/lewis/squeak/VM/src/plugins/BerkeleyDbPlugin/Berk
eleyDbPlugin.c.o
/home/lewis/squeak/VM/src/plugins/BerkeleyDbPlugin/BerkeleyDbPlugin.c: In function \xe2\x80\x98dbValueOf\xe2\x80\x99:
/home/lewis/squeak/VM/src/plugins/BerkeleyDbPlugin/BerkeleyDbPlugin.c:100:9: warning: cast to pointer from integer of different
size [-Wint-to-pointer-cast]
  return (Database *) (oop + 4);
         ^

I may not have time to really look at this for a few days, but I think if
we can get the plugin working on the older BerkeleyDB version, then the
updates should be straightforward from there.

Thanks also for setting up https://github.com/pdebruic/BerkeleyDBPlugin

Dave


On Mon, Apr 13, 2015 at 08:44:22AM -0700, Paul DeBruicker wrote:
> Hi Dave,
> 
> I've made a repository here:  https://github.com/pdebruic/BerkeleyDBPlugin and added you as a collaborator.  I have not yet made any changes in the files from the .sar.
> 
> 
> I did find that if I used version 4.1.25 then things compiled without the errors I posted yesterday and a VM was made. So I think we need to start with older versions of BerkeleyDB, which apt doesn't have.  I did not yet try the other 4.x versions and I'm not sure which would be best to use.  
> 
> The 4.x versions are available here: http://www.oracle.com/technetwork/database/database-technologies/berkeleydb/downloads/index-082944.html.
> 
> They include install directions and C API documentation accessible from the  docs/index.html file once you've extracted the download.  Once unzipped the install steps were:
> 
> cd build_unix
> ../dist/configure
> make
> sudo make install
> 
> 
> Thanks for taking a look
> 
> 
> Paul
> 
> 
> 
> On Apr 13, 2015, at 8:01 AM, David T. Lewis <lewis at mail.msen.com> wrote:
> 
> > Hi Paul,
> > 
> > I'm sure we'll want to put the source in Subversion at some point, but
> > github might be a good way to get started. I am dtlewis290 on github.
> > 
> > I have not actually installed berkeley DB on my ubuntu PC yet. Should I
> > just apt-get it from ubuntu, or is there a particular version that I
> > should try to use?
> > 
> > Thanks!
> > 
> > Dave
> > 
> > 
> >> 
> >> Hi David,
> >> 
> >> I followed your instructions and made some headway in getting the plugin
> >> compiled. The changes are on SquaeakSource.  I think I have now hit some
> >> errors that will necessitate making changes to the sqBerkeleyDbPlugin.c
> >> file in the .sar.
> >> 
> >> Where should I save/share those changes?
> >> 
> >> I'm ambivalent and will put it on github if you are too.
> >> 
> >> I'm using 32 bit ubuntu 14.04.  I think the current Big problem is that
> >> the
> >> plugin was written for BerkeleyDB version 4.???.  I've been trying to
> >> compile it against version 6.1, because its the current stable installed
> >> by
> >> apt-get.  Maybe the API has changed.  I'll download and try some of the
> >> 4.x
> >> libraries to see.
> >> 
> >> The current set of errors are pasted below.
> >> 
> >> I've got about an hour a week I want to spend on this so there is no rush
> >> on
> >> my end for Progress.
> >> 
> >> 
> >> Thanks for taking a look
> >> 
> >> 
> >> Paul
> >> 
> >> 
> >> 
> >> 
> >> 
> >> Scanning dependencies of target BerkeleyDbPlugin
> >> [ 77%] Building C object
> >> BerkeleyDbPlugin/CMakeFiles/BerkeleyDbPlugin.dir/home/deploy/src/trunk/src/plugins/BerkeleyDbPlugin/BerkeleyDbPlugin.c.o
> >> /home/deploy/src/trunk/src/plugins/BerkeleyDbPlugin/BerkeleyDbPlugin.c: In
> >> function ???initialiseModule???:
> >> /home/deploy/src/trunk/src/plugins/BerkeleyDbPlugin/BerkeleyDbPlugin.c:141:2:
> >> warning: passing argument 1 of ???sqDbInit??? from incompatible pointer
> >> type
> >> [enabled by default]
> >>  return sqDbInit(sqDbMalloc);
> >>  ^
> >> In file included from
> >> /home/deploy/src/trunk/src/plugins/BerkeleyDbPlugin/BerkeleyDbPlugin.c:37:0:
> >> /home/deploy/src/trunk/platforms/Cross/plugins/BerkeleyDbPlugin/BerkeleyDbPlugin.h:13:5:
> >> note: expected ???void * (*)(size_t)??? but argument is of type ???void *
> >> (*)(sqInt)???
> >> int sqDbInit(void *(*sq_malloc)(size_t size) );
> >>     ^
> >> [ 80%] Building C object
> >> BerkeleyDbPlugin/CMakeFiles/BerkeleyDbPlugin.dir/home/deploy/src/trunk/platforms/Cross/plugins/BerkeleyDbPlugin/sqBerkeleyDatabase.c.o
> >> /home/deploy/src/trunk/platforms/Cross/plugins/BerkeleyDbPlugin/sqBerkeleyDatabase.c:
> >> In function ???sqDbOpen???:
> >> /home/deploy/src/trunk/platforms/Cross/plugins/BerkeleyDbPlugin/sqBerkeleyDatabase.c:134:3:
> >> warning: passing argument 2 of ???dbp->open??? from incompatible pointer
> >> type
> >> [enabled by default]
> >>   DBCALL(dbp->open(dbp,fname,NULL,DB_BTREE,flags,0664); free(fname));
> >>   ^
> >> /home/deploy/src/trunk/platforms/Cross/plugins/BerkeleyDbPlugin/sqBerkeleyDatabase.c:134:3:
> >> note: expected ???struct DB_TXN *??? but argument is of type ???char *???
> >> /home/deploy/src/trunk/platforms/Cross/plugins/BerkeleyDbPlugin/sqBerkeleyDatabase.c:134:3:
> >> warning: passing argument 4 of ???dbp->open??? makes pointer from integer
> >> without a cast [enabled by default]
> >> /home/deploy/src/trunk/platforms/Cross/plugins/BerkeleyDbPlugin/sqBerkeleyDatabase.c:134:3:
> >> note: expected ???const char *??? but argument is of type ???int???
> >> /home/deploy/src/trunk/platforms/Cross/plugins/BerkeleyDbPlugin/sqBerkeleyDatabase.c:134:3:
> >> error: too few arguments to function ???dbp->open???
> >> make[2]: ***
> >> [BerkeleyDbPlugin/CMakeFiles/BerkeleyDbPlugin.dir/home/deploy/src/trunk/platforms/Cross/plugins/BerkeleyDbPlugin/sqBerkeleyDatabase.c.o]
> >> Error 1
> >> make[1]: *** [BerkeleyDbPlugin/CMakeFiles/BerkeleyDbPlugin.dir/all] Error
> >> 2
> >> make: *** [all] Error 2
> >> 
> >> 
> >> 
> >> 
> >> 
> >> David T. Lewis wrote
> >>> Hi Paul,
> >>> 
> >>> Thanks for doing this. I don't have time to really check it out right
> >>> now, but I did load your code from the new repository and I was able
> >>> to generate the C source with no problem (see attached).
> >>> 
> >>> I'll follow up on this in a few days, but at first glance it looks fine.
> >>> 
> >>> FYI, I'm using VMMaker trunk (load update-dtl.16.mcm), then "VMMakerTool
> >>> forUnix"
> >>> to open the VMM tool, then drag the BerkeleyDbPlugin from "Plugins not
> >>> built"
> >>> over to the "External Plugins" pane, then Generate Entire.
> >>> 
> >>> For platforms source, I used the sources from the original SAR and put
> >>> the header file in platforms/Cross/plugins/BerkeleyDbPlugin/ and the C
> >>> file in platforms/unix/plugins/BerkeleyDbPlugin/. I don't know if that's
> >>> right, but it works for generating the C code.
> >>> 
> >>> Dave
> >>> 
> >>> 
> >>> On Sun, Apr 05, 2015 at 08:50:36AM -0700, Paul DeBruicker wrote:
> >>>> 
> >>>> Hi David,
> >>>> 
> >>>> I made the project on SqueakSource.   The repo is here:
> >>>> 
> >>>> 
> >>>> MCHttpRepository
> >>>>    location: 'http://www.squeaksource.com/BerkeleyDB'
> >>>>    user: ''
> >>>>    password: ''
> >>>> 
> >>>> 
> >>>> When attempting to generate the plugin as an external plugin the error
> >>>> shown
> >>>> in the VMMaker window is:
> >>>> 
> >>>> warning, variable simulator doesn't exist or has already been removed
> >>>> failed to inline getErrorMessage: as it contains unrenamable C
> >>>> declarations
> >>>> or C code
> >>>> warning, signature of InterpreterProxy>>instantiateClass:indexableSize:
> >>>> does
> >>>> not match reference implementation.
> >>>> external plugin BerkeleyDbPlugin generated as BerkeleyDbPlugin
> >>>> 5 April 2015 9:00:18 am
> >>>> 
> >>>> 
> >>>> Are these warnings/errors serious?  Is the next step to get rid of
> >>>> them?
> >>>> 
> >>>> Thanks
> >>>> 
> >>>> Paul
> >>>> 
> >>>> 
> >>>> 
> >>>> 
> >>>> David T. Lewis wrote
> >>>>> I am assuming that this is "Berkeley DB Plugin" on SqueakMap, written
> >>>> by
> >>>>> Stephen Pair
> >>>>> and licensed SqueakL, and therefore OK to include in the VM.
> >>>>> 
> >>>>> The SAR file contains the platforms sources and some hints as to
> >>>> handle
> >>>> it
> >>>>> in a makefile.
> >>>>> 
> >>>>> I expect that this plugin could be brought back to life with a bit of
> >>>>> effort.
> >>>>> It also looks like something that might best be maintained outside of
> >>>>> VMMaker
> >>>>> so that the interested parties can update it as they please.
> >>>>> 
> >>>>> How about if we put the Smalltalk part of the plugin into a new
> >>>> project
> >>>> on
> >>>>> squeaksource.com? Paul DeBruicker, Stephen Pair, Eliot and I all have
> >>>>> accounts
> >>>>> on that server already, so it would be easy to put it there.
> >>>>> 
> >>>>> The Berkeley db library has a lot of history, and I don't know what
> >>>> the
> >>>>> current
> >>>>> runtimes would be on a modern unix/linux/osx platform. The
> >>>>> http://www.sleepycat.com
> >>>>> site redirects to Oracle now, which does not seem encouraging.
> >>>> Current
> >>>>> licensing
> >>>>> seems to be explained at http://en.wikipedia.org/wiki/Berkeley_DB.
> >>>>> 
> >>>>> Dave
> >>>>> 
> >>>>> On Sun, Mar 29, 2015 at 08:50:51AM -0700, Eliot Miranda wrote:
> >>>>>> 
> >>>>>> D'u have the smalltalk source or just the generated C code?  And I
> >>>> what
> >>>>>> VM build environment do you want to work?
> >>>>>> 
> >>>>>> Eliot (phone)
> >>>>>> 
> >>>>>> On Mar 29, 2015, at 7:46 AM, Paul DeBruicker &lt;
> >>>> 
> >>>>> pdebruic@
> >>>> 
> >>>>> &gt; wrote:
> >>>>>> 
> >>>>>>> 
> >>>>>>> Hi -
> >>>>>>> 
> >>>>>>> I've posted Steven Pair's  BerkeleyDB plugin .sar file to dropbox
> >>>> here:
> >>>>>>> 
> >>>>>>> 
> >>>>>>> https://dl.dropboxusercontent.com/u/4460862/BerkeleyDB.sar
> >>>>>>> 
> >>>>>>> 
> >>>>>>> 
> >>>>>>> I'd like to get it to compile (on linux...), and also to modify it
> >>>> to
> >>>>>> work with the LMDB (http://symas.com/mdb/). According to the LMDB
> >>>> docs
> >>>> it
> >>>>>> should be pretty straightforward to port something from BerkeleyDB.
> >>>>>>> 
> >>>>>>> From examining the .sar it looks like the plugin hasn't been
> >>>>>> edited/compiled since December 2002.
> >>>>>>> 
> >>>>>>> Is there a guide for bringing old plugins up to date?  IF not what
> >>>>>> should I expect to have to change to get it working?
> >>>>>>> 
> >>>>>>> Thanks
> >>>>>>> 
> >>>>>>> Paul
> >>>> 
> >>>> 
> >>>> 
> >>>> 
> >>>> 
> >>>> --
> >>>> View this message in context:
> >>>> http://forum.world.st/updating-and-compiling-the-BerkeleyDB-plugin-tp4815915p4817704.html
> >>>> Sent from the Squeak VM mailing list archive at Nabble.com.
> >>> 
> >>> 
> >>> BerkeleyDbPlugin.c (20K)
> >>> &lt;http://forum.world.st/attachment/4817710/0/BerkeleyDbPlugin.c&gt;
> >> 
> >> 
> >> 
> >> 
> >> 
> >> --
> >> View this message in context:
> >> http://forum.world.st/updating-and-compiling-the-BerkeleyDB-plugin-tp4815915p4819198.html
> >> Sent from the Squeak VM mailing list archive at Nabble.com.
> >> 
> > 
> > 


More information about the Vm-dev mailing list