[Halld-offline] need for upgraded sqlite in CentOS 6

Mark Ito marki at jlab.org
Fri Mar 2 14:28:17 EST 2018


Richard,

Tried calling, left voicemail.

There is a problem with our current master branch on CentOS6. You likely 
need an sqlite version update. I need to apologize for leaving things in 
this state. I am working on an automatic solution and hope to have it 
out in few days. You might want to wait for that.

That said I am going to describe the kludge used at JLab. To start with 
look at build_scripts:

   git clone https://github.com/jeffersonlab/build_scripts

   cd build_scripts

   grep jlab6.sh *

You will see that this script (jlab6.sh) is used to identify RHEL6-ish 
platforms at JLab. These platforms need to use a more recent version of 
sqlite than is shipped with CentOS6 (version 3.6.20 in our case). I 
think that version 3.7 is the minimum. At JLab there is a version 3.13.0 
in the Computer Center supplied /apps tree.

Why is this needed? It is for SQLiteCpp as you may have guessed.

Back to the kludge: special treatment is needed for Makefile_sqlitecpp 
and Makefile_sim-recon in build scripts.

Makefile_sqlitecpp: add the path to the custom sqlite include file to 
CXXFLAGS. The relevant excerpt is:

...

JLAB6 = $(shell $(BUILD_SCRIPTS)/jlab6.sh)
ifeq ($(JLAB6),true)
     CMAKE = cmake -E env 
CXXFLAGS="-I/apps/sqlite/sqlite-3.13.0/include" cmake
else
     CMAKE = cmake
endif

...

Makefile_sim-recon: apply a patch to src/SBMS/sbms.py. The relevant 
excerpt is:

ifeq ($(JLAB6),true)
     cd $(HALLD_HOME)/src/SBMS ; \
     patch sbms.py < $(BUILD_SCRIPTS)/patches/sim-recon/sbms.py.patch
endif

...

The patch is as follows:

 > cat sbms.py.patch
--- sbms.py.old    2018-02-05 13:38:20.741702319 -0500
+++ sbms.py.new    2018-02-05 13:37:45.057513071 -0500
@@ -643,7 +643,7 @@
          SQLITECPP_LIBPATH = ["%s/lib" % (sqlitecpp_home)]
          env.AppendUnique(LIBPATH = SQLITECPP_LIBPATH)
          env.AppendUnique(LIBS    = 'SQLiteCpp')
-    AddSQLite.SQLITE_LINKFLAGS= "-lsqlite3"
+    AddSQLite.SQLITE_LINKFLAGS= "-lsqlite3 
-Wl,-rpath=/apps/sqlite/sqlite-3.13.0/lib"
      AddLinkFlags(env, AddSQLite.SQLITE_LINKFLAGS)

i. e., add an rpath option when sqlite is needed to search the custom 
library path rather than looking in /usr/lib64.

To build your own version of sqlite, you can use the makefile attched to 
this message. It will build version 3.13.0 in the current working directory.

I put this stuff in as stop-gap and then got distracted, leaving the 
problem out there to fester. Mea culpa.

   -- Mark

-- 
Mark Ito, marki at jlab.org, (757)269-5295

-------------- next part --------------
PWD = $(shell pwd)

SQLITE_VERSION = 3130000
SQLITE_YEAR = 2016
ifdef SQLITE_DIRTAG
 SQLITE_DIR = sqlite-$(SQLITE_VERSION)^$(SQLITE_DIRTAG)
else
 SQLITE_DIR = sqlite-$(SQLITE_VERSION)
endif
TARFILE = sqlite-autoconf-$(SQLITE_VERSION).tar.gz
SQLITE_HOME = $(PWD)/$(SQLITE_DIR)

all: $(SQLITE_HOME)/.install_done

$(TARFILE):
	wget --no-check-certificate https://www.sqlite.org/$(SQLITE_YEAR)/$(TARFILE)

$(SQLITE_HOME)/.untar_done: $(TARFILE)
	rm -rf untar_temp_dir
	mkdir untar_temp_dir
	cd untar_temp_dir ; tar zxf ../$(TARFILE)
	mv -v untar_temp_dir/* $(SQLITE_DIR)
	rmdir -v untar_temp_dir
	date > $@

$(SQLITE_HOME)/.configure_done: $(SQLITE_HOME)/.untar_done
	cd $(SQLITE_HOME) ; ./configure --prefix=$(SQLITE_HOME)
	date > $@

$(SQLITE_HOME)/.make_done: $(SQLITE_HOME)/.configure_done
	make -C $(SQLITE_HOME)
	date > $@

$(SQLITE_HOME)/.install_done: $(SQLITE_HOME)/.make_done
	make -C $(SQLITE_HOME) install
	date > $@


More information about the Halld-offline mailing list