Library building issues with validation_tests=1 benchmark_tests=1
Dear ARM developers:
I have tried to build the newest version of the library with flag validation_tests =1 and benchmark_tests=1, but I encounter some errors that I do not know how to approach to this problem. Can you give me some hints?
here is building options:
scons Werror=1 -j8 debug=1 asserts=1 neon=0 opencl=1 embed_kernels=1 os=linux arch=armv7a validation_tests=1 benchmark_tests=1
However, I get the following error message:

Thanks!
As your screen shot shows this seems to be an internal error with GCC. I can try to reproduce but even then it won't help you much as it's unlikely we're in a position to fix this bug.
From what I see in the screen shot you seem to use GCC 5 whereas our testing is done with GCC 4.9. Can you try with that version? You can get it for example for Linaro: http://releases.linaro.org/components/toolchain/binaries/latest-4/arm-linux-gnueabihf/
@jialiang19 Such errors often happen when the compiler runs out of memory. Please try reducing the number of build threads ("-j1").
Thank you for the inputs. I believed that the internal compiler error is caused by running out of memory. So I changed the build threads from "-j8" to "j1". The old problem disappeared, but there is a new issue now.

/usr/lib/gcc/arm-linux-gnueabihf/5/../../../arm-linux-gnueabihf/crt1.o: In function `_start':
(.text+0x28): undefined reference to `main'
For the validation tests the main function is provided by the Boost Test library. For Boost to include main you have to link statically against boost_unit_test_framework and Boost itself has to be built with define=BOOST_TEST_ALTERNATIVE_INIT_API
For example,
./b2 --with-program_options --with-test link=static define=BOOST_TEST_ALTERNATIVE_INIT_API
The documentation has slightly more information about how to build Boost: https://arm-software.github.io/ComputeLibrary/v17.06/tests.xhtml#building_boost
Can you please check if your Boost library is built correctly. You can check if libboost_unit_test_framework.a contains the main function by running:
nm ./libboost_unit_test_framework.a | grep main
That should output something like:
unit_test_main.o:
00000011 t _GLOBAL__sub_I__ZN5boost9unit_test14unit_test_mainEPFbvEiPPc
00000001 T _ZN5boost9unit_test14unit_test_mainEPFbvEiPPc
00000001 T main
Hey, @mpflanzer, Thank you so much for your help, I just finishing building it successfully. However, I encountered two bugs before I can finishing building.
The first one is that: when both libboost_unit_test_framework.a and libboost_unit_test_framework.so are present. The scon file seems only pick up the libboost_unit_test_framework.so. I can only go around the problem by deleting the libboost_unit_test_framework.so in my boost library.
The second one is that:
arm-linux-gnueabihf-g++ -o build/tests/arm_compute_benchmark build/tests/benchmark/PerformanceProgramOptions.o build/tests/benchmark/PerformanceUserConfiguration.o build/tests/benchmark/Profiler.o build/tests/benchmark/WallClockTimer.o build/tests/benchmark/main.o build/tests/benchmark/CL/ActivationLayer.o build/tests/benchmark/CL/BitwiseAnd.o build/tests/benchmark/CL/ConvolutionLayer.o build/tests/benchmark/CL/FullyConnectedLayer.o build/tests/benchmark/CL/GEMM.o build/tests/benchmark/CL/NormalizationLayer.o build/tests/benchmark/CL/PoolingLayer.o build/tests/benchmark/system_tests/CL/AlexNet.o build/tests/benchmark/system_tests/CL/LeNet5.o build/tests/ProgramOptions.o build/tests/RawTensor.o build/tests/TensorLibrary.o build/tests/UserConfiguration.o -L3rdparty/linux/armv7a -Lbuild -L. -Lbuild/opencl-1.2-stubs -Lopencl-1.2-stubs -Lopencl-1.2-stubs -larm_compute -lboost_program_options -lbenchmark -lOpenCL -lrt
/usr/bin/ld: /home/odroid/Documents/SummerResearch/lib/../lib/libbenchmark.a(benchmark.cc.o): undefined reference to symbol 'pthread_create@@GLIBC_2.4'
//lib/arm-linux-gnueabihf/libpthread.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
scons: *** [build/tests/arm_compute_benchmark] Error 1
scons: building terminated because of errors.
there is a problem with -lpthread.
I can only go around the problem by modifying the scon file.

@jialiang19 , I had exactly the same pthread problem on a Jetson TX1 board. I resolved it after patching the sources as you suggested and building as follows:
$ export LIBRARY_PATH=/home/anton/CK_TOOLS/lib-boost-acl-1.64.0-gcc-5.4.0-linux-64/install/lib:$LIBRARY_PATH
$ export CPATH=/home/anton/CK_TOOLS/lib-gbenchmark-trunk-gcc-5.4.0-linux-64/install/include:$CPATH
$ scons Werror=0 -j4 neon=1 opencl=0 os=linux arch=arm64-v8a build=native benchmark_tests=1
(I installed Boost and Google Benchmark via Collective Knowledge.)
Trying to run the compute benchmark from the build folder, however, leads to an exception:
anton@tegra-ubuntu:~/CK_TOOLS/lib-acl-master-gcc-5.4.0-linux-64/src/build$ ./tests/arm_compute_benchmark --benchmark_list_tests /home/anton/CK_TOOLS/lib-acl-master-gcc-5.4.0-linux-64/src/data/
terminate called after throwing an instance of 'boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::bad_any_cast> >'
what(): boost::bad_any_cast: failed conversion using boost::any_cast
Aborted
Any ideas?
Rebuilding with debug=1...
No, sorry, I've never seen that one before
Google benchmark dependency is now removed, in 17.09 release. Closing issue.