I am Charmie

メモとログ

Using levmar with Visual Studio 2010

levmar compilation requires two steps: LAPACK installation and levmar compilation. Here, I use CLAPACK instead of LAPACK for ease of setup but any types of CLAPACK might be fine.

  1. CLAPACK installation There are several options to build CLAPACK. At the following website, you can check and download most suitable file for your system. URL: http://www.netlib.org/clapack/ Download the file clapack-3.2.1-CMAKE.tgz and expand it. Say the home directory DIR_CLAPACK_SRC = C:...\clapack-3.2.1-CMAKE .

Setup of CMake is Where is the source code: DIR_CLAPACK_SRC Where to build the binaries: DIR_CLAPACK_DST (ex. C:/CLAPACK) Press the "Configure" button. If the middle window shows, press the button again. Then, press "Generate" button to generate selected build files. If CMake part is successfully finished, output is saved in DIR_CLAPACK_DST.

Open CLAPACK.sln in DIR_CLAPACK_DST with Visual Studio 2010 and build it Build->Batch Build. If the build is successfully finished, the following files are generated in each directories. lapack.lib: DIR_CLAPACK_DST/SRC/Release tmglib.lib: DIR_CLAPACK_DST/Testing/MATGEN/Release libf2c: DIR_CLAPACK_DST/F2CLIBS/libf2c/Release blas.lib: DIR_CLAPACK_DST/BLAS/SRC/Release Addition to the lib files, header files are necessary for using levmar. *.h: DIR_CLAPACK_SRC/SRC

  1. levmar compilation Once CLAPACK installation finished, you can build levmar. Download the latest (or suitable version) from the official site and expand it. http://www.ics.forth.gr/~lourakis/levmar/ Similar to CLAPACK installation, you can use CMake to generate sln file. Where is the source code: DIR_LEVMAR_SRC Where to build the binaries: DIR_LEVMAR_DST Depending on your setup, you should manually change some variables of location of lib files as follows BLAS_LIB: DIR_CLAPACK_DST/BLAS/SRC/Release/blas.lib F2D_LIB: DIR_CLAPACK_DST/F2CLIBS/libf2c/Release/libf2c.lib LAPACK_LIB: DIR_CLAPACK_DST/SRC/Release/lapack.lib LAPACKBLAS_DIR: DIR_CLAPACK_DST/BLAS/SRC/Release With correct location setup, you can generate the solution file by pressing "Generate" button. Then, just build the solution file LEVMAR.sln.

  2. Test For simple test can be done with a code as FAQ suggests. http://www.ics.forth.gr/~lourakis/levmar/faq.html#Q23 http://www.ics.forth.gr/~lourakis/levmar/faq.html#Q24 Note that the order of include header files is important. I didn't check the detail but some website say that clapack.h should be called later.