i use latest version and compile android and edit dlib/config.h add # define DLIB_HAVE_NEON
my Android.mk
include $(CLEAR_VARS)
LOCAL_MODULE := dlib
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../dlib
LOCAL_SRC_FILES += ../$(LOCAL_PATH)/../dlib/dlib/all/source.cpp
ifeq ($(TARGET_ARCH_ABI), armeabi-v7a)
LOCAL_ARM_MODE := arm
LOCAL_ARM_NEON := true
LOCAL_CFLAGS += -O3 -march=armv7-a -mfpu=neon -fprofile-use -mfloat-abi=softfp
$(info "support neon")
endif
compile libdlib.a on my ubuntu16.04:
Partial output:
In file included from jni/../dlib/dlib/dnn.h:13:
In file included from jni/../dlib/dlib/dnn/input.h:10:
In file included from jni/../dlib/dlib/dnn/../image_processing.h:11:
In file included from jni/../dlib/dlib/image_processing/scan_image.h:13:
In file included from jni/../dlib/dlib/array2d/../geometry/../image_processing/../image_transforms/spatial_filtering.h:13:
In file included from jni/../dlib/dlib/array2d/../geometry/../image_processing/../image_transforms/../simd.h:6:
In file included from jni/../dlib/dlib/simd/simd4f.h:6:
In file included from jni/../dlib/dlib/simd/simd_check.h:108:
/home/ww/download/android-ndk-r17/toolchains/llvm/prebuilt/linux-x86_64/lib64/clang/6.0.2/include/arm_neon.h:28:2: error:
"NEON support not enabled"
^
/home/ww/download/android-ndk-r17/toolchains/llvm/prebuilt/linux-x86_64/lib64/clang/6.0.2/include/arm_neon.h:48:24: error:
'neon_vector_type' attribute is not supported for this target
typedef __attribute__((neon_vector_type(8))) int8_t int8x8_t;
^
/home/ww/download/android-ndk-r17/toolchains/llvm/prebuilt/linux-x86_64/lib64/clang/6.0.2/include/arm_neon.h:49:24: error:
'neon_vector_type' attribute is not supported for this target
typedef __attribute__((neon_vector_type(16))) int8_t int8x16_t;
I don't know why it's going to be a problem. android-ndk-r16b same problem
what should i do?
thank you
Warning: this issue has been inactive for 109 days and will be automatically closed on 2018-09-07 if there is no further activity.
If you are waiting for a response but haven't received one it's likely your question is somehow inappropriate. E.g. you didn't follow the issue submission instructions, or your question is easily answerable by reading the FAQ, dlib's documentation, or a Google search.
sorry,i solved it
@jackweiwang how did you solve it? I'm having the same issue now.
@maksimgusarovsc
My directory structure is 'android.mk directory1 directory2 ...'.
An error occurred when I added the following to android.mk.
However, when I added it to the android.mk in the subdirectory(directory/Android.mk), the problem disappeared.
ifeq ($(TARGET_ARCH_ABI), armeabi-v7a)
LOCAL_ARM_MODE := arm
LOCAL_ARM_NEON := true
LOCAL_CFLAGS += -O3 -march=armv7-a -mfpu=neon -mfloat-abi=softfp
I hope it will be helpful to you.
Most helpful comment
@maksimgusarovsc
My directory structure is 'android.mk directory1 directory2 ...'.
An error occurred when I added the following to android.mk.
However, when I added it to the android.mk in the subdirectory(directory/Android.mk), the problem disappeared.
ifeq ($(TARGET_ARCH_ABI), armeabi-v7a)LOCAL_ARM_MODE := armLOCAL_ARM_NEON := trueLOCAL_CFLAGS += -O3 -march=armv7-a -mfpu=neon -mfloat-abi=softfpI hope it will be helpful to you.