Compiling against external libraries

Firmware/software/electronics/mechanics
Post Reply
Nordmoen
Beginner
Posts: 5
Joined: Fri Jan 30, 2015 7:46 am

Compiling against external libraries

Post by Nordmoen »

Hi.

I'm trying to compile some code into the Crazyflie firmware which is dependent on CBLAS and LAPCKE, but I can't figure out how to link against those libraries. Currently I would just like to use the system default for ease of testing, and the same program with a CMake file outside of the Crazyflie firmware compiles on my PC. What is the easiest way to compile a file which should be included in the firmware with "-lcblas -llapacke"?
whoenig
Expert
Posts: 395
Joined: Mon Oct 27, 2014 2:55 am

Re: Compiling against external libraries

Post by whoenig »

You can add it to the LDFLAGS in the Makefile (https://github.com/bitcraze/crazyflie-f ... r/Makefile). However, that would only work if you manage to cross-compile those libraries for the STM. The system default x86 binaries you are using can't be linked into an ARM-based firmware.
Nordmoen
Beginner
Posts: 5
Joined: Fri Jan 30, 2015 7:46 am

Re: Compiling against external libraries

Post by Nordmoen »

Thanks whoenig, you are of course correct.

Does anyone have any experience cross compiling BLAS & LAPACK for ARM? Is there any other libraries that could be used instead. Currently there is quite a lot of code that needs to be changed so I would like to utilize BLAS, but if that is hard/impossible to use with the Crazyflie that sort of defeats the purpose.
Post Reply