Skip to content Skip to sidebar Skip to footer

Openmp Compatibility With Ios/android

What i am trying to do: I am working on C/c++ codes to build a product for all platforms(IOS/Android/Windows(mobile/desktop)/Mac/Linux) What have i done so far: Yes there are many

Solution 1:

I can't answer on 1. as I don't have any ios devices nor dev environment.

Regarding 2. Yes, all the higher end android devices have more than 1 cores. It's actually hard to find even a low end android device with only 1 core. But not all Android devices are simply arm-based, there are also dual and quad cores x86 and x86_64 devices as well as arm64-v8a devices.

The NDK supports all these architectures, with openmp as well since its 9th version. Use gcc (it's the compiler by default), and add -fopenmp to your NDK module's CFLAGS and LDFLAGS in your Android.mk Makefile:

include$(CLEAR_VARS)
LOCAL_MODULE := yourmodule
LOCAL_SRC_FILES := yourmodule.c
LOCAL_CFLAGS += -fopenmp
LOCAL_LDFLAGS += -fopenmp
include$(BUILD_SHARED_LIBRARY)

Solution 2:

The xcode clang doesn't have openmp included. But you can build by yourself, using -Xpreprocessor -fopenmp.

Post a Comment for "Openmp Compatibility With Ios/android"