cpfind links against system flann, but includes the bundled flann

Bug #938293 reported by Bruno Postle on 2012-02-22
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

During the build process, a system installed flann is detected fine, but the include lines for cpfind have these entries in this order:

 -I/path/to/builddir/src/foreign ... -I/usr/include

The result is that although cpfind dynamically links to the system flann library, cpfind is actually compiled using the bundled flann headers. This fails on fedora f17, because it has flann-1.7.1, whereas Hugin HG tip bundles flann-1.6.1 headers.

I tried fixing this by rearranging lines in CMakeLists.txt, but it doesn't seem to control the order of -I entries, so I don't know enough cmake magic.

For the fedora package simply removing the src/foreign/flann folder lets me build ok, but this isn't a solution for most users.

tmodes (tmodes) wrote :

Hi Bruno,

try the following:
in CMakeLists.txt:
remove line 110: include_directories( ${CMAKE_SOURCE_DIR}/src/foreign )
and add instead after line 288: FIND_PACKAGE(flann)

  include_directories( ${CMAKE_SOURCE_DIR}/src/foreign )

Maybe a further change to src/hugin_base/algorithms/optimizer/PhotometricOptimizer.cpp is necessary
#include <levmar/lm.h>
#include <foreign/levmar/lm.h>

Bruno Postle (brunopostle) wrote :

Thanks, committed as 18b1029df5ba

I also had to change the levmar include in src/tools/tca_correct.cpp and the lensdb include in src/tools/fulla.cpp

Changed in hugin:
status: New → Fix Committed
tmodes (tmodes) on 2012-07-21
Changed in hugin:
milestone: none → 2012.0beta1
hvdwolf (hvdwolf) on 2012-07-23
Changed in hugin:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers