Sep 25, 2013

Error while loading shared libraries "libiomp5.so"

OS: Ubuntu 13.04 (Linux kernel 3.8) 
Compiler: Intel Composer XE 2013 SP1 

I finally build the ARP benchmark from NU-MineBench.
When I try to run it, however, it shows
Error while loading shared libraries "libiomp5.so"
This is because an environment variable called LD_LIBRARY_PATH is not correctly configured.
This can be solved by typing
source /opt/intel/bin/compilervars.sh intel64
You can make this automatically configured by adding this line into your bashrc file.

References:
http://software.intel.com/en-us/forums/topic/387540

Picture today: A summer night at Chincoteague island 
[courtesy of my dear wife - Claire Huang]


Aug 23, 2013

Compiling problem: XXX.c:##:##: fatal error: XXX/XXX/XXX.h: No such file or directory



When you download a source package and try to build the program from the source code, chances are that the README file can not list all prerequisite for you. As a result, for example, you will see something like this:

glut_input.c:22:35: fatal error: X11/extensions/XInput.h: No such file or directory

On a Ubuntu/Debian system, you can use apt-file to solve this problem. For example, you can type:
apt-file search X11/extensions/XInput.h
Then, it will show you
libxi-dev: /usr/include/X11/extensions/XInput.h
Good. Now you can type
apt-get install libxi-dev
to install the missing package and then keep building your program.

On a Redhat/CentOS system, you can use
yum whatprovides "X11/extensions/XInput.h"
to locate the missing package. Then you can move on.

Picture today:
Deep Creek lake. MD. [courtesy of my dear wife - Claire Huang]

Aug 19, 2013

KVM: How to find a guest VM's process ID (PID)

There are two ways to find VCPUs' PID.

Suppose the testing VM is named GUEST_X and it has 4 VCPUs.

Method A: 
If you are using libvirt to manage VMs.
You can type:

sudo grep pid /var/run/libvirt/qemu/GUEST_X.xml 

Then, you will see VCPUs' PID like this:
<domstatus state='running' reason='booted' pid='6556' >
<vcpu pid='6558'/ >
<vcpu pid='6559'/ >
<vcpu pid='6560'/ >
<vcpu pid='6561'/ >

Method B:
Alternatively, you can find the guest's main PID in user space by typing this:
ps aux | grep GUEST_X 
You will see something like this:
root     6556 0.1  0.0 136560  3472 ?        Sl   20:49   0:02 /usr/bin/kvm ...GUEST_X....(a long list of parameters)
Then, you can use ls to check the directories in
/proc/6556/task/
You will see directories like this
/proc/6556/task/6556/
/proc/6556/task/6558/
/proc/6556/task/6559/
/proc/6556/task/6560/
/proc/6556/task/6561/
where 6558~6561 are PIDs of this guest's VCPUs.


Ending picture today:
Niagara Falls view [courtesy of my dear wife - Claire Huang]

Mar 24, 2013

Error: Boot loader didn’t return any data

I have a Ubuntu 12.04 guest VM. Host machine is running Ubuntu 12.04 with Xen 4.1.

After installing a new kernel in guest VM and reboot. I got
Error: Boot loader didn’t return any data
After googling this, I found this pygrub seems have problems in parsing certain grub2 format.
I could not find any patches to fix this. Instead, I found some people workaround this problem by using grub, not grub2. Therefore, I follow the procedure in this post to replace grub2 with grub.
http://ubuntuforums.org/showthread.php?t=1330347

Problem solved!

References:
http://0x23.de/2012/05/xen-ubuntu-12-04-upgrade-boot-loader-didnt-return-any-data/
http://marcin.juszkiewicz.com.pl/2011/09/08/error-boot-loader-didnt-return-any-data/


Mar 11, 2013

Ubuntu12.04 libvirt virbr0 network bridge setup

Offical Ubuntu website provides a very good and thorough guide for installing Xen in Ubuntu.

But, I personally prefer libvirt for managing network bridges, not changing network configuration as stated in the official website. So, I install libvirt:
sudo apt-get install libvirt0
Then type