0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

2021年版 levmarをmacで動かす方法

Posted at

levmar は Levenberg_Marquardt法がシンプルに実行できるパッケージです.
http://users.ics.forth.gr/~lourakis/levmar/

gfortran のインストール

brew install gfortran

いろいろインストール
バージョンが最新か注意すること

http://www.netlib.org/blas/blas.tgz
http://www.netlib.org/lapack/lapack-3.10.0.tgz
http://www.netlib.org/f2c/libf2c.zip
http://www.ics.forth.gr/~lourakis/levmar/levmar-2.5.tgz

好きなところに移動させてmake 筆者は/use/local/Cellar以下に移動させた

blasをmake -> blas_LINUX.a
lapackをmake -> lapack_LINUX.a
libf2cをmake -> libf2c.a
levmarをmake -> liblevmar.a

sudo ln -s /もとパス/xxx.a /usr/local/gfortran/lib/libXXX.a でblas,lapack,f2c,levmarのシンボリックリンクを/usr/local/gfortran/libに作る。リンク先の命名規則はlibXXX.aで統一する

sudo ln -s /usr/local/Cellar/BLAS-3.10.0/blas_LINUX.a /usr/local/gfortran/lib/libblas.a
sudo ln -s /usr/local/Cellar/levmar-2.6-build/liblevmar.a /usr/local/gfortran/lib/liblevmar.a
sudo ln -s /usr/local/Cellar/lapack-3.10.0/liblapack.a /usr/local/gfortran/lib/liblapack.a
sudo ln -s /usr/local/Cellar/libf2c/libf2c.a /usr/local/gfortran/lib/libf2c.a
  • コンパイル
g++ main.cpp -llevmar -llapack -lblas -lgfortran

参考 サンプルコードを載せてらっしゃるので動作確認にどうぞ
https://sites.google.com/view/higamemo/memo/levmar-on-mac

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?