Thursday, June 14, 2012

Compile Boost with cxx flags

sh ./bootstrap.sh
sudo ./b2 install --build-type=complete --layout=tagged cxxflags=-fPIC

Switching GCC version

aptitude install gcc-4.4 g++-4.4
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.4 10
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.4 10

Saturday, June 9, 2012

Bug due to inherentance

1. Derived class call base class function A which call base class's other functions B
The program will go to derived class if B is reimplemented.

Debug MPI

For small number of processes

Valgrind
mpiexec -n 8 valgrind --log-file=valgrind-%p.txt <program and args>


Xterm+GDB
mpiexec -np 3 xterm -e gdb <program to debug without args>
in GDB r <args Here>