Setting up VLFeat with the Eclipse IDE on Ubuntu

  There didn’t seem to be any how-to on setting up VLFeat to work with a C/C++ IDE on linux that Googling threw up. After spending the better part of an hour (with multiple breaks for hair-tearing and ‘linux, Y U SO CRAZY’) trying to get things to work, it is fitting to put in the steps for future use, which turned out to be surprisingly simple but undocumented in a single place (especially when I forget and have to install it on a new system).

 

 Step 1

Download and unpack the VLFeat binary for linux. From now on, as given in the site, the location of the folder is referred to as VLFEATROOT.

 For having shell support, I followed the instructions in their website and added the following lines to the end of my .bashrc file. 

export PATH=VLFEATROOT/bin/glnx86:$PATH
export MANPATH=VLFEATROOT/src:$MANPATH
export LD_LIBRARY_PATH=VLFEATROOT/bin/glnx86:$LD_LIBRARY_PATH

Step 2:

Create a new C/C++ project in Eclipse and put in the following lines of code:

extern "C" {
#include <vl/generic.h>
} int main (int argc, const char * argv[]) {
VL_PRINT ("Hello world!") ;
return 0;
}

Step 3:

Make the following changes:

 Project -> Properties -> C/C++ Build 

Under the GCC C++ Compiler->Directories head, include the path VLFEATROOT (the -I {capital i} option).

Under GCC C++ Linker ->Libraries, add vl to the Libraries(-l {small el}) and VLFEATROOT/bin/glnx86 to the Library search path  (-L)

 

Step 4: entering the LD_LIBRARY_PATH in the Environment tab on the 
launch configuration (this caused the maximum hullabaloo)

Project -> Run As -> Run Configurations -> “Environment” tab

 Add an environment variable named LD_LIBRARY_PATH and set its value to the location of the libvl.so file, which is VLFEATROOT/bin/glnx86. Make sure the option  “Append environment to native environment” is selected.

 

All done! 

 

Advertisements

About Aruni RC

Engineering student, IT.Programming and fantasy, sci-fi enthusiast.

Posted on April 27, 2013, in Uncategorized. Bookmark the permalink. 1 Comment.

  1. Thank you so much…!!! Works like a charm…!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: