Question

I am looking for a working distribution of SQLite for OpenVMS. I tried building SQLite 3.7.9 from the amalgamation file, using patches I found in a mailing list, but it does not quite work.

I am using HP C V7.1-015 on OpenVMS Alpha 7.3-2. Since I cannot install python, which seems to include SQLite3, I have to build from sources.

I compile using the following commands:

$ CC /OPTIMIZE -
     /DEFINE=(SQLITE_THREADSAFE=0, -
              SQLITE_OMIT_LOAD_EXTENSION=1, -
              SQLITE_OMIT_COMPILEOPTION_DIAGS=1, -
              SQLITE_OMIT_MEMORYDB=1, -
              SQLITE_OMIT_TEMPDB=1, -
              SQLITE_OMIT_DEPRECATED=1, -
              SQLITE_OMIT_SHARED_CACHE=1, -
              _USE_STD_STAT=ENABLE) -
     /FLOAT=IEEE_FLOAT -
     sqlite3.c
$ CC /OPTIMIZE -
     /DEFINE=(SQLITE_THREADSAFE=0, -
              SQLITE_OMIT_LOAD_EXTENSION=1, -
              SQLITE_OMIT_COMPILEOPTION_DIAGS=1, -
              SQLITE_OMIT_MEMORYDB=1, -
              SQLITE_OMIT_TEMPDB=1, -
              SQLITE_OMIT_DEPRECATED=1, -
              SQLITE_OMIT_SHARED_CACHE=1, -
              _USE_STD_STAT=ENABLE) -
     /FLOAT=IEEE_FLOAT -
     shell.c

I copied the defines from the mailing list, and added /FLOAT=IEEE_FLOAT to get rid of most warnings regarding floating points (related to overflows due to exponent 308).

During compilation I got some informationals and warnings. I get the following messages while linking:

$ LINK shell.obj,sqlite3.obj
...
%LINK-W-NUDFSYMS, 2 undefined symbols:
%LINK-I-UDFSYM,         __STD_FSTAT
%LINK-I-UDFSYM,         __STD_STAT
...

Since I am a little bit lost here, I rather have SQLite3 sources which compile on OpenVMS.

Was it helpful?

Solution

The specific problem you're getting from the linker arises from the fact that you've requested capability at compile time that your system doesn't have. I believe the _USE_STD_STAT option first became available in OpenVMS v8.2, yet you're on 7.3-2. Your compiler and your headers know what to do when _USE_STD_STAT is defined, but the functions to process the X/Open-compliant stat structure do not exist in the C run-time (CRTL in VMS parlance) on your system, and your linker is telling you, "ain't got those functions."

Ideally you would be able to upgrade your operating system. Current as of this writing is v8.4. v7.3-2 was released eight and a half years ago and v8.2 over seven years ago. I understand that there are technical, budgetary, and even political reason that upgrades aren't always possible. If it were me, and I were stuck on OpenVMS Alpha v7.3-2, I would try removing the _USE_STD_STAT=ENABLE from the compilation and see what blows up.

One of the side effects of enabling _USE_STD_STAT is that you also get _LARGEFILE along with it. If that's the only reason SQLite needs the option, you may be fine but limited to 4GB databases. I suspect there's more to it than that, i.e., SQLite very likely makes use of elements in the stat structure that do actually require the newer structure.

You can read up on the differences in the traditional and standards-compliant stat structures at http://h71000.www7.hp.com/doc/84final/5763/5763profile_062.html#index_x_1699.

OTHER TIPS

I've recently improved my VMSish patch for SQLite and made it available for SQLite version 3.7.14.1: http://www.mail-archive.com/sqlite-users@sqlite.org/msg73570.html (or http://sqlite.1065341.n5.nabble.com/Building-SQLite-3-7-14-1-for-OpenVMS-td65277.html).

POSIX locking still doesn't work though, and I was unable to find out why.

Well, there was a message on the sqlite-users mailing list on getting SQLite 3.7.9 working on OpenVMS. I don't know how relevant that is to the version you've got (or if the patch was adopted by the SQLite developers; they're a bit picky for legal reasons IIRC) but it looks likely to be useful. Good luck.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top