ESG publishing tool: Mac OS X 10.5 installation notes
6/25/08
[Important! These instructions are for the pre-alpha version of esg_publish]
Summary
To install the ESG publication tools:
Check system requirements
Install CDAT/CDMS (Python)
Install the MySQL relational database
Install additional Python packages
Set the environment
Initialize the database
System requirements
- The publisher GUI requires the Xcode Tools.
- The subversion client is required to checkout development versions of CDAT and the ESG publishing tools.
Directories:
<CDAT_WORK>: CDAT source directory
<CDAT_PREFIX>: CDAT installation directory prefix.
<CDAT_INSTALL>: CDAT installation directory. This will be <CDAT_PREFIX>/<CDAT_VERSION>
<CDAT_EXT_INSTALL>: CDAT externals. This will be <CDAT_PREFIX>/Externals
<ESGCET_WORK>: Esgcet source directory
<MYSQL_INSTALL>: MySQL installation directory
Install CDAT/CDMS
- Download the latest CDAT release, V5.0 or greater
[Note: as of current writing, this can be obtained from the CDAT devel branch of the PCMDI repository.] - Extract or checkout the CDAT release:
% svn checkout PCMDI_REPOSITORY/cdat/branches/devel <CDAT_WORK>
- Download the latest Esgcet release.
[Note: as of current writing, this can be obtained from the Esgcet/trunk directory of the PCMDI repository.] - Extract or checkout the Esgcet release into <ESGCET_WORK>
% svn checkout PCMDI_REPOSITORY/Esgcet/trunk/esgcet <ESGCET_WORK>
- See the Mac OS X installation notes. In particular (csh):
% setenv CPPFLAGS "-DSETPGRP_HAVE_ARG"
- Configure CDAT for CDMS-only installation:
% ./configure --prefix=<CDAT_PREFIX> --enable-cdms-only % make
- Add <CDAT_INSTALL>/bin to your path
Add <CDAT_EXT_INSTALL>/NetCDF/bin to your path
For example (csh):
% set path = (<CDAT_INSTALL>/bin <CDAT_EXT_INSTALL>/NetCDF/bin $path)
- Install additional CDAT packages:
% cd <CDAT_WORK>/exsrc; mkdir build % Pmw.sh <CDAT_PREFIX> % cd <CDAT_WORK>/Packages/gui_support % python setup.py --verbose install
Install the MySQL relational database
- Obtain Mac OS X binaries for your OS and architecture for version 5.0 or greater.
- Unpack in <MYSQL_INSTALL>
- Add a link to the MySQL directory:
% ln -s <MYSQL_INSTALL> mysql
- Follow the instructions in <MYSQL_INSTALL>/INSTALL_BINARY:
[Note: Mac OS X 10.5 comes with the mysql user and group defined.]
% cd <MYSQL_INSTALL> % chown -R mysql . % chgrp -R mysql . % scripts/mysql_install_db --user=mysql
Important: Follow the instructions for setting the MySQL root password!
% chown -R root . % chown -R mysql data
To start the server:
% bin/mysqld_safe --user=mysql &
- Add <MYSQL_INSTALL>/bin to your path
Install additional Python packages
- Download ez_setup.py
- Install MySQL-python:
- download the source code tar file MySQL-python-1.2.2.tar.gz, untar it, and cd to MySQL-python-1.2.2 .
- [Mac OS X 10.5: there is a bug in mysql-python that causes a compilation error: /usr/include/sys/types.h:92: error: duplicate 'unsigned'.
To correct the error, in file _mysql.c replace the lines
#ifndef uint
#define uint unsigned int
#endif
with:
typedef unsigned int uint;
- Build and install:
% python setup.py --verbose build % python setup.py --verbose install
- Install SQLAlchemy:
% easy_install SQLAlchemy
- Install lxml:
% easy_install lxml
- Install Esgcet:
% cd <ESGCET_WORK> % python setup.py --verbose develop
Set the environment
csh:
% setenv DYLD_LIBRARY_PATH <CDAT_EXT_INSTALL>/lib
[Note: for non-Mac OS systems the variable is LD_LIBRARY_PATH]
Initialize the database
Create the database and esgcet user
- Login to MySQL as the (MySQL root user):
% mysql -u root -p
- Create the database:
mysql> create database esgcet;
- Add user esgcet:
mysql> grant all on esgcet.* to esgcet identified by 'ESGCET_PASSWORD'; mysql> grant all on esgcet.* to esgcet@localhost identified by 'ESGCET_PASSWORD'; mysql> flush privileges;
- Log out of MySQL:
mysql> exit
Create the publisher initialization file
% cd <ESGCET_WORK>/esgcet/config/etc % cp template.ini esg.ini
- Edit esg.ini. In the [DEFAULT] section, add the line:
dburl = mysql://esgcet:ESGCET_PASSWORD@localhost:3306/esgcet
where ESGCET_PASSWORD is the MySQL password for user esgcet
Initialize the database tables
% esginitialize -c