-
-
Notifications
You must be signed in to change notification settings - Fork 205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'to_string' is not a member of 'std' while cross compile with android-ndk-11c #65
Comments
I am not too familiar with Android either, but perhaps you can run your build-system in a verbose manner? So after running CMake, you'll probably run something like make or nmake, right? In that case, can you for example run |
I try it. But everything seems ok, and I can not find what wrong with it. However I override "std::to_string" and the same functions such as "stoi", and it works. Thank you for your help. |
What do you mean, you 'override' them? Did you define and implement those functions yourself? Can you post the complete solution in case other people also encounter this problem? Thanks! |
Yes,In cross compile a lot of people encounter the error that 'to_string' is not a member of 'std', the same as "stoi","stof","stod" and so on. Even if they use -std=c++11 to compile these functions, they can not solve it and find nothing about the reason. So I fulfill these functions instead of using them. Because they are too simple. Such as However, I cross-compile CLBlast successfully, but in arm, when running the function, likes CLBlast::Gemm, it failed. I am now looking for the reason. But can CLBlast run in the arm? |
OK, thanks for the details, hopefully that helps others trying to cross-compile for Android. The library has been tested on ARM before with success, but I never tried Android. Note that if the used device (Mali, Adreno, ...) is not tuned for, performance might be sub-optimal. But let's first try to get it to work. First step would be to compile the tests ( |
I know it's been a while, but I've now implemented the missing functions (when using GCC's |
When I cross compile with android-ndk-11c,I got the error:
CLBlast/include/internal/clpp11.h:129:70: error: 'to_string' is not a member of 'std'
Someone say that using -std=c++11. But I have find it in the CMakeList.txt:
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
set(FLAGS "/Ox")
set(FLAGS "${FLAGS} /wd4715")
else ()
set(FLAGS "-O3 -std=c++11")
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
I am not familiar with cross compile and ndk. So my cmake configure is:
cmake -DCMAKE_AR=$TOOLCHAIN_DIR/arm-linux-androideabi-ar
-DCMAKE_C_COMPILER=$TOOLCHAIN_DIR/arm-linux-androideabi-gcc
-DCMAKE_CXX_COMPILER=$TOOLCHAIN_DIR/arm-linux-androideabi-g++
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_LINKER=$TOOLCHAIN_DIR/arm-linux-androideabi-ld
-DCMAKE_NM=$TOOLCHAIN_DIR/arm-linux-androideabi-nm
-DCMAKE_OBJCOPY=$TOOLCHAIN_DIR/arm-linux-androideabi-objcopy
-DCMAKE_OBJDUMP=$TOOLCHAIN_DIR/arm-linux-androideabi-objdump
-DCMAKE_RANLIB=$TOOLCHAIN_DIR/arm-linux-androideabi-ranlib
-DCMAKE_STRIP=$TOOLCHAIN_DIR/arm-linux-androideabi-strip
-DCMAKE_INSTALL_PREFIX=$INSTALL_DIR/CLBlast
-DOPENCL_INCLUDE_DIRS=$INSTALL_DIR/MaliOpenCL/include
-DOPENCL_LIBRARIES=$$INSTALL_DIR/MaliOpenCL/lib/libGLES_mali.so $CLBLAST_ROOT
Is that something wrong above or Would you tell me how to solve the problem?
Thank you!
The text was updated successfully, but these errors were encountered: