How to compile and use VLFeat

VLFeat is an open source library that has implementations of computer vision algorithms such as HOG and SIFT. The source code is particularly well written and is easy to read and understand.


  • Download a stable version of the source code from here or get the latest source code from its Github repository here.

  • To compile, just type make.

  • For convenience, export an environment variable named VLROOT set to the directory of the VLFeat source code:

export VLROOT=/home/joe/vlfeat


Here is a minimal piece of source code from its documentation:

#include <vl/generic.h>

int main()
    VL_PRINT("Hello world!");
    return 0;

While compiling code that uses VLFeat, remember to pass its include directory, its library directory and the library itself:

$ g++ foobar.cpp -I$VLROOT -L$VLROOT/bin/glnxa64/ -lvl

Finally, add the $VLROOT/bin/glnxa64 directory to the ldconfig cache as explained here. This enables your program to find and load the shared library when it is executed.

Tried with: VLFeat 0.9.18 and Ubuntu 12.04 LTS

2 thoughts on “How to compile and use VLFeat

Leave a Reply

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

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

Google photo

You are commenting using your Google 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 )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.