One must have CCDB_HOME variable pointitng to the root of CCDB package. You can run script located at root of CCDB:
##RUN CODE:
source environment.bash
The script will determine it's path and set all needed directories to run and link ccdb.
Or you can setup environment manually
##CODE FOR .bashrc:
#set CCDB environment
export CCDB_HOME=/path/to/ccdb/home/directory
export LD_LIBRARY_PATH="$CCDB_HOME/lib":$LD_LIBRARY_PATH
export PYTHONPATH="$CCDB_HOME/python":$PYTHONPATH
export PATH="$CCDB_HOME/bin":$
make ccdb library for your system. There two options of building CCDB:
- With SQLite and MySQL support (default)
- With SQLite support only.
Since MySql is supposed to be a main central database, MySQL+SQLite is used by default. However compiling SQLite only version, doesn't require any dependencies except pthread.
- To compile CCDB by default:
##RUN CODE:
cd $CCDB_HOME
scons
- To compile CCDB with no MySQL dependencies and SQLite support only
##RUN CODE:
cd $CCDB_HOME
scons mysql=no
- To compile with clang, one can use 'clang=yes' flag
##RUN CODE: cd $CCDB_HOME scons clang=yes
(!) SKIP this step if you are NOT going to install and develop MySQL CCDB database on Your computer.
(!) One should definately skip this step if one compiled CCDB with only SQLite support
If You would like to install database on the local machine, you need to create a database (by default it is ment to be called ccdb). mysql script $CCDB_HOME/sql/ccdb.mysql.sql generates schema for you. MySQL-Workbench project with mysql schema is located in the same directory.
##RUN CODE:
mysql -u root -p <$CCDB_HOME/sql/ccdb.mysql.sql
By default CCDB tries to connect by using 'ccdb_user' user name with no password So one might whant to create such user.
To create the user for development purposes use sql command like this
##RUN CODE:
mysql -u root -p
CREATE USER 'ccdb_user'@'localhost';
GRANT ALL PRIVILEGES ON ccdb.* TO 'ccdb_user'@'localhost';
exit;
Adjust mysql configuration max_allowed_packet for bigger value i.e 32M in order
to be able to get large data tables from the CCDB, set
max_allowed_packet=32M
to [mysqld] section of /etc/my.cnf
if you don't have /etc/my.cnf in your system yet, create one and add [mysqld] in the beginning.
To test the CCDB installed correctly one might run CCDB unit tests
##RUN CODE:
. $CCDB_HOME/bin/test_ccdb_lib
. $CCDB_HOME/bin/test_ccdb_python
You should see ccdb unit test running and successfully complete.
To test python is working you may run ccdbcmd
#RUN CODE:
ccdb -i
interactive ccdb shell should be started
In order to log changes it is HIGHLY desirable to let CCDB know yout CUE user name. If your CUE user is not the same as $USER variable, please define CCDB_USER environment variable as your CUE username.
##INCERT INTO .bashrc:
export CCDB_USER=<your CUE login>
Instructions of building website is in $CCDB_HOME/web/install.txt
The packages needed to compile CCDB for Fedora: (Tested on Fedora 14, Fedora 15, RHEL 6)
##RUN CODE:
yum install scons mysql-server mysql-devel python-devel
If you haven't configured mysql server:
##RUN CODE:
service mysqld start
mysqladmin -u root -h password 'your-password'
The packages needed to compile CCDB for Ubuntu: (tested on ubuntu 11.10, mint 12)
##RUN CODE: apt-get install mysql-server scons libmysqlclient-dev
Any questions, suggestions or discussions:
Dmitry romanov JLab id: romanov 757-269-6931