I compile the code, then meet some error. The way I solve the errors is following:
1.If you meet
/usr/lib/gcc/x86_64-linux-gnu/4.6/include/xmmintrin.h(1015): error: identifier "__builtin_ia32_vec_set_v4hi" is undefined/usr/lib/gcc/x86_64-linux-gnu/4.6/include/xmmintrin.h(1116): error: identifier "__builtin_ia32_pshufw" is undefined/usr/lib/gcc/x86_64-linux-gnu/4.6/include/emmintrin.h(1312): error: identifier "__builtin_ia32_vec_ext_v8hi" is undefined/usr/lib/gcc/x86_64-linux-gnu/4.6/include/emmintrin.h(1318): error: identifier "__builtin_ia32_vec_set_v8hi" is undefined4 errors detected in the compilation of "/tmp/tmpxft_00001d10_00000000-6_runCifar100.cpp1.ii".
You can use cuda >=5.5, or do not use the -O2 in compiling
2.If you meet
/usr/local/include/boost/assert.hpp:102:47: error: ‘noinline’ was not declared in this scope
You can add -DBOOST_NOINLINE='__attribute__ ((noinline))'
3.If you meet
/usr/bin/ld: /tmp/tmpxft_00004332_00000000-16_runCifar10Kaggle.o: undefined reference to symbol 'boost::system::system_category()'
/usr/bin/ld: note: 'boost::system::system_category()' is defined in DSO /usr/local/lib/libboost_system.so.1.55.0 so try adding it to the linker command line
/usr/local/lib/libboost_system.so.1.55.0: could not read symbols: Invalid operation
You can add -lboost_system
So the you can compile as:
/usr/local/cuda-5.5/bin/nvcc -DBOOST_NOINLINE='__attribute__ ((noinline))' runCifar10Kaggle.cu readImageToMat.o -lopencv_core -lopencv_highgui -lopencv_imgproc -lrt -lcublas -lboost_thread -lboost_system -ljpeg -arch sm_20 -O2
with —