Today I successed in porting the Deep Matching algorithm & tools from LEAR to Ubuntu. The algorithm itself is a stand-of-art solution to mutipal questions concerning image matching, comes with a easy-understanding code. However the author did not mention the dependency request of tools he used, and the system file structure of Fedora differs a lot from Ubuntu/Debian, hence the compile&install takes me quite a long time.
First to first,
using to fix dependency.
Take a look into 1
apt-get
,
we have (although the default 1
Makefile
method does not call this)1
make
1 | STATICLAPACKLDFLAGS=-static -static-libstdc++ /usr/lib64/libjpeg.a /usr/lib64/libpng.a /usr/lib64/libz.a /usr/lib64/libblas.a /usr/lib/gcc/x86_64-redhat-linux/4.7.2/libgfortran.a # statically linked version |
Which briefly declares the dependecy.
In the following codes I’m omitting ,
however most steps should be executed as root.1
sudo
1 2 3 | apt-get install libjepg-dev apt-get install libpng-dev apt-get install libatlas-base-dev libatlas-dev |
The following commands should add the corresponding file to search path.
It’s just the beginning:
Ubuntu itself includes 1
.h
, 1
libjpeg
and some other tools the program uses in its kernel include path,
hence a fix is taken to link such libaries to 1
libpng
1
/usr/lib/
1 2 3 4 5 6 | ln -s /usr/lib/x86_64-linux-gnu/libjpeg.a /usr/lib ln -s /usr/lib/x86_64-linux-gnu/libjpeg.so /usr/lib ln -s /usr/lib/x86_64-linux-gnu/libpng.a /usr/lib ln -s /usr/lib/x86_64-linux-gnu/libpng.so /usr/lib ln -s /usr/lib/x86_64-linux-gnu/libz.a /usr/lib ln -s /usr/lib/x86_64-linux-gnu/libpng.so /usr/lib |
Now we’ve dealt with , 1
libjpeg
and 1
libpng
.
The part of 1
libz
is a little unusal since the program uses machine-optimized version.
We have to manually install 1
atlas
.
Notice the following name of folder maynot be the same as others since the version of 1
atlas
at the time I try is 3.10.1.1
atlas
1 2 3 4 5 6 | sudo apt-get source atlas cd atlas-3.10.1 sudo fakeroot debian/rules custom cd .. sudo dpkg -i libatlas3-base_3.10.1-4+custom1_amd64.deb sudo dpkg -i libatlas3gf-base_3.10.1-4+custom1_all.deb |
Now return to ,
we have some last modify here.
The dynamic link may work now,
only to change 1
Makefile
to 1
libptf77blas.so
if you don’t have 1
libptfblas.so
under 1
libptf77blas.so
.1
/usr/lib
However when I tried on another computer,
such method fails in loading .
A more steady way can be used by calling the static link method:1
jpeglib.h
In , Change all 1
STATICLAPACKLDFLAGS
to 1
usr/lib64/
,
and change 1
usr/lib/
in the last argument to something like 1
x86_64-redhat-linux
which is the folder name occurs in 1
/x86_64-linux-gnu
.
Finally change 1
/usr/lib
to 1
all: deepmatching
.1
all: deepmatching-static
Now call the static-link method by .
Happy deep-matching.1
make