一、levmar主页:
Levenberg-Marquardt in C/C++http://users.ics.forth.gr/~lourakis/levmar/index.html
二、开始安装
进入安装包下,执行make指令:
Ubuntu16.04 Compile levmar&Sparselm&SBA_yanqs_whu的博客-CSDN博客Firstly you have to install suitesparse and metis.sudo apt-get install libsuitesparse-devsudo apt-get install libmetis-devlevmar 1.Download Levmar and extract it. 2.Open Terminal in that directory ahttps://blog.csdn.net/u012348774/article/details/71056646
三、问题解决?
1、/usr/bin/ld: cannot find -lf2c
解决方法:安装f2c
sudo apt-get install libf2c2-dev
2、没有make install命令
从源码上重新下载
?https://www/github.com/jturney/levmarhttp://xn--https-rfa//www/github.com/jturney/levmar
mkdir build
cd build
cmake ..
make
sudo make install
?
四、开始使用
在CMakeList.txt下需要添加如下
# LEVMAR
FIND_PACKAGE(levmar)
IF(levmar_FOUND)
INCLUDE_DIRECTORIES(${levmar_INCLUDE_DIR})
ELSE(levmar_FOUND)
MESSAGE(FATAL_ERROR "Could not find the LEVMAR library and development files.")
ENDIF(levmar_FOUND)
target_link_libraries(aa ${levmar_LIBRARIES})
|