cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Advisor
Advisor
180 Views
Registered: ‎02-12-2013

how to add library to Vitis bare metal project?

Hello,

I am writing a bare metal program that requires the C math library for cos(), round(), etc. I have #include <math.h> and the C code compile but I get an error at link time. 

    undefined reference to `cos'

How do I tell Vitis to include the math library in my application?

Below is my setup script.  I don't find a library option on platform create or app create.

Thanks,

file delete -force ./workspace

set hw ../../../implement_p2/results/top.xsa
set proc "ps7_cortexa9_0"

setws ./workspace

platform create -name "standalone_plat" -hw $hw -proc $proc -os standalone

app create -name rf_fader -platform standalone_plat -domain standalone_domain -template "Empty Application"

----------------------------------------
DSP in hardware and software
-----------------------------------------
0 Kudos
3 Replies
Highlighted
Explorer
Explorer
136 Views
Registered: ‎01-27-2008

@pedro_uno 

See this thread, need to add per @stephenm notes.

https://forums.xilinx.com/t5/Embedded-Development-Tools/Undefined-reference-to-pow-despite-linking-to-libm/m-p/1175597#M56409

you can do it using the IDE after you create your app template.

 

Highlighted
Advisor
Advisor
124 Views
Registered: ‎02-12-2013

olupj

Thanks for the reply but those instructions are for the old XSDK flow.  I am using Vitis.

I know how to add libraries in the GUI and in my setup scripts with XSDK.  Can anyone tell me how to do it in Vitis?

Thanks,

----------------------------------------
DSP in hardware and software
-----------------------------------------
0 Kudos
Highlighted
Advisor
Advisor
94 Views
Registered: ‎01-28-2008

Hi @pedro_uno 

  Have you tried:

  app config -name appname libraries metal

  For more info, check ug1400, page 447.

 

Thanks,

-Pat

 

Give kudos if helpful. Accept as solution if it solves your problem.
https://tuxengineering.com/blog

0 Kudos