Ask Your Question

Revision history [back]

What better way of passing extra parameters to compile?

I am compiling OpenCV in order to make it more optimized possible to run on Cortex-A53 processor in a NanoPI M3 produced by FriendlyARM.

I have used in my projects the following keys:

-mtune=cortex-a53 -mcpu=cortex-a53 -mfloat-abi=hard -march=armv8-a+crc

Enabling the CMake with the following option besides "ENABLE_NEON = ON:

 -D EXTRA_C_FLAGS_RELEASE="-mtune=cortex-a53 -mcpu=cortex-a53 -mfloat-abi=hard -march=armv8-a+crc"

I did not succeed because the OpenCV settings do not use it.

What better way of passing those extra parameters to compile?

What better way of passing extra parameters to compile?

I am compiling OpenCV in order to make it more optimized possible to run on Cortex-A53 processor in a NanoPI M3 produced by FriendlyARM.

I have used in my projects the following keys:

-mtune=cortex-a53 -mcpu=cortex-a53 -mfloat-abi=hard -march=armv8-a+crc

Enabling the CMake with the following option besides "ENABLE_NEON = ON:

 -D EXTRA_C_FLAGS_RELEASE="-mtune=cortex-a53 -mcpu=cortex-a53 -mfloat-abi=hard -march=armv8-a+crc"

I did not succeed because the OpenCV settings do not use it.

What better way of passing those extra parameters to compile?

I do this:

mkdir CortexA53Release
cd CortexA53Release
cmake -G "Unix Makefiles" \
 -D CMAKE_CXX_COMPILER=/usr/bin/arm-linux-gnueabihf-g++ \
 -D CMAKE_C_COMPILER=/usr/bin/arm-linux-gnueabihf-gcc \
 -D CMAKE_BUILD_TYPE=RELEASE-NANOPI \
 -D CMAKE_INSTALL_PREFIX=/usr/local \
 -D WITH_TBB=ON \
 -D WITH_V4L=ON \
 -D WITH_QT=ON \
 -D WITH_OPENGL=ON \
 -D WITH_IMAGEIO=ON \
 -D WITH_GSTREAMER=ON \
 -D ENABLE_NEON=ON \
 -D ENABLE_FAST_MATH=ON \
 -D BUILD_SHARED_LIBS=OFF \
 -D BUILD_NEW_PYTHON_SUPPORT=OFF \
 -D BUILD_EXAMPLES=ON \
 -D BUILD_FAT_JAVA_LIB=OFF \
 -D BUILD_TBB=ON \
 -D INSTALL_C_EXAMPLES=ON \
 -D INSTALL_PYTHON_EXAMPLES=OFF \
 -D INSTALL_TO_MANGLED_PATHS=ON \
 -D INSTALL_CREATE_DISTRIB=ON \
 -D INSTALL_TESTS=ON \
 -D EXTRA_C_FLAGS_RELEASE="-mtune=cortex-a53 -mcpu=cortex-a53 -mfloat-abi=hard -march=armv8-a+crc" \
 -D EXTRA_CXX_FLAGS_RELEASE="-mtune=cortex-a53 -mcpu=cortex-a53 -mfloat-abi=hard -march=armv8-a+crc" \
 ..

And get:

...

-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    EXTRA_CXX_FLAGS_RELEASE
    EXTRA_C_FLAGS_RELEASE


-- Build files have been written to: /home/fa/Workspace/opencv/CortexA53Release