- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I am a non-linux expert but its getting better...however I do not get how I can make it work. First a very basic question:
1. Question: Do I have to install or run anything on Linux in order to use TBB? Or do I just have to write the correct Android.mk? I still dont get it because I saw some people installing it using g++ test1.cpp -ltbb and sudo apt-get install tbb-examples. In my "TBB-main-folder"/bin are two files named tbbvars.csh and tbbvars.sh. As someone posted in a forum I used sh tbbvars.sh in that folder but I got the message ERROR: Unknown switch ''. Accepted values: ia32, intel64, android
I have an Android project with a working JNI environment. So my basic Android.mk is set up and works fine with some C++ functions. Moreover the TooN library has also been included using Android.mk (so I even got an example!). Now my Android.mk looks like this, whereas the bold letters are what I added:
MY_LOCAL_PATH:= $(call my-dir)
LOCAL_PATH:= $(MY_LOCAL_PATH)
TBB_PATH := /folderA/folderB/folderC/"TBB-main-folder"
include $(CLEAR_VARS)
LOCAL_MODULE := mainfile
LOCAL_SRC_FILES := class1.cpp \
folder/class2.cpp \
folder/class3.cpp \
LOCAL_CFLAGS += -DTBB_USE_GCC_BUILTINS -std=c++11 -I/$(TBB_PATH)/include
LOCAL_CFLAGS :=-D__GXX_EXPERIMENTAL_CXX0X__ -DANDROID (=> the setting I had before by default)
LOCAL_CPPFLAGS := -std=c++11
ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
LOCAL_CFLAGS += -DM_HAVE_NEON -mfloat-abi=softfp -mfpu=neon -march=armv7-a -funsafe-math-optimizations -mfpu=neon
LOCAL_ARM_NEON := true
endif
LOCAL_LDLIBS += -llog -landroid -ldl -lEGL -lGLESv2 -ltbb -L./ (=> when I include it HERE it gives me the error that it cant find ltbb and not even compiles)
LOCAL_STATIC_LIBRARIES += TooN gvars3
include $(BUILD_SHARED_LIBRARY)
$(call import-module,TooN)
LOCAL_PATH := $(call my-dir)
LOCAL_PATH := $(TBB_PATH)/lib/android/
include $(CLEAR_VARS)
LOCAL_MODULE := tbb-native
LOCAL_SRC_FILES := libtbb.so \
include $(PREBUILT_SHARED_LIBRARY)
-L$(TBB_PATH)/lib/android/ \
LOCAL_LDLIBS += -ltbb -L. (=> when I include it HERE it compiles but I get a long list of compiler error messages)
include $(BUILD_SHARED_LIBRARY)
I get the following error messages in my compiler:
In function `operator new(unsigned long, tbb::internal::allocate_continuation_proxy const&)':
//scratch_net/biwidl104/chdorn/TBB/include/tbb/task.h:984: undefined reference to `tbb::internal::allocate_continuation_proxy::allocate(unsigned long) etc.................
2. Question: In some other posts the answer was usually "you should add the tbb library to the linker command line". I have no idea what it means, should I install something or change my Android.mk?
Thanks.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Christian, I suggest to start from the tutorial https://software.intel.com/en-us/android/articles/android-tutorial-writing-a-multithreaded-application-using-intel-threading-building-blocks.
Christian G. wrote:
1. Question: Do I have to install or run anything on Linux in order to use TBB? Or do I just have to write the correct Android.mk? I still dont get it because I saw some people installing it using g++ test1.cpp -ltbb and sudo apt-get install tbb-examples. In my "TBB-main-folder"/bin are two files named tbbvars.csh and tbbvars.sh. As someone posted in a forum I used sh tbbvars.sh in that folder but I got the message ERROR: Unknown switch ''. Accepted values: ia32, intel64, android
sudo apt-get install tbb-examples is used on Linux OSes where tbb is availalbe in the repository. we propose to use the latest bits from https://www.threadingbuildingblocks.org/download. there is simple zip archive to unpack. android libraries are availalbe in linux binary package. For example for TBB 4.3 U1 https://www.threadingbuildingblocks.org/sites/default/files/software_releases/linux/tbb43_20141023oss_lin.tgz. tbbvars.sh script does not help for android
In the folder /folderA/folderB/folderC/"TBB-main-folder"/examples/parallel_for/tachyon/android/jni/Android.mk you can find an example which should work out of the box (at least native part).
Christian G. wrote:
LOCAL_LDLIBS += -llog -landroid -ldl -lEGL -lGLESv2 -ltbb -L./ (=> when I include it HERE it gives me the error that it cant find ltbb and not even compiles)
You need to have a library for required architecture and set a path to it. For IA32 for U1 it will be
LOCAL_LDLIBS += -llog -landroid -ldl -lEGL -lGLESv2 -ltbb -L./ -L.$(TBB_PATH)/lib/android
_without tailing slash_. For other architectures the library needs to be built from sources
Christian G. wrote:
-L$(TBB_PATH)/lib/android/ \LOCAL_LDLIBS += -ltbb -L. (=> when I include it HERE it compiles but I get a long list of compiler error messages)
...I get the following error messages in my compiler:
In function `operator new(unsigned long, tbb::internal::allocate_continuation_proxy const&)':
//scratch_net/biwidl104/chdorn/TBB/include/tbb/task.h:984: undefined reference to `tbb::internal::allocate_continuation_proxy::allocate(unsigned long) etc.................This means that TBB is not found. Why did you include "-L$(TBB_PATH)/lib/android/" before "LOCAL_LDLIBS"?Christian G. wrote:
2. Question: In some other posts the answer was usually "you should add the tbb library to the linker command line". I have no idea what it means, should I install something or change my Android.mk?this basically means -ltbb. Or
LOCAL_LDLIBS += -llog -landroid -ldl -lEGL -lGLESv2 -ltbb -L./ -L.$(TBB_PATH)/lib/android
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page