AnsweredAssumed Answered

Error while compiling opencl samples (pthread_create and DSO related) on Ubuntu.

Question asked by Wieke on Dec 7, 2013
Latest reply on Apr 26, 2015 by salamo

Hey everyone


So I've been trying to compile the opencl samples on my ubuntu laptop but I'm getting this error.


/opt/AMDAPP/samples$ cmake -G "Unix Makefiles" .
-- Configuring done
-- Generating done
-- Build files have been written to: /opt/AMDAPP/samples
/opt/AMDAPP/samples$ make
[  1%] Built target AtomicCounters
[  2%] Built target BasicDebug
[  3%] Built target BinarySearch
[  4%] Built target BinomialOption
Linking CXX executable bin/x86_64/Release/BinomialOptionMultiGPU
/usr/bin/ld: CMakeFiles/BinomialOptionMultiGPU.dir/BinomialOptionMultiGPU.cpp.o: undefined reference to symbol 'pthread_create@@GLIBC_2.2.5'
/lib/x86_64-linux-gnu/ error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [opencl/cl/BinomialOptionMultiGPU/bin/x86_64/Release/BinomialOptionMultiGPU] Error 1
make[1]: *** [opencl/cl/BinomialOptionMultiGPU/CMakeFiles/BinomialOptionMultiGPU.dir/all] Error 2
make: *** [all] Error 2


I've tried googling around and while this kind of error seems to occur more often I've only found questions regarding different software (not the AMD APP SDK) I couldn't figure out how to adapt their solutions to this situation. The bits that do manage to be built do appear to work, so that's good.


So does anyone here know how to fix this?