Installing PETSc and libMesh on CentOS 5
Prerequisites: boost-devel, openmpi-devel, valgrind-devel I installed PETSc and libMesh in my user directory, since I have a single-user workstation.
Installing PETSc for use with libMesh
First, ensure that OpenMPI is installed and the system paths have been configured correctly. You will need to add the directory containing OpenMPI binaries to your $PATH, and the directory containing OpenMPI libraries to $LD_LIBRARY_PATH. CentOS does not do this automatically! Type mpicc on the command line to make sure the shell can find the binary. If mpicc and mpif77 run, then you should not need to use the comnand-line flags to the configure script for PETSc. If you are going to use libMesh with PETSc, you need to enable C++ with a command-line option to the configure script. Here is the process I used (it might be a good idea to set PETSC_ARCH and PETSC_DIR in your .bashrc so they are consistent for all builds).
Paraview 3.12 on 64-bit CentOS 5.7
I finally got around to installing Paraview on my CentOS 5 box. There are no official RPMS for CentOS 5, so I was expecting a painful build process. To my great surprise, I was able to download the Paraview binary for Linux (64-bit) from Kitware, unpack the archive, and run it! As root, I placed the entire ParaView-3.12.0 directory under /opt/Paraview. You could also keep it in your home directory if you are running a single-user system. I added /opt/Paraview/ParaView-3.12.0/bin to the $PATH in the .bashrc file in my home directory. Now I can type paraview at the command line and it runs! What if you want Paraview to appear in the Applications menu in your desktop environment? Most modern desktops (I use XFCE4) construct the Applications menu “on the fly” based upon the files in a standard directory (/usr/share/applications on CentOS). The Free Desktop Project has created a standard for desktop entry files. You may also find this summary of the standard to be helpful. To add Paraview to the menu, you simply need to create a new file in the standard location. If you installed Paraview in your user directory, you may want to place the desktop file in $HOME/.local/applications. Here are the contents of a file I called paraview.desktop:
Installing Sage 4.7 on CentOS 5
I recently upgraded my desktop workstation from an old 32-bit version of Gentoo to 64-bit CentOS 5. I downloaded and installed the latest version of Sage, and the process went smoothly. If you find this post helpful, please check out the Sage Beginner’s Guide at Packt Publishing. Since I don’t use Sage every day, I actually refer to my own book on a regular basis!
Download
Since CentOS is designed to be binary compatible with Red Hat Enterprise Linux, the correct binary to download is sage-4.7.2-linux-64bit-red_hat_enterprise_linux_server_release_5.6_tikanga-x86_64-Linux.tar.gz
Linux kernel 3.1 config for Gentoo guest on VMWare Fusion
The following kernel configuration was posted by Alessandro Di Marco as a comment on a previous post in which I provided a Linux kernel config for an earlier version of the kernel. In the interest of sharing his contribution, I’m placing it in its own post. I don’t know the author personally and I have not tried this config. Like any other free software, you are using it at your own risk and neither Alessandro nor I provide any warranty. Download the file from the link below, change the file extension from .txt. to .config and load the config into one of the standard kernel configuration tools (such as make menuconfig) and look over all the options before using it. Gentoo Kernel 3.1 Config
How to build ScipPy with Python 2.7.2 on CentOS5
EDIT: added –enable-shared to configure script for building Python, and added /home/yourname/lib to shared library path. This is necessary for building some packages such as pycairo (which you may need to build pygtk and matplotlib). EDIT 2: you should use the –prefix=/home/yourusername instead of –user. The prefix option places packages in the standard location: /home/yourusername/lib/python2.7/site-packages. The –user option places the packages in /home/yourusername/.local/lib/python2.7/site-packages which I think is screwed up! I use CentoOS5 because I want enterprise-class stability, as well as binary compatibility with a commercial application that is built for RHEL5. I need to use some “bleeding edge” packages, such as the latest version of SciPy, but I don’t want to affect the base stability of the system. Here is how I did it. First, with superuser privileges, use yum to install the following packages. You may need to set up epel as an alternate repository:
Replacing text in place with GNU sed
sed is a stream editor, which means that it accepts a stream of text, processes it, and spits out another stream of text. sed can process files that are too large to load into memory, and it is a completely command-line tool that can easily be integrated into shell scripts. This excellent sed tutorial was written for an old version of sed provided by Sun Microsystems, and it doesn’t cover one of the most useful features of GNU sed. GNU sed accepts a -icommand line argument that tells sed to replace the text file in place, rather than writing the output stream to another file. Another nice feature is thatsed -i will create a backup file before processing if you provide a backup suffix:
Building and linking to a shared Fortran library
I’m using GNU Fortran (gfortran) to build several shared libraries, and then dynamically linking to them from a Fortran program. The process is a little different than what I’m used to for C libraries, so I thought I’d explain it. Unlike C, there is no need to #include header files when compiling code that relies on functions defined in an external library. Likewise, there is no need to use -l or -L linking flags to tell the linker about s hared libraries (at least when they’re in the same directory). In fact, the whole process requires a lot less command-line options than I had expected.
X.org configuration for a Gentoo guest on VMWare Fusion
Here is an xorg.conf for a Gentoo guest running in VMWare Fusion on MacOS 10.6 (Snow Leopard). It’s surprisingly simple to set up X when the hardware is fake ;) Gentoo runs great on a Macbook Pro 13". I was concerned at first about the lack of 3D acceleration, but I tried a few 3D applications and found the performance to be acceptable. Blender ran really smoothly with a simple model (once I found out that command-click is equivalent to middle click). Rotating a field of several hundred spheres in Paraview was a little slow, but still very acceptable. I also bought a Logitech wireless mouse, and found that the middle button works just as you’d expect (paste) in Gentoo running in Fusion. I didn’t have to install the Logitech drivers in OS X.
Kernel configuration for a Gentoo guest in VMWare Fusion
I recently installed Gentoo Linux (amd64) as a guest on my Mac (OS 10.6 Snow Leopard) using VMWare Fusion. I thought I’d post the kernel config that I am using, since I didn’t find any out there that I trusted. If you can use this as a starting point, then it should save you some time and trouble. It’s a pretty minimal configuration–I think I removed all the extra drivers and stuff. You could lean it out a little more by removing the audio and a few other extras that I thought I might use. Let me know if you have any trouble with it. Gentoo amd64 kernel config for VMWare Fusion So far I am very pleased with its performance. My only disappointment is that VMWare doesn’t support Linux graphics hardware acceleration.