Thanks,
Keith
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to andro...@googlegroups.com.
To unsubscribe from this group, send email to android-ndk...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
> > > android-ndk+unsubscribe@googlegroups.com.
Thank you for this patch Keith!
I have followed the instructions to a tee and it appeared everything
worked perfect. This was my output for the compile in cygwin. The
only change I made was the -4.4.3 which it required of me.
$ ./build/tools/build-gcc.sh $(pwd)/src $(pwd) arm-linux-
androideabi-4.4.3
To follow build in another terminal, please use: tail -F /tmp/ndk-
jbradshaw/build/toolchain/config.log
Using C compiler: gcc
Using C++ compiler: g++
Sysroot : Copying: /cygdrive/c/1data/program-installs/android-ndk-r7b/
platforms/android-9/arch-arm --> /cygdrive/c/1data/program-installs/
android-ndk-r7b/toolchains/arm-linux-androideabi-4.4.3/prebuilt/
windows/sysroot
Configure: arm-linux-androideabi-4.4.3 toolchain build
Building : arm-linux-androideabi-4.4.3 toolchain [this can take a long
time].
Install : arm-linux-androideabi-4.4.3 toolchain binaries.
Done.
You indicate in your post that I should then see a libgomp.a and
supporting files. I see no such files. I assume I should see them in
the toolchain but have searched the entire android-ndk-r7b directory.
The other odd thing (not sure what I'm missing) is that I use #include
<omp.h> and no where in the ndk directory do I see the omp.h header.
when I build in the [android-project]/jni folder I receive the below
output:
$ /cygdrive/c/1data/program-installs/android-ndk-r7b/ndk-build
Gdbserver : [arm-linux-androideabi-4.4.3] libs/armeabi/gdbserver
Gdbsetup : libs/armeabi/gdb.setup
Compile thumb : test <= test.c
C:/1data/Development/test/javaprojects/TestProject/jni/test.c:6:17:
error: omp.h: No such file or directory
/cygdrive/c/1data/program-installs/android-ndk-r7b/build/core/build-
binary.mk:240: recipe for target `/cygdrive/c/1data/Development/test/
javaprojects/TestProject/obj/local/armeabi/objs-debug/test/test.o'
failed
make: *** [/cygdrive/c/1data/Development/test/javaprojects/TestProject/
obj/local/armeabi/objs-debug/test/test.o] Error 1
So the compiler can't find the omp.h header...and frankly, nor can I.
I assumed it would be part of the compiled code.
This is the Android.mk
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
# Here we give our module name and source file(s)
LOCAL_MODULE := test
LOCAL_SRC_FILES := test.c
LOCAL_LDFLAGS += -O3 -fopenmp
include $(BUILD_SHARED_LIBRARY)
I must be missing something simple. Any ideas? :)
Thank you in advance.
OpenMP itself uses threads, that's kind of the point. AFAIR libgcc is responsible for managing this stuff.
> > To post to this group, send email to andro...@googlegroups.com <mailto:android-ndk@googlegroups.com>.
> > To unsubscribe from this group, send email to android-ndk+unsubscribe@googlegroups.com
> <mailto:android-ndk%2Bunsu...@googlegroups.com>.
> > For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups "android-ndk" group.
> To post to this group, send email to andro...@googlegroups.com <mailto:android-ndk@googlegroups.com>.
> To unsubscribe from this group, send email to android-ndk+unsubscribe@googlegroups.com
> <mailto:android-ndk%2Bunsu...@googlegroups.com>.
> For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
>
>
> --
> You received this message because you are subscribed to the Google Groups "android-ndk" group.
> To post to this group, send email to andro...@googlegroups.com <mailto:android-ndk@googlegroups.com>.
> To unsubscribe from this group, send email to android-ndk+unsubscribe@googlegroups.com
> <mailto:android-ndk%2Bunsu...@googlegroups.com>.
> For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups "android-ndk" group.
> To post to this group, send email to andro...@googlegroups.com.
> To unsubscribe from this group, send email to android-ndk+unsubscribe@googlegroups.com.
> > > android-ndk+unsubscribe@googlegroups.com.
> >>> andro...@googlegroups.com <mailto:android-ndk@googlegroups.com>.
> >>> > > To unsubscribe from this group, send email to
> >>> android-ndk+unsubscribe@googlegroups.com
> >>> > <mailto:android-ndk%2Bunsu...@googlegroups.com>.
> >>> > > For more options, visit this group at
> >>>http://groups.google.com/group/android-ndk?hl=en.
>
> >>> > --
> >>> > You received this message because you are subscribed to the
> >>> Google Groups "android-ndk" group.
> >>> > To post to this group, send email to
> >>> andro...@googlegroups.com <mailto:android-ndk@googlegroups.com>.
> >>> > To unsubscribe from this group, send email to
> >>> android-ndk+unsubscribe@googlegroups.com
> >>> > <mailto:android-ndk%2Bunsu...@googlegroups.com>.
> >>> > For more options, visit this group at
> >>>http://groups.google.com/group/android-ndk?hl=en.
>
> >>> > --
> >>> > You received this message because you are subscribed to the Google
> >>> Groups "android-ndk" group.
> >>> > To post to this group, send email to andro...@googlegroups.com<mailto:
> >>> andro...@googlegroups.com>.
> >>> > To unsubscribe from this group, send email to
> >>> android-ndk+unsubscribe@googlegroups.com
> >>> > <mailto:android-ndk%2Bunsu...@googlegroups.com>.
> >>> > For more options, visit this group at
> >>>http://groups.google.com/group/android-ndk?hl=en.
>
> >>> > --
> >>> > You received this message because you are subscribed to the Google
> >>> Groups "android-ndk" group.
> >>> > To post to this group, send email to andro...@googlegroups.com.
> >>> > To unsubscribe from this group, send email to
> >>> android-ndk+unsubscribe@googlegroups.com.
I have followed the method as you describe . but after adding --enable-lobgomp under build-gcc.sh i am getting following error
To get the toolchain on ndk-r8b compiled on OSX, for gcc-4.6 I had to make a few trivial changes in the procedure. This should help anyone who were in my position.1: Download the r8b NDK.
2: Go to the NDK root.3: Download the source for the NDK (./build/tools/download-toolchain-sources.sh src)
4: Pull the gcc-4.6 modified patch from http://code.google.com/p/leemgs/downloads/detail?name=0001-Support-OpenMP-for-task-parallelism-on-Android-ICS-G.patch&can=2&q=5: Manually apply the patch, because the code seems to have changed and the patch no longer applies correctly.6: Make sure you set your host compiler to apple's shipped compiler with XCode. I tried compiling with my version of gcc 4.8 and it gave some errors. The compiler that worked for me is gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00). Check the compiler version with "gcc -v" .7: Open build/tools/build-host-gcc.sh and change "--disable-libgomp" to "--enable-libgomp"8: Open src/build/Makefile.in and at line 440, change "--disable-libgomp" to "--enable-libgomp"6: Rebuild the toolchain with the following command (have to build using -j1 as multi-core build looks like it has a race condition or some sort of a bug)bash build/tools/build-gcc.sh --platform=android-14 $(pwd)/src $(pwd) arm-linux-androideabi-4.6 -j17: If all goes well you should end up with a toolchain with OpenMP and see the filetoolchains/arm-linux-androideabi-4.6/prebuilt/darwin-x86/arm-linux-androideabi/lib/armv7-a/libgomp.a