Archive for the ‘Software’ Category

To determine the version of matplotlib, you can either look in /usr/lib64/python26/site-packages for the matplotlib egg file (the version should be in the name of the file) or import the module in python itself.

[ ~]$ python
Python 2.6.6 (r266:84292, Aug 28 2012, 10:55:56) 
[GCC 4.4.6 20120305 (Red Hat 4.4.6-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import matplotlib
>>> matplotlib.__version__
'0.99.1.1'
>>> 

This is the default version get with RHEL6. To use a newer version of matplotlib, remove the python-matplotlib and seekwatcher packages. Download the latest matplotlib and install that.

[ matplotlib-1.2.0]# python setup.py build
[ matplotlib-1.2.0]# python setup.py install

The run the check again and you should see the newer version being loaded.

[ matplotlib-1.2.0]# python
Python 2.6.6 (r266:84292, Aug 28 2012, 10:55:56) 
[GCC 4.4.6 20120305 (Red Hat 4.4.6-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import matplotlib
>>> matplotlib.__version__
'1.2.0'

I was getting this error in my log files:

dovecot: IMAP(user): Time just moved backwards by 1 seconds. I'll sleep now until we're back in present.
http://wiki.dovecot.org/TimeMovedBackwards: 1 Time(s)

Looking at the website that was linked in the error message (very helpful), the solution was to edit /etc/ntp.conf and add the following:

# Added following to get rid of dovecot "Time moved backwards" error
tinker step 0

Restart ntpd and after two days the error stopped showing up in my logs. Yay!

The NVIDIA linux driver cannot be installed when the system is using the nouveau driver. The nouveau driver has been installed on all of the systems I’ve set up so far. To use the nvidia driver, do the following:

1. Edit /etc/grub.conf and add rdblacklist=nouveau vga=791 to the end of the kernel line.

2. yum remove xorg-x11-drv-nouveau

3. Edit /etc/inittab to change the runlevel to boot to from 5 to 3.

4. Create the file /etc/modprobe.d/blacklist-nouveau.conf and in it, put the following line:
blacklist nouveau

5. Reboot

6. Install the Nvidia driver and make sure to run the nvidia config in the last step.

7. Test it out by either rebooting or running init 5.

Install epel repo to download some needed packages:

http://mirror.chpc.utah.edu/pub/epel/6/i386/repoview/epel-release.html

Packages want to get from epel:

patchy
cernlib-2006
(will also get xbae)

From this website, download:

Manual
Makefile
isajet.car
isared.tar.gz

Unzip, but don’t untar the isared.tar.gz file.

The cernlib from the epel repo puts the files we are concerned about in /usr/lib64/cernlib/2006-g77/lib. However, it puts a version number on the libraries we want to use and this will cause an error in our Makefile. So, in /usr/lib64/cernlib/2006-g77/lib, make the following links:

ln -s libpacklib.so.1 libpacklib.so
ln -s libpdflib804.so.2 libpdflib804.so
ln -s libmathlib.so.2 libmathlib.so
ln -s libkernlib.so.1 libkernlib.so

Next, edit the Makefile with our info. Here is what the one I used looked like:

#       Do not change this -- you will break everything.
SHELL = /bin/csh

########## Installation parameters #####################################

#       Some versions of make (e.g. Linux) treat inconsequential warnings
# as errors and stop. Ignore all errors; comment out if possible:
##.IGNORE:

#       Name for temporary subdirectory. This will be deleted and 
# recreated:
MAKETMP = ./MakeTmpDir

#       Link with CERN libraries. This is recommended for HP, IBMRT, or 
# LINUX to get date and time information but is not required:
##CERN = NOCERN
CERN = CERN

#       Directories for Cernlib, terminated with a /. These must be set
# if you select CERN or PDFLIB:
CERNDIR = /usr/lib64/cernlib/
CERNBIN = $(CERNDIR)/bin/
CERNLIB = $(CERNDIR)lib/
CERNLIB2 = $(CERNDIR)2006-g77/lib/

#       PDFLIB support. PDFLIB (part of the CERN library) contains many
# partion distributions but produces a larger executable image:
PDFLIB =
#PDFLIB = PDFLIB

#       RANLUX support. RANLUX provides better random numbers than the
# standard RANF, and each seed gives an independent sequence. It is
# more difficult to restart and slightly slower.
RANLUX = RANLUX
#RANLUX = NORANLUX

#       Computer type. Most only differ in minor ways, e.g., the system
# clock interface. Uncomment the right one:
# ANSI          ANSI Fortran
# DECS          DECStation with Ultrix
# HPUX          HP/700 with HPUX
# IBMRT         IBM RS/6000 with AIX
# LINUX         PC with LINUX and f2c/gcc or g77 or Absoft f77
# OSF           Digital OSF on Alpha processor
# SGI           Silicon Graphics with IRIX
# SUN           Sparc or PC with Solaris
#MACHINE = ANSI
#MACHINE = DECS
#MACHINE = HPUX
#MACHINE = IBMRT
MACHINE = LINUX
#MACHINE = OSF
#MACHINE = SGI
#MACHINE = SUN

#       Fortran 77 compiler.
#F77 = f77
#       For HPUX; note that f77 on HPUX is brain dead. fort77 is also an
# alternate f2c/gcc interface on Linux:
#F77 = fort77
#       GNU Fortran compiler
#F77 = g77
F77 = /usr/bin/g77

#       Fortran compile flags: Want -c, highest safe optimization, all
# variables static, and postpended underscore for Cernlib compatibility.
# Uncomment the right one or make your own:
#       DECS
#FFLAGS = -c -O -static -w
#       HPUX, -O is broken
#FFLAGS = -c -O2 -K +ppu -w
#       IBMRT
#FFLAGS = -c -O -qextname -w
#       LINUX with f2c/gcc or g77. The -fno-silent displays progress...
FFLAGS = -c -O -fno-automatic -fno-silent
#       LINUX  with Absoft Fortran
#FFLAGS = -c -O -w -f -s
#       OSF
#FFLAGS= -c -O -w
#       SGI
#FFLAGS = -c -O -static -w
#       SUN - the second option traps floating errors
#FFLAGS = -c -O -w
#FFLAGS = -c -O -w -fnonstd -ftrap=common

#       Use fsplit or CERN's fcasplit to split the whole Fortran source into
# individual subroutines:
#FSPLIT = $(CERNBIN)fcasplit
#FSPLIT = fsplit
FSPLIT = /usr/bin/fcasplit

#       Link command for Fortran, c.f. $(F77):
#LINK = f77
#LINK = fort77
#LINK = g77
LINK = $(F77)

#       Extra libraries (e.g. Cernlib) and flags for link. If you want 
# PDFLIB support, you must also define $(PDFLIB) above. The Zebra
# version requires libpacklib.a.
#LFLAGS =
#LFLAGS = -L$(CERNLIB) -lmathlib -lkernlib
#LFLAGS = -L$(CERNLIB) -lpdflib804 -lmathlib -lkernlib
LFLAGS = -L$(CERNLIB) -L$(CERNLIB2) -lpdflib804 -lpacklib -lmathlib -lkernlib

#       Ranlib command if required (it is for Sun 4.x and Linux):
RANLIB = ranlib
#RANLIB = $(ECHO)

#       Name for this Makefile:
MAKEFILE = Makefile

#       Patchy commands. YPATCHY can be either ypatchy or nypatchy,
# perhaps with a full path. A temporary cradle file YCRADLE is required;
# it is deleted and recreated:
#YPATCHY = $(CERNBIN)ypatchy
#YPATCHY = $(CERNBIN)nypatchy
YCRADLE = ./tmpcradle.cra
YPATCHY = /usr/bin/nypatchy

#       Echo command. /bin/echo works on most (all?) systems; plain echo
# fails on AIX 4.1:
ECHO = /bin/echo

#       Remove command:
RM = /bin/rm

#       Parameters to use ISATOOLS and ISAFLAVR. Note ISAFLAVR does not
# create a separate library.

ISATOOLS = ISATOOLS
#ISATOOLS =

LIBTOOLS = -lisared
#LIBTOOLS =

ISAFLAVR = ISAFLAVR
#ISAFLAVR =

########## End of installation parameters ##############################

Next make isatools.

[root@higgs isajet]# make isatools

Takes a while to run. This creates the file libisared.a.

Next run make.

[root@higgs isajet]# make

This should produce the following executables: isajet.x, isasusy.x and isasugra.x. You can run make clean to get rid of the temporary files.

After starting ROOT, need to check that it can make plot windows. In root, run this command to open up a new window.

root [0] TCanvas c

If on starting matlab, you get this error:

terminate called after throwing an instance of 'std::runtime_error'
  what():  locale::facet::_S_create_c_locale name not valid

Set this environment variable.

$ export LC_ALL="en_US.utf8"

Matlab should then start ok.

A student wanted the latest version of ROOT added to the ups database. The software was already installed in /cdf/code/cdfsoft/root, but didn’t show up with ups list -a root. To fix this, I became the owner of all our cdf software and ran the following command:

ups declare root v_5_22_00j -r root/v5_22_00j-GCC_3_4_6/Linux+2.6 -f Linux+2 -z /cdf/code/cdfsoft/products/upsdb -m root.table -q GCC_3_4_6

It took a few times to get this correct. If you make a mistake you can run the undeclare command, or even easier, just delete the file in /cdf/code/cdfsoft/products/upsdb/root/v_5_22_00j and then run the declare command again.

All the software is installed in /cdf/code/cdfsoft/products. Then look in root/v5_22_00j-GCC_3_4_6 to find that version. The important bit for ups is the table file, which in this case is in /cdf/code/cdfsoft/products/root/v5_22_00j-GCC_3_4_6/Linux+2.6/ups/root.table.

[/ups]$ more root.table 
File    = table
Product = root

Group:

  Flavor     = ANY
  Qualifiers = "GCC_3_4_6"

  Flavor     = ANY
  Qualifiers = "GCC_3_4_6:debug"

  Flavor     = ANY
  Qualifiers = "64bit:GCC_3_4_6"

  Flavor     = ANY
  Qualifiers = "64bit:GCC_3_4_6:debug"

Common:
  Action = setup
    setupEnv()
    prodDir()
    envSet(ROOTSYS,${UPS_PROD_DIR});
    envPrepend(LD_LIBRARY_PATH,${ROOTSYS}/lib)
    envPrepend(PYTHONPATH,${ROOTSYS}/lib)
    pathPrepend(PATH,${ROOTSYS}/bin)
End:

This is the file that lists the flavor and qualifiers that must be used when declaring the version.

Whenever the xemacs package is installed, also be sure to install xemacs-packages-extra. This sets up things like syntax-highlighting and other stuff that people put in their init files.

Error message looked like this:

[~]# yum -y upgrade
Loaded plugins: rhnplugin, security
rpmdb: PANIC: fatal region error detected; run recovery
error: db4 error(-30977) from dbenv->open: DB_RUNRECOVERY: Fatal error, run database recovery
error: cannot open Packages index using db3 -  (-30977)
error: cannot open Packages database in /var/lib/rpm

Fix:

[ ~]# rm /var/lib/rpm/__db*
[ ~]# rpm -rebuilddb
[ ~]# yum clean all

Download source and run ./configure. Settings of my last compilation:

./configure linuxx8664gcc --prefix=/code/root_v5.30.00_rhel5_x64

Be sure the following are installed:
libX11-devel
libXpm-devel
libXft-devel
libXext-devel

After make install, add the library to /etc/ld.so.conf and run ldconfig -v. Here is what my /etc/ld.so.conf file contains:

include ld.so.conf.d/*.conf
/code/root_v5.30.00_rhel5_x64/lib/root

To run, set:

export ROOTSYS=/code/root_v5.30.00_rhel5_x64
export PATH=$ROOTSYS/bin:$PATH