cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Observer
Observer
3,652 Views
Registered: ‎04-24-2012

Undefined reference to clock_gettime

I am trying to compile and link the CoreMark benchmark program to run on the ZedBoard (ARM Cortex-A9). I get this error: undefined reference to `clock_gettime'.

When I try to add -lrt the linker tells me it can't find it.

 

Building target: CoreMark.elf
Invoking: ARM gcc linker
arm-xilinx-eabi-gcc -Wl,-T -Wl,../src/lscript.ld -L../../standalone_bsp_0/ps7_cortexa9_0/lib -o "CoreMark.elf"  ./src/core_list_join.o ./src/core_main.o ./src/core_matrix.o ./src/core_portme.o ./src/core_state.o ./src/core_util.o   -Wl,--start-group,-lxil,-lgcc,-lc,-end-group
./src/core_portme.o: In function `start_time':
/home/svenand/Projects/ZynqIntro/LED_Controller/workspace/CoreMark/Debug/../src/core_portme.c:122: undefined reference to `clock_gettime'
./src/core_portme.o: In function `stop_time':
/home/svenand/Projects/ZynqIntro/LED_Controller/workspace/CoreMark/Debug/../src/core_portme.c:147: undefined reference to `clock_gettime'
collect2: error: ld returned 1 exit status
make: *** [CoreMark.elf] Error 1


Sven

 

0 Kudos
Reply
3 Replies
3,632 Views
Registered: ‎02-05-2014

I've the same problem

0 Kudos
Reply
Observer
Observer
3,613 Views
Registered: ‎04-24-2012

I wrote my own clock_gettime routine. See my blog: http://svenand.blogdrive.com/archive/174.html

 

Sven

0 Kudos
Reply
3,595 Views
Registered: ‎02-05-2014

You can use the ARM's SCU Timer if you are running your application without OS.

 

Look xscutimer.h.

0 Kudos
Reply