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:

./make-standalone-toolchain.sh --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:

GCC=$(NDK_ROOT)/toolchains/arm-linux-androideabi-4.8/gen_standalone/linux-x86_64/bin/arm-linux-androideabi-g++
NVCC=$(CUDA_TOOLKIT_ROOT)/bin/nvcc -ccbin $(GCC) -target-cpu-arch=ARM -m32 -arch=sm_32 -O3 -Xptxas '-dlcm=ca' -target-os-variant=Android
CUDA_INCLUDE=$(CUDA_TOOLKIT_ROOT)/include

OPENCV_INCLUDE = $(NDK_ROOT)/../OpenCV-2.4.8.2-Tegra-sdk/sdk/native/jni/include
OPENSSL_INCLUDE = $(NDK_ROOT)/platform_external_openssl-master/include

CFLAGS += $(addprefix -I, $(HEADERS) $(OPENCV_INCLUDE))
CFLAGS += -DMOBILE 
CXXFLAGS += $(addprefix -I, $(CUDA_INCLUDE) $(OPENCV_INCLUDE) $(OPENSSL_INCLUDE) $(HEADERS))
CXXFLAGS += -DMOBILE
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?

Thanks,

Martin Peniak
www.martinpeniak.com

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:
http://stackoverflow.com/questions/16149538/cuda-and-thrust-library-trouble-with-using-cuh-cu-and-cpp-files-together-wit

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?