-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using RCDB with an SQLite file #62
Comments
RCDB C++ API is a header only since possible 0.03 (I finished it just before I left). Which means there is no more librcdb and separate build step for RCDB. That also means that MySQL and SQLite libraries should be linked to the application which includes RCDB headers. Here is the updated documentation |
Thanks for the updated documentation! Three questions:
|
Yes, sure, just add both RCDB_MYSQL and RCDB_SQLITE and all dependencies for MySQL and SQLite
No code changes. But at least uncomment SQLITE in SBMS Here is the code for ##################################
# SQLite
##################################
def AddSQLite(env):
if "SQLITE_LINKFLAGS" not in AddSQLite.__dict__:
AddSQLite.SQLITE_LINKFLAGS= "-lsqlite3"
AddLinkFlags(env, AddSQLite.SQLITE_LINKFLAGS)
##################################
# RCDB
##################################
def AddRCDB(env):
rcdb_home = os.getenv('RCDB_HOME')
if(rcdb_home != None) :
env.AppendUnique(CXXFLAGS = ['-DHAVE_RCDB'])
# add MySQL
env.Append(CPPDEFINES='RCDB_MYSQL')
AddMySQL(env)
# add SQlite
env.Append(CPPDEFINES='RCDB_SQLITE')
AddSQLite(env) (Would appreciate it to be tested because hasn't handled sim-recon installation on the latest Ubuntu)
I think, after p. 2 is tested. |
Still need this line in sbms.py, no?
Is there any library needed for SQLite? |
Even after dropping the search of cpp/include/SQLite (thought that would help) I get errors like: Linux_RHEL7-x86_64-gcc4.8.5/programs/Simulation/mcsmear/CCALSmearer.o: In function and /usr/include/c++/4.8.2/bits/stl_list.h:1546: multiple definition of when linking mcsmear. I do have sqlite installed via rpm (in case that is relevant): sqlite-3.7.17-8.el7.x86_64 |
I think that may stay. If somebody sets RCDB_HOME manually (without calling
Looks very much like something has not been fully rebuilt. I've double checked sim-recon code for sqlite occurrences. |
I did a clean build and am still getting the same errors. It looks like it does not like RCDB/SQLiteCpp.h which gets included via RCDB/SqLiteProvider.h. SQLiteCpp.h looks like it is a copy of a SQLite library header file. Could it be in conflict with something coming from the RHEL7 distribution? |
Maybe the problem is that we now linking I'm installing centos on VM. Will try to reinstall and get finally sim-recon working with this problem reproduced. |
But meanwhile could you just remove -lsqlite3 from the build and try? |
Just dropping the -lsqlite3 gives lots of errors like: .Linux_RHEL7-x86_64-gcc4.8.5/programs/Simulation/mcsmear/MyProcessor.o: In function so I guess the sqlite3 library is really needed. Could it be that rcdb/cpp/include/RCDB/SQLiteCpp.h is inconsistent with the sqlite3 library from RedHat7? |
Looks like we are using SQLiteCpp, no? Don't we have to build it as a library? If so, then how can RCDB be header only now? If we have to build it as a separate library, that would not kill me. |
No... It is my highly customized version. Look here: |
Making another attempt. Still getting the multiple definition of SQLite related objects reported back on December 12. Might there be a conflict with how CCDB pulls in SQLite? The multiple definitions could be because both CCDB and RCDB needed the same definitions, but doing them in different ways. Speculation admittedly. |
That is not it. I made programs with both RCDB and CCDB calls, that worked with sqlite in both cases. No problem. Now I am thinking that it may be the way RCDB/Connection.h is included. If it is in the global namespace of any of the objects, we are in trouble, no? |
Presently in Hall D we do not have a way to use the SQLite form of the RCDB database from C++. In particular our "mcsmear" programs queries the RCDB to determine conditions for smearing Monte Carlo events and that works fine with MySQL. When the RCDB_CONNECTION environment variable is set to point to an SQLite file, we get the error:
We are using RCDB version 0.02
Rebuilding RCDB with "with-sqlite=true" does not fix the problem; mcsmear must be compiled and linked with the
-DRCDB_SQLITE
compiler switch thrown when building mcsmear. In particular the fileincludes
RCDB/Connection.h
where the SQLite connection support is turned on. Trying to do this by hand (compilingmcsmear_config.cc
with-DRCDB_SQLITE
) we getand although there is a header file in the RCDB tree that defines sqlite3_int64,
gives
Any help appreciated.
The text was updated successfully, but these errors were encountered: