[ Solved ] DB->get: method not permitted before handle’s open method

Was writing a very simple program on BerkeleyDB as below

#include < db.h >

int main(int argc, char *argv[]) {

DB *dbp = NULL;

int ret = 0;

ret = db_create(&dbp, NULL, 0)

ret = dbp->open(dbp, NULL, “my_db.db”, NULL, DB_TREE, DB_CREATE, 0);

if (dbp != NUL ) {

    dbp->close(dbp, 0);

}

} /* end of main */

Compiled the program with following command

$ gcc -g -I/usr/local/BerkeleyDB.6.1/include -L/usr/local/BerkeleyDB.6.1/lib  test.c -ldb

When I executed the program , following error cropped up.

DB->get: method not permitted before handle’s open method

I was trying to use BerkeleyDB-6.1. But when I checked , to which library , the executable got linked to – I saw this.

             $ ldd a.out
               linux-vdso.so.1 =>  (0x00007ffff5dff000)
               libdb-4.7.so => /lib64/libdb-4.7.so (0x000000308ce00000)
               libc.so.6 => /lib64/libc.so.6 (0x0000003079600000)
               libpthread.so.0 => /lib64/libpthread.so.0 (0x000000307a200000)
               /lib64/ld-linux-x86-64.so.2 (0x0000003079200000)

As we can see , libdb-4.7 got linked with the executable. Then I realized , this is an error related to incorrect linking to different version of BerkeleyDB library on system. This may happen to systems ,  with multiple BerkeleyDB installed.

[ Solution ]

 1. First set up LD_LIBRARY_PATH  as bellow , before compiling the BerkeleyDB Program.

$ export LD_LIBRARY_PATH=/usr/local/BerkeleyDB.6.1/lib:$LD_LIBRARY_PATH

 2. Do compile the code from same shell

$ gcc -g -I/usr/local/BerkeleyDB.6.1/include -L/usr/local/BerkeleyDB.6.1/lib  test.c -ldb

3. Execute

The error will not crop up ever again. Hope this will be a direct help to someone. Cheers

😀

Tagged with: , , , , , , , , , , , , , ,
Posted in computer, debug, troubleshoot

32bit libstdc++.so not found on 64bit CentOS 6.3 system

The GNU Standard c++ library libstdc++.so.5 is a core library for CentOS system. Most of the operating systems comes with a version of libstdc++ in sync with architecture ( i.e., 32 bit or 64 bit system ) of OS. That is 64 bit OS have 64 bit libstdc++.

However to install various other tools and compiler like intel compiler, on a 64 bit system, we require to have 32 bit compatible version of libstdc++ as well. Otherwise the installation will fail.
To get around this problem, download compat-libstdc++ for your os and install. This will install 32 bit compatible version of libstdc++ on 64 bit system.

On CentOS 6.3

1. download compat-libstdc++ from here

2. install

$ yum  install  compat-libstdc++-33-3.2.3-69.el6.i686.rpm

3. done

Find 32 bit libstdc++ at /usr/lib/  on CentOS
Find 64 bit libstdc++ at /usr/lib64/  on Cent OS

Use below command to ensure which one is 32 bit and which one is 64 bit.

$ readelf -h /usr/lib64/libstdc++.so.5
Tagged with: , , , ,
Posted in install, Passion, troubleshoot

[Solved ] Realtek Ethernet Network Device Not Recognized on Linux 2.6.x and 3.x

Here is another post in [Solved] category . I believe the proposed solution will work on all flavor  of Linux system. But I have encountered the “Problem” and found “Solution” on OpenSuse – 12.1.

After installation of OS , I was shocked to see that the Realtek ethernet device is not  recognized by OS. I suspected that , probably the required driver is not installed/available with OS. So I followed the below explained steps and hit the solution. You must be logged in into the system with root credential to do this exercise.

  • Make ifconfig eth0 up.

To know the device name we can see the hardware detail of system OR  make eth0 device up by below command.

$ ifconfig  eth0 up

  • Check device name.

open the file with “vi /etc/sysconfig/network/ifcfg-eth0”. In this file device name will be listed as bellow   “NAME=’RTL8101E/RTL8102E PCI Express Fast Ethernet controller’

  • Find Driver for Ethernet Controller.

The above step gives me enough clue that,  I need to search for driver of Realtek ethernet controller. Which leads me to the below link.

Download Realtek Ethernet Controller Driver : click here

  • Downloaded driver.

Download the tar.bz file and unzip.

  • Run autorun.sh

Go inside the unzipped folder and we shall find file – named “autorun.sh”. Execute the shell file with below command.

$sh autorun.sh

  • Reboot your system.

This should make your system’s ethernet device up and running
😀

Tagged with: , , , , , , , , , , ,
Posted in computer, debug, troubleshoot

cannot find -lXmu : nVIDIA CUDA SDK compilation problem on CentOS 6 solved

While trying to compile nVIDIA Cuda SDK sample codes on CentOS 6-x86-64 bit system , it gave following compilation error.

imageDenoisingGL.cpp: In function ‘void runAutoTest(int, char**)’:
imageDenoisingGL.cpp:627: warning: unused variable ‘devID’
/usr/bin/ld: cannot find -lXmu
collect2: ld returned 1 exit status
make[2]: *** [../../bin/linux/release/imageDenoising] Error 1
make[2]: Leaving directory `/usr/local/NVIDIA_GPU_Computing_SDK/C/src/imageDenoising’

 

From the error itself , it is clear that the compiler is not able to locate the libXmu.so . I found the related library file in /usr/lib64 folder with different name ( libXmu.so.6.2.0 and libXmu.so.6.2 ).

I made a symbolic link with following command at /usr/lib64 and it seems that solved the issue.

$ ln -s libXmu.so libXmu.so.6.2.0

Tagged with: , , , , , , ,
Posted in computer, debug, GPGPU, install, Passion, Science, troubleshoot, Uncategorized

cannot enable executable stack as shared object requires: Permission denied

Once you find error while executing any package on a system like “cannot enable executable stack as shared object requires: Permission denied” , it is probably because of SELinux is enforced/enabled on your system.
Solution :
1. Open file /etc/selinux/config
2. change “SELINUX=enforcing” to “SELINUX=disabled”
3. Reboot

if you want to disable SELinux temporarily then just execute bellow command
$ setenforce 0

Tagged with: , , , , , , ,
Posted in Uncategorized

TAU Installation issue : Profiler.cpp : error : solved

TAU( Tuning Analysis Utilities) a profiling and tracing toolkit for performance analysis of parallel programs written in Fortran, C, C++, Java, Python. TAU is also enabled for nvidia cuda application.

While installing TAU,  I got following error –
“Profiler.cpp : 1163 : error : i was not declared in this scope. “

This is a simple bug in source file  of TAU-2.20 package. Please follow the steps bellow to solve the issue.

1) go to directory tau-2.20.1/src/Profile

2) open file Profiler.cpp

3) go to line no : 1163

change   “ for ( i =1; i < TAU_MAX_THREADS; i++)”

as   “for (int i =1; i < TAU_MAX_THREADS; i++)”

4) done  😀

Tagged with: , , , , , , , , ,
Posted in computer, debug, GPGPU, install, Passion, Science, troubleshoot

WBSE Result – 2011

WBSE Result – 2011  Published  : direct link  :  http://wbresults.nic.in/madhyamik11/wbmpres.htm

West Bengal Board of Secondary Education [ WBSE ] ‘s Madhyamic Examination result is going to be published today[ 27-05-2011 at 11 am. To see your result first, keep an eye on following two link

http://wbresults.nic.in/
http://results.nic.in/index.aspx

Good luck to all, who appeared for this exam – all the best.

Want to read this blog in Bangla / Bengali – click here

Tagged with: , , , , , , , , , , , ,
Posted in Uncategorized