ashwin / coursera-heterogeneous

Resources to work offline on the assignments of Heterogenous Parallel Programming course from Coursera.
71 stars 60 forks source link

POSIX timers on Fedora 17 #12

Closed woky closed 11 years ago

woky commented 11 years ago

Hi.

On Fedora 17 it is necessary to link against rt library or else linker will fail:

/usr/bin/ld: CMakeFiles/mp1.dir/src/./mp1_generated_mp1.cu.o: undefined reference to symbol 'clock_gettime@@GLIBC_2.2.5'
/usr/bin/ld: note: 'clock_gettime@@GLIBC_2.2.5' is defined in DSO /lib64/librt.so.1 so try adding it to the linker command line
/lib64/librt.so.1: could not read symbols: Invalid operation
collect2: error: ld returned 1 exit status

Currently it's enough to just add following line to CMakeLists.txt

target_link_libraries(mp1 rt)

because only mp1 use time functions.

ashwin commented 11 years ago

@woky I work on Windows and am not familiar with CMakeLists. Could you give me a patch or a pull request, so I can merge it in?