vlfeat / vlfeat

An open library of computer vision algorithms

Home Page:http://vlfeat.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Octave build on linux fails (libvl.so: No such file or directory, conflicting types for ‘mwSize’)

99991 opened this issue · comments

Steps to reproduce

sudo apt-add-repository ppa:octave/stable
sudo apt-get update
sudo apt-get install octave liboctave-dev octave-image
git clone git://github.com/vlfeat/vlfeat.git
cd vlfeat/
make MKOCTFILE=mkoctfile

Fails with error message:

cp -v "bin/glnxa64/libvl.so" "toolbox/mex/octave/mexa64/libvl.so"
'bin/glnxa64/libvl.so' -> 'toolbox/mex/octave/mexa64/libvl.so'
cp: cannot create regular file 'toolbox/mex/octave/mexa64/libvl.so': No such file or directory
make/octave.mak:95: recipe for target 'toolbox/mex/octave/mexa64/libvl.so' failed
make: *** [toolbox/mex/octave/mexa64/libvl.so] Error 1

The file libvl.so is attempted to be copied to a directory which does not exist.
The fix is to create the directory:

mkdir -p "toolbox/mex/octave/mexa64"

After running make MKOCTFILE=mkoctfile again:

toolbox/mexutils.h:33:22: error: conflicting types for ‘mwSize’

Fix: Uncomment line 33 and 34 in vlfeat/toolbox/mexutils.h:

#ifndef MWSIZE_MAX
//typedef int unsigned mwSize ;
//typedef int mwIndex ;
#endif

Then export the library path:

EDIT: this path might have changed for some people. Locate the file libvl.so and specify that path to be sure.

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/changethispathtowhereyouputthis/vlfeat/toolbox/mex/octave/mexa64;
# or maybe
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/changethispathtowhereyouputthis/vlfeat/toolbox/mex/octave/mexa64/;

Run in octave:

run('vlfeat/toolbox/vl_setup');

EDIT: There are two new bugs these days:

  1. gcc chokes on #pragma omp parallel default(none). Fix is to delete three occurences of default(none) in vl/kmeans.c as explained here:
    #214
  2. During the compilation process, a mex binary is used if available. However, for me, mex was some latex binary instead of some matlab mex compiler. Temporarily renaming /usr/bin/mex to something else fixed that for me (requires root privileges).

I have the same problem, any suggestion how to fix it?

Note: if there is no folder named 'octave' in the following path then add and include required mex files from earlier folder:

original if -->/home/your_path/vlfeat/toolbox/mex/

change to --> /home/your_path/vlfeat/toolbox/mex/octave/mexa64/

Open octave.mak under vlfeat/make folder and edit line 39:

modified --> OCTAVE_MEX_BINDIR := toolbox/mex/octave/$(MEX_SUFFIX)

original --> OCTAVE_MEX_BINDIR := toolbox/mex/$(MEX_SUFFIX)

line 130: original--> rm -rf toolbox/mex

modified--> rm -rf toolbox/mex/octave

Open toolbox/mexutils.h

Comment line 33 and 34:

typedef int unsigned mwSize ;

typedef int mwIndex ;

Add path in .bashrc file

modified ==> export LD_LIBRARY_PATH="/home/your_path/vlfeat/toolbox/mex/octave/mexa64/"

export LD_LIBRARY_PATH="/home/your_path/vlfeat/toolbox/mex/mexa64/"

now from the vlfeat director compile octave using

MKOCTFILE=mkoctfile make

RESTART THE SYSTEM

Open vlfeat/toolbox/mex/octave/mexa64

and open octave from that location