I was trying to run a simple OpenCL test program for a course assignment. But I got an error when running make
.
The error is:
ld: library not found for -lrt
I checked the Makefile
, and found the related line was:
cl-demo: cl-demo.c cl-helper.c
gcc $(CL_CFLAGS) $(CL_LDFLAGS) -std=gnu99 -o$@ $^ -lrt -lOpenCL -v
While my fellow classmates using Ubuntu 16.04 managed to run this test program just fine, I am using macOS High Sierra. The TAs nor the professor cannot figure it out (unfortunately, they only have experience of OpenCL on Ubuntu).
It feels like that the missing library rt
seems be a library from some common package, but I don't know which package it comes from. Is it exclusive to Ubuntu or Linux? Does anybody knows where it comes from? Thanks!