When I try to compile the library for Android I find the following bugs and errors (MSVS 2017 ):
General bugs and corrections:
a) bug in the code: in SimdInit.h at line 139 there is an extra } in the middle of the line which must be removed.
b) In SimdView.hpp in functions template <class A=""> SIMD_INLINE bool View<A>::Load(const std::string & path) and template <class A=""> SIMD_INLINE bool View<A>::Save(const std::string & path) const
the following must be added:
66 Error messages in SimdConst.h with too many initializer values:
Severity Code Description Project File Line Suppression State
Error (active) E0146 too many initializer values SimdConst.h 100
The project compiles but shows the error messages above.
1 fatal error: simd/SimdEnable.h(44,10): fatal error : 'sys/auxv.h' file not found #include <sys/auxv.h>
1 error message: Severity Code Description Project File Line Suppression State
Error (active) E0020 identifier "__fp16" is undefined c:\ProgramData\Microsoft\AndroidNDK64\android-ndk-r13b\toolchains\llvm\prebuilt\windows-x86_64\lib64\clang\3.8.256229\include\arm_neon.h 34
60 Error messages in SimdConst.h with too many initializer values:
Severity Code Description Project File Line Suppression State
Error (active) E0146 too many initializer values SimdConst.h 488
Thank you Ihar!
The projects compile now without errors in VS2017 but strangely there are still many errors showing up when opening some of the files in the editor as e.g. SimdConst.h (many of the errors I have mentioned above). Do you have any idea why this is happening and if this will influece the working of the software?
Best regards, Zoltan
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I think it happens because Visual Studio and GCC(Clang) have different internal representation of SIMD vectors. In my project I use special macros for initialization of global constant vectors which use internal vector representation and don't use SIMD instructions. I do this because global constant vectors are initilaized before checking of supporting SIMD by CPU.
When you use Visual Studio to create Android application you use Visual Studio editor and Clang(GCC) compiler. And the last one defines platform specific macros which incorrect processed by Visual Studio editor.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
When I try to compile the library for Android I find the following bugs and errors (MSVS 2017 ):
General bugs and corrections:
a) bug in the code: in SimdInit.h at line 139 there is an extra } in the middle of the line which must be removed.
b) In SimdView.hpp in functions template <class A=""> SIMD_INLINE bool View<A>::Load(const std::string & path) and template <class A=""> SIMD_INLINE bool View<A>::Save(const std::string & path) const
the following must be added:
c) the "-lm" option must be added to the linker (it does not find the math functions).
Platform problems
I am not sure if this is a problem with Simd or MSVS!? Is there an other way to compile a Dynamic Library (.so) for Android?
Compile for x86:
Command line parameters: "-fpic "pch.h" -fstack-protector "x86\Release\" -Wall -fno-strict-aliasing -ffunction-sections -I "C:\ProgramData\Microsoft\AndroidNDK64\android-ndk-r13b\platforms\android-19\arch-x86\usr\include" -I "C:\ProgramData\Microsoft\AndroidNDK64\android-ndk-r13b\sources\cxx-stl\gnu-libstdc++\4.9\include" -I "C:\ProgramData\Microsoft\AndroidNDK64\android-ndk-r13b\sources\cxx-stl\gnu-libstdc++\4.9\libs\x86\include" -I "C:\ProgramData\Microsoft\AndroidNDK64\android-ndk-r13b\sources\cxx-stl\gnu-libstdc++\4.9\include\backward" -gline-tables-only -O3 -x c++-header -D "NDEBUG" -fno-rtti -fomit-frame-pointer -fdata-sections -fexceptions -o "x86\Release\%(filename).o" -fno-short-enums "
66 Error messages in SimdConst.h with too many initializer values:
Severity Code Description Project File Line Suppression State
Error (active) E0146 too many initializer values SimdConst.h 100
The project compiles but shows the error messages above.
Compile for ARM:
Command line parameters: "-o"Android_Simd.so" -Wl,-rpath-link="C:\ProgramData\Microsoft\AndroidNDK64\android-ndk-r13b\platforms\android-19\arch-arm\usr\lib" -Wl,-z,relro -shared -Wl,-z,noexecstack -Wl,--no-undefined -l"gnustl_static" -l"log" -l"android" -Wl,-L"C:\ProgramData\Microsoft\AndroidNDK64\android-ndk-r13b\platforms\android-19\arch-arm\usr\lib" -Wl,-L"C:\ProgramData\Microsoft\AndroidNDK64\android-ndk-r13b\toolchains\arm-linux-androideabi-4.9\prebuilt\windows-x86_64\lib\gcc\arm-linux-androideabi\4.9.x\armv7-a" -Wl,-L"C:\ProgramData\Microsoft\AndroidNDK64\android-ndk-r13b\sources\cxx-stl\gnu-libstdc++\4.9\libs\armeabi-v7a" -Wl,-z,now "
1 fatal error: simd/SimdEnable.h(44,10): fatal error : 'sys/auxv.h' file not found
#include <sys/auxv.h>
1 error message: Severity Code Description Project File Line Suppression State
Error (active) E0020 identifier "__fp16" is undefined c:\ProgramData\Microsoft\AndroidNDK64\android-ndk-r13b\toolchains\llvm\prebuilt\windows-x86_64\lib64\clang\3.8.256229\include\arm_neon.h 34
60 Error messages in SimdConst.h with too many initializer values:
Severity Code Description Project File Line Suppression State
Error (active) E0146 too many initializer values SimdConst.h 488
The project does not compile.
Compile for ARM64:
Command line parameters: " -o"Android_Simd.so" -Wl,-rpath-link="C:\ProgramData\Microsoft\AndroidNDK64\android-ndk-r13b\platforms\android-21\arch-arm64\usr\lib" -Wl,-z,relro -shared -Wl,-z,noexecstack -Wl,--no-undefined -l"gnustl_static" -l"log" -l"android" -Wl,-L"C:\ProgramData\Microsoft\AndroidNDK64\android-ndk-r13b\platforms\android-21\arch-arm64\usr\lib" -Wl,-L"C:\ProgramData\Microsoft\AndroidNDK64\android-ndk-r13b\toolchains\aarch64-linux-android-4.9\prebuilt\windows-x86_64\lib\gcc\aarch64-linux-android\4.9.x" -Wl,-L"C:\ProgramData\Microsoft\AndroidNDK64\android-ndk-r13b\sources\cxx-stl\gnu-libstdc++\4.9\libs\arm64-v8a" -Wl,-z,now "
1 error message: Severity Code Description Project File Line Suppression State
Error (active) E0020 identifier "__int128" is undefined c:\ProgramData\Microsoft\AndroidNDK64\android-ndk-r13b\sources\cxx-stl\gnu-libstdc++\4.9\include\cstdlib 178
1 error message: Severity Code Description Project File Line Suppression State
Error (active) E0020 identifier "__int128" is undefined c:\ProgramData\Microsoft\AndroidNDK64\android-ndk-r13b\sources\cxx-stl\gnu-libstdc++\4.9\include\cstdlib 179
The above is in the code:
The project compiles but shows the error messages above.
Last edit: ZSO 2017-04-05
Thank you for bug report.
I have added a Visual Studio solution for Android.
It is placed in prj/vs2017a.
Thank you Ihar!
The projects compile now without errors in VS2017 but strangely there are still many errors showing up when opening some of the files in the editor as e.g. SimdConst.h (many of the errors I have mentioned above). Do you have any idea why this is happening and if this will influece the working of the software?
Best regards, Zoltan
I think it happens because Visual Studio and GCC(Clang) have different internal representation of SIMD vectors. In my project I use special macros for initialization of global constant vectors which use internal vector representation and don't use SIMD instructions. I do this because global constant vectors are initilaized before checking of supporting SIMD by CPU.
When you use Visual Studio to create Android application you use Visual Studio editor and Clang(GCC) compiler. And the last one defines platform specific macros which incorrect processed by Visual Studio editor.