CUDA, OpenCV, C++11 on Shield Tablet

Hi guys,

I have created an Android app that uses CUDA and OpenCV. I used TADP and a NDK standalone toolchain 4.6. I would love to be able to use C++11 features but I was not able to figure out what I need to do. I tried making standalone toolchain based on 4.8 but it did not help.

I created the toolchain using:

./ --platform=android-19 --install-dir=/home/mpeniak/NVPACK/android-ndk-r10c/toolchains/arm-linux-androideabi-4.8/gen_standalone/linux-x86_64 --arch=arm --toolchain=arm-linux-androideabi-4.8 --stl=gnustl --ndk-dir=$NDK_ROOT --system=linux-x86_64

This is a relevant snippet from the makefile:

NVCC=$(CUDA_TOOLKIT_ROOT)/bin/nvcc -ccbin $(GCC) -target-cpu-arch=ARM -m32 -arch=sm_32 -O3 -Xptxas '-dlcm=ca' -target-os-variant=Android

OPENSSL_INCLUDE = $(NDK_ROOT)/platform_external_openssl-master/include

CFLAGS += $(addprefix -I, $(HEADERS) $(OPENCV_INCLUDE))
CXXFLAGS += -std=c++11

I get:

error: 'to_string' is not a member of 'std'
         string s = std::to_string(2);

Could anyone please help me and point me to right direction?


Martin Peniak

hi martin!
i’am working with the nvidia shield tablet aswell.

i’am quite a beginner and unfortunatly i just have this stackoverflow thread wich you might know allready to add to your problem:

i have a different problem concerning the CUDA ARCH - i got a “invalid device function” error altough i defined the ARCH_BIN to 3.2 (for Kepler) as you did. may i ask wich CUDA-Toolkit Version u use for the build?