projectNe10 / Ne10

An open optimized software library project for the ARM® Architecture
Other
1.46k stars 409 forks source link

NE10_fft_generic_float32.neonintrisic.cpp fails to build for Android #92

Closed ColinGilbert closed 9 years ago

ColinGilbert commented 9 years ago

Hi, I receive the error mentioned above upon attempting compilation. First, here is the cmake output:

noob@NoobKing ~/newEngine/Ne10/build $ cmake .. -DCMAKE_TOOLCHAIN_FILE=/home/noob/newEngine/Ne10/android/android_config.cmake
-- The C compiler identification is GNU 4.6.0
-- The CXX compiler identification is GNU 4.6.0
-- The ASM compiler identification is GNU
-- Found assembler: /home/noob/android/android-ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/arm-linux-androideabi-as
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - failed
-- Building type: RELEASE
loaded toolchain:
    /home/noob/android/android-ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc
    /home/noob/android/android-ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++
    /home/noob/android/android-ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/arm-linux-androideabi-as
    /home/noob/android/android-ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/arm-linux-androideabi-ar
    /home/noob/android/android-ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/arm-linux-androideabi-ranlib
-- Configuring done
-- Generating done
-- Build files have been written to: /home/noob/newEngine/Ne10/build

And the actual error:

noob@NoobKing ~/newEngine/Ne10/build $  make -j8
[  0%] [  1%] [  1%] [  2%] [  4%] [  4%] [  4%] [  5%] Building C object modules/CMakeFiles/NE10.dir/math/NE10_dot.neon.s.o
Building CXX object modules/CMakeFiles/NE10.dir/dsp/NE10_fft_generic_float32.neonintrinsic.cpp.o
Building C object modules/CMakeFiles/NE10.dir/math/NE10_mulmat.neon.s.o
Building C object modules/CMakeFiles/NE10.dir/math/NE10_cross.neon.s.o
Building C object modules/CMakeFiles/NE10.dir/math/NE10_invmat.neon.s.o
Building C object modules/CMakeFiles/NE10.dir/math/NE10_transmat.neon.s.o
Building C object modules/CMakeFiles/NE10.dir/math/NE10_detmat.neon.s.o
Building C object modules/CMakeFiles/NE10.dir/math/NE10_mulcmatvec.neon.s.o
[  6%] Building C object modules/CMakeFiles/NE10.dir/math/NE10_identitymat.neon.s.o
[  6%] [  7%] [  8%] [  9%] Building C object modules/CMakeFiles/NE10.dir/dsp/NE10_fft_int32.neon.s.o
Building C object modules/CMakeFiles/NE10.dir/dsp/NE10_fft_float32.neon.s.o
Building C object modules/CMakeFiles/NE10.dir/dsp/NE10_fft_int16.neon.s.o
[ 10%] [ 11%] Building C object modules/CMakeFiles/NE10.dir/dsp/NE10_iir.neon.s.o
Building C object modules/CMakeFiles/NE10.dir/dsp/NE10_fir.neon.s.o
Building C object modules/CMakeFiles/NE10.dir/imgproc/NE10_rotate.neon.s.o
[ 12%] [ 12%] [ 13%] [ 14%] Building C object modules/CMakeFiles/NE10.dir/NE10_init.c.o
Building C object modules/CMakeFiles/NE10.dir/physics/NE10_physics.neon.s.o
Building C object modules/CMakeFiles/NE10.dir/dsp/NE10_init_dsp.c.o
[ 14%] Building C object modules/CMakeFiles/NE10.dir/math/NE10_init_math.c.o
[ 15%] Building C object modules/CMakeFiles/NE10.dir/imgproc/NE10_init_imgproc.c.o
Building C object modules/CMakeFiles/NE10.dir/physics/NE10_init_physics.c.o
/home/noob/newEngine/Ne10/modules/dsp/NE10_fft_generic_float32.neonintrinsic.cpp: In function 'void NE10_LOAD_TW_AND_MUL(CPLX&, const ne10_fft_cpx_float32_t*)':
/home/noob/newEngine/Ne10/modules/dsp/NE10_fft_generic_float32.neonintrinsic.cpp:70:57: error: invalid types 'float32x2_t {aka __vector(2) __builtin_neon_sf}[int]' for array subscript
/home/noob/newEngine/Ne10/modules/dsp/NE10_fft_generic_float32.neonintrinsic.cpp:71:57: error: invalid types 'float32x2_t {aka __vector(2) __builtin_neon_sf}[int]' for array subscript
modules/CMakeFiles/NE10.dir/build.make:1253: recipe for target 'modules/CMakeFiles/NE10.dir/dsp/NE10_fft_generic_float32.neonintrinsic.cpp.o' failed
make[2]: *** [modules/CMakeFiles/NE10.dir/dsp/NE10_fft_generic_float32.neonintrinsic.cpp.o] Error 1
CMakeFiles/Makefile2:78: recipe for target 'modules/CMakeFiles/NE10.dir/all' failed
make[1]: *** [modules/CMakeFiles/NE10.dir/all] Error 2
Makefile:116: recipe for target 'all' failed
make: *** [all] Error 2

If there are any other files you wish to review, please ask and I shall provide them.

Phillip-Wang commented 9 years ago

Information you provided is good enough. We set GCC 4.6 as default C compiler for ARMv7-A or ARMv8-A (AArch32 mode). You can set environment variable _ARM_ANDROID_TOOLCHAINVERSION to 4.8 or 4.9. It should be OK. Thanks.

ColinGilbert commented 9 years ago

Confirmed; setting the compiler to 4.9 in ${NE10_ROOT}/android/android_config.cmake allowed compilation perfectly!

hammond-1978 commented 9 years ago

Hi all !

I'm trying to build NE10 for Linux and I got the same issue of ColinGilbert.

Here the console output:

bbblack@BB-Dev-Station:~/projectNe10-Ne10-v1.2.0-27-gd1071c8/projectNe10-Ne10-d1071c8/build$ cmake -DNE10_LINUX_TARGET_ARCH=armv7 -DGNULINUX_PLATFORM=ON -DCMAKE_TOOLCHAIN_FILE=../config.cmake .. -- The C compiler identification is GNU 4.7.3 -- The CXX compiler identification is GNU 4.7.3 -- The ASM compiler identification is GNU -- Found assembler: /home/bbblack/sdk-linux-am335x-evm-01.00.00.00/linux-devkit/sysroots/i686-arago-linux/usr/bin/arm-linux-gnueabihf-as -- Check for working C compiler: /home/bbblack/sdk-linux-am335x-evm-01.00.00.00/linux-devkit/sysroots/i686-arago-linux/usr/bin/arm-linux-gnueabihf-gcc -- Check for working C compiler: /home/bbblack/sdk-linux-am335x-evm-01.00.00.00/linux-devkit/sysroots/i686-arago-linux/usr/bin/arm-linux-gnueabihf-gcc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working CXX compiler: /home/bbblack/sdk-linux-am335x-evm-01.00.00.00/linux-devkit/sysroots/i686-arago-linux/usr/bin/arm-linux-gnueabihf-g++ -- Check for working CXX compiler: /home/bbblack/sdk-linux-am335x-evm-01.00.00.00/linux-devkit/sysroots/i686-arago-linux/usr/bin/arm-linux-gnueabihf-g++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Target architecture : armv7 -- Building type: RELEASE -- Configuring done -- Generating done -- Build files have been written to: /home/bbblack/projectNe10-Ne10-v1.2.0-27-gd1071c8/projectNe10-Ne10-d1071c8/build

bbblack@BB-Dev-Station:~/projectNe10-Ne10-v1.2.0-27-gd1071c8/projectNe10-Ne10-d1071c8/build$ make Scanning dependencies of target NE10 [ 0%] Building C object modules/CMakeFiles/NE10.dir/math/NE10_abs.c.o [ 1%] Building C object modules/CMakeFiles/NE10.dir/math/NE10_addc.c.o [ 2%] Building C object modules/CMakeFiles/NE10.dir/math/NE10_add.c.o [ 3%] Building C object modules/CMakeFiles/NE10.dir/math/NE10_divc.c.o [ 4%] Building C object modules/CMakeFiles/NE10.dir/math/NE10_div.c.o [ 5%] Building C object modules/CMakeFiles/NE10.dir/math/NE10_len.c.o [ 5%] Building C object modules/CMakeFiles/NE10.dir/math/NE10_mlac.c.o [ 6%] Building C object modules/CMakeFiles/NE10.dir/math/NE10_mla.c.o [ 7%] Building C object modules/CMakeFiles/NE10.dir/math/NE10_mulc.c.o [ 8%] Building C object modules/CMakeFiles/NE10.dir/math/NE10_mul.c.o [ 9%] Building C object modules/CMakeFiles/NE10.dir/math/NE10_normalize.c.o [ 10%] Building C object modules/CMakeFiles/NE10.dir/math/NE10_rsbc.c.o [ 11%] Building C object modules/CMakeFiles/NE10.dir/math/NE10_setc.c.o [ 11%] Building C object modules/CMakeFiles/NE10.dir/math/NE10_subc.c.o [ 12%] Building C object modules/CMakeFiles/NE10.dir/math/NE10_sub.c.o [ 13%] Building C object modules/CMakeFiles/NE10.dir/math/NE10_dot.c.o [ 14%] Building C object modules/CMakeFiles/NE10.dir/math/NE10_cross.c.o [ 15%] Building C object modules/CMakeFiles/NE10.dir/math/NE10_addmat.c.o [ 16%] Building C object modules/CMakeFiles/NE10.dir/math/NE10_submat.c.o [ 17%] Building C object modules/CMakeFiles/NE10.dir/math/NE10_mulmat.c.o [ 17%] Building C object modules/CMakeFiles/NE10.dir/math/NE10_mulcmatvec.c.o [ 18%] Building C object modules/CMakeFiles/NE10.dir/math/NE10_detmat.c.o [ 19%] Building C object modules/CMakeFiles/NE10.dir/math/NE10_invmat.c.o [ 20%] Building C object modules/CMakeFiles/NE10.dir/math/NE10_transmat.c.o [ 21%] Building C object modules/CMakeFiles/NE10.dir/math/NE10_identitymat.c.o [ 22%] Building C object modules/CMakeFiles/NE10.dir/__/common/NE10_mask_table.c.o [ 23%] Building C object modules/CMakeFiles/NE10.dir/dsp/NE10_fft.c.o [ 23%] Building C object modules/CMakeFiles/NE10.dir/dsp/NE10_fft_float32.c.o [ 24%] Building C object modules/CMakeFiles/NE10.dir/dsp/NE10_fft_generic_float32.c.o [ 25%] Building CXX object modules/CMakeFiles/NE10.dir/dsp/NE10_fft_generic_int32.cpp.o [ 26%] Building C object modules/CMakeFiles/NE10.dir/dsp/NE10_rfft_float32.c.o [ 27%] Building C object modules/CMakeFiles/NE10.dir/dsp/NE10_fft_int32.c.o [ 28%] Building C object modules/CMakeFiles/NE10.dir/dsp/NE10_fft_int16.c.o [ 29%] Building C object modules/CMakeFiles/NE10.dir/dsp/NE10_fir.c.o [ 29%] Building C object modules/CMakeFiles/NE10.dir/dsp/NE10_fir_init.c.o [ 30%] Building C object modules/CMakeFiles/NE10.dir/dsp/NE10_iir.c.o [ 31%] Building C object modules/CMakeFiles/NE10.dir/dsp/NE10_iir_init.c.o [ 32%] Building C object modules/CMakeFiles/NE10.dir/imgproc/NE10_resize.c.o [ 33%] Building C object modules/CMakeFiles/NE10.dir/imgproc/NE10_rotate.c.o [ 34%] Building C object modules/CMakeFiles/NE10.dir/imgproc/NE10_boxfilter.c.o [ 35%] Building C object modules/CMakeFiles/NE10.dir/physics/NE10_physics.c.o [ 35%] Building C object modules/CMakeFiles/NE10.dir/math/NE10_addc.neon.c.o [ 36%] Building C object modules/CMakeFiles/NE10.dir/math/NE10_divc.neon.c.o [ 37%] Building C object modules/CMakeFiles/NE10.dir/math/NE10_mlac.neon.c.o [ 38%] Building C object modules/CMakeFiles/NE10.dir/math/NE10_mulc.neon.c.o [ 39%] Building C object modules/CMakeFiles/NE10.dir/math/NE10_rsbc.neon.c.o [ 40%] Building C object modules/CMakeFiles/NE10.dir/math/NE10_setc.neon.c.o [ 41%] Building C object modules/CMakeFiles/NE10.dir/math/NE10_subc.neon.c.o [ 41%] Building C object modules/CMakeFiles/NE10.dir/math/NE10_addmat.neon.c.o [ 42%] Building C object modules/CMakeFiles/NE10.dir/math/NE10_submat.neon.c.o [ 43%] Building C object modules/CMakeFiles/NE10.dir/dsp/NE10_fft_float32.neon.c.o [ 44%] Building C object modules/CMakeFiles/NE10.dir/dsp/NE10_fft_int32.neon.c.o [ 45%] Building C object modules/CMakeFiles/NE10.dir/dsp/NE10_fft_int16.neon.c.o [ 46%] Building CXX object modules/CMakeFiles/NE10.dir/dsp/NE10_fft_generic_float32.neonintrinsic.cpp.o /home/bbblack/projectNe10-Ne10-v1.2.0-27-gd1071c8/projectNe10-Ne10-d1071c8/modules/dsp/NE10_fft_generic_float32.neonintrinsic.cpp: In function ‘void NE10_LOAD_TW_AND_MUL(CPLX&, const ne10_fft_cpx_float32t)’: /home/bbblack/projectNe10-Ne10-v1.2.0-27-gd1071c8/projectNe10-Ne10-d1071c8/modules/dsp/NE10_fft_generic_float32.neonintrinsic.cpp:70:57: error: invalid types ‘float32x2_t {aka vector(2) builtin_neon_sf}[int]’ for array subscript /home/bbblack/projectNe10-Ne10-v1.2.0-27-gd1071c8/projectNe10-Ne10-d1071c8/modules/dsp/NE10_fft_generic_float32.neonintrinsic.cpp:71:57: error: invalid types ‘float32x2_t {aka vector(2) builtin_neonsf}[int]’ for array subscript make[2]: ** [modules/CMakeFiles/NE10.dir/dsp/NE10_fft_generic_float32.neonintrinsic.cpp.o] Errore 1 make[1]: * [modules/CMakeFiles/NE10.dir/all] Errore 2 make: * [all] Errore 2

I tried to add this condition to GNUlinux_config.cmake:

if(NOT DEFINED ENV{ARM_LINUX_TOOLCHAIN_VERSION}) set(ARM_LINUX_TOOLCHAIN_VERSION 4.7) else() set(ARM_LINUX_TOOLCHAIN_VERSION $ENV{ARM_LINUX_TOOLCHAIN_VERSION}) endif()

but the behaviour is the same.

Any suggestion ?

Thanks in advance.

Phillip-Wang commented 9 years ago

Hi @hammond-1978 , could you try a newer gcc? Such as 4.8? If this problem still exist, please let us know.

hammond-1978 commented 9 years ago

I'm sorry but I don't have a xtoolchain newer than 4.7 ready. I'm trying to build the Linaro 4.8 but it needs time. I'll give you feedback as soon as possible.

winston52 commented 6 years ago

Hi @hammond-1978,Did you slove the problem ? I also got the same problem.