Code::Blocks Forums

User forums => Help => Topic started by: houlier on July 05, 2011, 05:48:36 am

Title: Armadillo C++ -- LAPACK and BLAS
Post by: houlier on July 05, 2011, 05:48:36 am
Hello all,

I am pretty new to using Code::blocks. Hence, I apologize beforehand in case my question sounds stupid.
I am trying to install Armadillo. One of the installation steps asks to configure my compiler to link with the LAPACK and BLAS libraries. I already have the following files:

1) blas_win32_MT.dll
2) blas_win32_MT.lib
3) lapack_win32_MT.dll
4) lapack_win32_MT.dll

How can I link those libraries?

I am grateful for your response.

Best,
Houl
Title: Re: Armadillo C++ -- LAPACK and BLAS
Post by: MortenMacFly on July 05, 2011, 07:05:44 am
1) blas_win32_MT.dll
2) blas_win32_MT.lib
3) lapack_win32_MT.dll
4) lapack_win32_MT.dll
How can I link those libraries?
Within your project options -> build options -> tab "linker" -> add the library you need to use in the right order. IT also depends on whether you are using the static or dynamic runtime version.

Consult the C::B manual (http://www.codeblocks.org/docs/main_codeblocks_en.html) to see screenshots where to setup this information.
Title: Re: Armadillo C++ -- LAPACK and BLAS
Post by: Jenna on July 05, 2011, 09:12:24 am
You most likely have to add the path to the linker installation directory to the libraries search paths in the build options, at least if they are not in the systems search path.
Title: Re: Armadillo C++ -- LAPACK and BLAS
Post by: houlier on July 05, 2011, 03:48:22 pm
Thank you for all...It is working now.

Best,
Houl
Title: Re: Armadillo C++ -- LAPACK and BLAS
Post by: shihan on May 18, 2015, 09:18:56 am
Hello ,

I tried many hours and still I couldn't figure out how to do this.
I found
1) blas_win64_MT.dll
2) blas_win64_MT.lib
3) lapack_win64_MT.dll
4) lapack_win64_MT.lib
files in C:\armadillo-5.100.2\armadillo-5.100.2\examples\lib_win64    directory.
Then as MortenMacFly suggested I did " project options -> build options -> tab "linker" -> add the library " . I added only .lib versions since  when I add .dll compiler doesn't build the project and tells unrecognized format.

After I compile the program it says "undefined reference to `dgemv_' . It is obvious that comiler cannot find lapack and blas libraires.
Can you guys please help me to fix this.
Thank You.
Title: Re: Armadillo C++ -- LAPACK and BLAS
Post by: MortenMacFly on May 20, 2015, 09:23:01 pm
Unknown format means one of the following:
The files were compiled with a compiler not compatible to the one you use
The files might be compiled for a different platform
You use a 32 bit compiler to link against 64 bit libraries.

However, the linker is always right, so it's not a c::b issue but you use the libraries in a wrong way.please ask the devs of the lib what compiler they recommend to use on your target platform.

We can't tell because we don't know.