updated levmar library

Bug #679654 reported by nobody
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Hugin
Fix Released
Low
Unassigned

Bug Description

Last December, an updated levmar was released (2.2), with change that could be very interesting for hugin:

 - Fixed an error in the computation of the damping factor of levmar_dif() in lm_core.c. Thanks to John Ervin for reporting.

This change is interesting, because levmar_dif is used for photometric optimisation by hugin.

I took the liberty to try hugin with this newer version of the levmar library, and on my test panorama it took slightly longer but reached the same end result.

This is of course not 0.7 material, but perhaps something for early 0.7.1.

Revision history for this message
nobody (nobody-users) wrote :

The file hugin-update-levmar-2.2.diff was added: patch updating foreign/levmar from 2.1.3 to 2.2

Revision history for this message
nobody (nobody-users) wrote :

Logged In: NO

Sorry, I notice now that forgot to state my e-mail address:

<email address hidden>

tmodes (tmodes)
Changed in hugin:
importance: Undecided → Low
status: New → Triaged
Revision history for this message
rew (r-e-wolff) wrote :

By now 2.5 seesm to be current levmar version (since dec 2009).

It seems Levmar is carried along in source form with the hugin source as opposed to external linking.

tags: added: levmar library update
Yuv (yuv)
Changed in hugin:
status: Triaged → Confirmed
Revision history for this message
tmodes (tmodes) wrote :

Updated internal levmar library to 2.6 in default branch.

Changed in hugin:
status: Confirmed → Fix Committed
Revision history for this message
Stefan Peter (s-peter-deactivatedaccount) wrote :
Download full text (4.7 KiB)

Hi Thomas

Hugin 7031:461bf6f58d2e fails linking libhuginbase:
...
Linking CXX shared library libhuginbase.so
cd /«BUILDDIR»/hugin-2015.1.0+hg7031+dfsg/obj-x86_64-linux-gnu/src/hugin_base && /usr/bin/cmake -E cmake_link_script CMakeFiles/huginbase.dir/link.txt --verbose=1
/usr/bin/x86_64-linux-gnu-g++ -fPIC -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wall -D_FORTIFY_SOURCE=2 --std=c++11 -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,--as-needed -Wl,-z,defs -fopenmp -shared -Wl,-soname,libhuginbase.so.0.0 -o libhuginbase.so.0.0 CMakeFiles/huginbase.dir/algorithms/nona/NonaFileStitcher.cpp.o CMakeFiles/huginbase.dir/algorithms/basic/CalculateCPStatistics.cpp.o CMakeFiles/huginbase.dir/algorithms/basic/CalculateMeanExposure.cpp.o CMakeFiles/huginbase.dir/algorithms/basic/CalculateOptimalScale.cpp.o CMakeFiles/huginbase.dir/algorithms/basic/CalculateOptimalROI.cpp.o CMakeFiles/huginbase.dir/algorithms/basic/RotatePanorama.cpp.o CMakeFiles/huginbase.dir/algorithms/basic/TranslatePanorama.cpp.o CMakeFiles/huginbase.dir/algorithms/basic/StraightenPanorama.cpp.o CMakeFiles/huginbase.dir/algorithms/basic/CalculateOverlap.cpp.o CMakeFiles/huginbase.dir/algorithms/basic/LayerStacks.cpp.o CMakeFiles/huginbase.dir/algorithms/nona/CalculateFOV.cpp.o CMakeFiles/huginbase.dir/algorithms/nona/CenterHorizontally.cpp.o CMakeFiles/huginbase.dir/algorithms/nona/FitPanorama.cpp.o CMakeFiles/huginbase.dir/algorithms/nona/ComputeImageROI.cpp.o CMakeFiles/huginbase.dir/algorithms/optimizer/ImageGraph.cpp.o CMakeFiles/huginbase.dir/algorithms/optimizer/PhotometricOptimizer.cpp.o CMakeFiles/huginbase.dir/algorithms/optimizer/PTOptimizer.cpp.o CMakeFiles/huginbase.dir/algorithms/point_sampler/PointSampler.cpp.o CMakeFiles/huginbase.dir/algorithms/control_points/CleanCP.cpp.o CMakeFiles/huginbase.dir/appbase/ProgressDisplay.cpp.o CMakeFiles/huginbase.dir/huginapp/CachedImageRemapper.cpp.o CMakeFiles/huginbase.dir/huginapp/ImageCache.cpp.o CMakeFiles/huginbase.dir/hugin_math/eig_jacobi.cpp.o CMakeFiles/huginbase.dir/hugin_math/graph.cpp.o CMakeFiles/huginbase.dir/hugin_math/Matrix3.cpp.o CMakeFiles/huginbase.dir/hugin_math/Vector3.cpp.o CMakeFiles/huginbase.dir/hugin_utils/alphanum.cpp.o CMakeFiles/huginbase.dir/hugin_utils/utils.cpp.o CMakeFiles/huginbase.dir/hugin_utils/platform.cpp.o CMakeFiles/huginbase.dir/lensdb/LensDB.cpp.o CMakeFiles/huginbase.dir/nona/SpaceTransform.cpp.o CMakeFiles/huginbase.dir/nona/Stitcher1.cpp.o CMakeFiles/huginbase.dir/nona/Stitcher2.cpp.o CMakeFiles/huginbase.dir/nona/Stitcher3.cpp.o CMakeFiles/huginbase.dir/nona/Stitcher4.cpp.o CMakeFiles/huginbase.dir/nona/Stitcher.cpp.o CMakeFiles/huginbase.dir/nona/StitcherOptions.cpp.o CMakeFiles/huginbase.dir/panodata/ControlPoint.cpp.o CMakeFiles/huginbase.dir/panodata/Lens.cpp.o CMakeFiles/huginbase.dir/panodata/Mask.cpp.o CMakeFiles/huginbase.dir/panodata/Panorama.cpp.o CMakeFiles/huginbase.dir/panodata/PanoramaOptions.cpp.o CMakeFiles/huginbase.dir/panodata/PanoramaVariable.cpp.o CMakeFiles/huginbase.dir/panodata/PTScriptParsing.cpp.o CMakeFiles/huginbase.dir/panodata/SrcPanoImage.cpp.o CMakeFiles/huginbase.dir/panodata/ImageVariableGroup.cpp.o CMakeFiles/hu...

Read more...

Revision history for this message
tmodes (tmodes) wrote :

Hi Stefan,

strange. I tested on Linux before committing and it compiled fine on my machine. Also the original CMakeLists.txt from levmar does not contain the -fPIC switch which your compiler complains.
I added the switch again. It should now work again.

Revision history for this message
jpe (jean-pierre-eckmann) wrote :

thanks. works for me now

Revision history for this message
Stefan Peter (s-peter-deactivatedaccount) wrote :

Hi Thomas

The hugin nightlies of 2015.1.0.12f7dc74bbc2 compiled successfully, thank you very much for the prompt support.

Do you have any insight regarding the

#warning Linear inequalities constrained optimization requires LAPACK and was not compiled!

in the levmar build? I don't think that an additional lapack dependency would do any harm. But I don't know if this really is needed. And I'd need help adapting the build system (if this is needed) to honour the lapack dependency. Or does it already support this and we just missed to specify it?

With kind regards

Stefan

Revision history for this message
tmodes (tmodes) wrote :

Hi Stephan,

there are 2 type of warnings in levmar.

The first one is of type
#warning Linearly constrained optimization requires LAPACK and was not compiled!

levmar implement different unconstrained and constrained versions of the Levenberg-Marquard algorithm. Some of the contrained version need LAPACK to work. But Hugin is only using the unconstrained version. This type of warning can therefore ignored, at least for Hugin.

The second warning is
#warning LAPACK not available, LU will be used for matrix inversion when computing the covariance; this might be unstable at times

This warning is trigged in code which is used by Hugin. The warning states that LAPACK could help to calculate the covariance. But as far as I know Hugin is not using the returned covariance. So LAPACK could help to make it more robust. But until now I have not seen any issues when using levmar without LAPACK.

The LAPACK is already in CMake, but needs explicitly activated:
##
## LAPACK (optional, enable by -DENABLE_LAPACK=ON)
##
OPTION (ENABLE_LAPACK "Use LAPACK based solver in levmar" OFF)

Revision history for this message
Stefan Peter (s-peter-deactivatedaccount) wrote : Re: [Bug 679654] Re: updated levmar library

Hi Thomas

Thank you very much for your explanations. I will try to add the lapack
dependency to the Ubuntu packages I maintain and to the upstream Debian
packages as well. However, this effort will be concentrate on
hugin>2015.0.0 because I do not want to introduce a new dependency
(and, maybe, a new behavior and new problem spots) before the upcoming
2015.0.0 release.

Again, thank you very much for your advice.

With kind regards

Stefan

On 24.06.2015 20:10, tmodes wrote:
> Hi Stephan,
>
> there are 2 type of warnings in levmar.
>
> The first one is of type
> #warning Linearly constrained optimization requires LAPACK and was not compiled!
>
> levmar implement different unconstrained and constrained versions of the
> Levenberg-Marquard algorithm. Some of the contrained version need LAPACK
> to work. But Hugin is only using the unconstrained version. This type of
> warning can therefore ignored, at least for Hugin.
>
> The second warning is
> #warning LAPACK not available, LU will be used for matrix inversion when computing the covariance; this might be unstable at times
>
> This warning is trigged in code which is used by Hugin. The warning
> states that LAPACK could help to calculate the covariance. But as far as
> I know Hugin is not using the returned covariance. So LAPACK could help
> to make it more robust. But until now I have not seen any issues when
> using levmar without LAPACK.
>
> The LAPACK is already in CMake, but needs explicitly activated:
> ##
> ## LAPACK (optional, enable by -DENABLE_LAPACK=ON)
> ##
> OPTION (ENABLE_LAPACK "Use LAPACK based solver in levmar" OFF)
>

--
Any technology that does not appear magical is insufficiently advanced.
~ Gregory Benford

Revision history for this message
tmodes (tmodes) wrote :

Hi Stephan,

I committed changeset ad2dbc6c09bb. With this changeset the covariance matrix is not longer calculated, we don't need this matrix. So now the second warning can be ignored and compiling/linking against LAPACK should not make a difference for Hugin, because the codes which is optionally using LAPACK is not used by Hugin.

So I think it should not be necessary to pull in the LAPACK dependency.

tmodes (tmodes)
Changed in hugin:
milestone: none → 2016.0beta1
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.