Question

  • How do you add Lapack libraries to Code::Blocks IDE on Windows?.
  • The files I have are these: (Victor's Compiled binary libraries for Windows on this page: http://www.stanford.edu/~vkl/code/libs.html)

    • lapack_win32.a
    • lapack_win32.def
    • lapack_win32.dll
    • lapack_win32.exp
    • lapack_win32.lib

      • How would look like a simple example in C/C++ using the dynamic library? Do I use #include <lapack>? or how?
Was it helpful?

Solution

First assuming you have installed these libraries in C:\LapackLib.

  1. Click on the Settings Menu and then select the Compiler menu item.

  2. From the Compiler Settings Dialog select the Directories Tab.

  3. Click the Add button.

  4. In the window that pops up type in your library path in this example it is C:\LapackLib\.

  5. Select the Linker tab

  6. Repeat steps 3 and 4, then press the Ok button to close the Compiler Settings Dialog

  7. Right click on your project name from the Treeview on the left hand side of the screen, it will in bold.

  8. From the popup menu select the Build Options menu item

  9. Select the Linker tab

  10. From the Link Libraries window, click on the Add button. Select the path to your library from the File Dialog, in this case it is C:\LapackLib\lapack_win32.lib. Then press the Ok Button.

  11. In your source code add the relevant include declaration

    e.g. #include <lapack> or #include "lapack.h"

For further information see the following tutorial or the CodeBlocks manual.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top