opencl-book-samples icon indicating copy to clipboard operation
opencl-book-samples copied to clipboard

failed to build

Open ghost opened this issue 6 years ago • 1 comments

trying to build examples

mkdir build cd build cmake .. make

Unfortunately end up with build errors, can you help what might go wrong?

[ 77%] Linking CXX executable Dijkstra
/usr/lib/gcc/aarch64-poky-linux/6.2.0/../../../../aarch64-poky-linux/bin/ld: CMakeFiles/Dijkstra.dir/oclDijkstraKernel.cpp.o: undefined reference to symbol 'pthread_join@@GLIBC_2.17'
//lib/libpthread.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [src/Chapter_16/Dijkstra/CMakeFiles/Dijkstra.dir/build.make:123: src/Chapter_16/Dijkstra/Dijkstra] Error 1
make[1]: *** [CMakeFiles/Makefile2:537: src/Chapter_16/Dijkstra/CMakeFiles/Dijkstra.dir/all] Error 2
make: *** [Makefile:84: all] Error 2

ghost avatar Nov 08 '18 11:11 ghost

You can fix this error by adding -lpthread to Chapter_16/Djikstra/CMakeLists.txt

target_link_libraries( Dijkstra ${OPENCL_LIBRARIES} ${Boost_LIBRARIES} -lpthread )

aforembs avatar Nov 28 '18 18:11 aforembs