Example: PLPLOT tar, BSU rpm

At the time of this writing, the PLPLOT libraries are not well represented in the RPM packaging effort (APT packaging is quite good by contrast). Installing PLPLOT on Redhat Enterprise Linux is a good example. Developing a SPEC file for PLPLOT with all the various sub-packages is a big job, and so unpacking in the /usr/local tree is quite attractive. I did this with the plplot-5.10.0.tar.gz TAR archive. PLPLOT uses cmake rather than configure. To build plplot libraries, untar plplot-5.10.0.tar.gz in the /usr/local/src directory. The following is the sequence of commands:


{configlist}
cd /usr/local/src/plplot-5.10.0
mkdir build_dir
export CC="gcc -O2"
export CXX="g++ -O2"
export FC="gfortran -O2"
cd build_dir
cmake -DCMAKE_INSTALL_PREFIX=/usr/lib64 ../ >& cmake.out

make >& make.out
sudo make install >& make_install.out
configlist



The X11 driver requires that the libX11-devel RPM package be installed. Failing to install needed *-devel.rpm packages is likely to result in a driver not being built.

In this example, the installed libraries are located in /usr/lib64. If you put the libraries somewhere else like /usr/local/lib then they may not be found when needed. For example, if /usr/local/lib is not already in /etc/ld.so.conf, you should add it, and then execute


sudo ldconfig -v



to make the system aware of the new libraries. If you intend to install BSU as an RPM, it is likely that the next problem will be that RPM will not be aware of these libraries, and can block the install of the package. That is, even though these libraries have been installed under /usr/local/lib and the system is aware of it, the RPM data base is not aware of it, and so blocks the install. The solution is to use the -nodeps option:


rpm -ihv bsu-3.0.2+plplot-1.x86_64.rpm -nodeps


This overrides the RPM data base, and permits the install. At object time, the programs requiring the PLPLOT libraries will be able to find them, and all will be well. Of course, these types of problems are avoided when building BSU from a source tarball, or from installing Plplot libraries in standard locations.