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.
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.
Addition to the lib files, header files are necessary for using levmar.
2. levmar compilation
Once CLAPACK installation finished, you can build levmar. Download the latest (or suitable version) from the official site and expand it.
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
With correct location setup, you can generate the solution file by pressing “Generate” button. Then, just build the solution file LEVMAR.sln.
For simple test can be done with a code as FAQ suggests.
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.