hi3516 himix


原文链接: hi3516 himix

comicchang/PassportReader-3rdparty: 3rd party libs for our PassportReader
开发版初始化
gcc

ip addr flush dev eth0
ip addr add 192.168.233.233/24 dev eth0
ip route add default via 192.168.233.1
mount 192.168.233.17:/home/ooxx/jetson /mnt/ -o nolock

toolchain_himix.cmake

# this is required
SET(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR aarch)

set(CMAKE_SYSROOT1 /opt/hisi-linux/x86-arm/arm-himix200-linux /home/ooxx/jetson/himix)

# specify the cross compiler
SET(CMAKE_C_COMPILER   /opt/hisi-linux/x86-arm/arm-himix200-linux/bin/arm-himix200-linux-gcc)
SET(CMAKE_CXX_COMPILER /opt/hisi-linux/x86-arm/arm-himix200-linux/bin/arm-himix200-linux-g++)
SET(CMAKE_STRIP        /opt/hisi-linux/x86-arm/arm-himix200-linux/bin/arm-himix200-linux-strip)

# where is the target environment
SET(CMAKE_FIND_ROOT_PATH  ${CMAKE_SYSROOT1} /opt/hisi-linux/x86-arm/arm-himix200-linux/target/)

# search for programs in the build host directories (not necessary)
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# for libraries and headers in the target directories
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)


set(CMAKE_C_FLAGS "-O3 -ffast-math -ftree-vectorize -flto -mcpu=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=softfp -fPIC" CACHE STRING "" FORCE)
set(CMAKE_CXX_FLAGS "-O3 -ffast-math -ftree-vectorize -flto -mcpu=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=softfp -fPIC" CACHE STRING "" FORCE)

Libusb https://github.com/libusb/libusb.git

CC=/opt/hisi-linux/x86-arm/arm-himix200-linux/bin/arm-himix200-linux-gcc \
CXX=/opt/hisi-linux/x86-arm/arm-himix200-linux/bin/arm-himix200-linux-g++ \
CFLAGS="-O3 -ffast-math -ftree-vectorize -flto -mcpu=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=softfp -fPIC" \
CXXFLAGS="-O3 -ffast-math -ftree-vectorize -flto -mcpu=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=softfp -fPIC" \
./configure --prefix=/home/ooxx/jetson/himix/ --enable-shared=no --host=aarch64-unknown-linux-gnu --enable-udev=no

openssl https://www.openssl.org/source/openssl-1.1.0k.tar.gz

CC=/opt/hisi-linux/x86-arm/arm-himix200-linux/bin/arm-himix200-linux-gcc \
CXX=/opt/hisi-linux/x86-arm/arm-himix200-linux/bin/arm-himix200-linux-g++ \
./Configure --prefix=/home/ooxx/jetson/himix/ linux-armv4 no-shared -ffast-math -ftree-vectorize -flto -mcpu=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=softfp

opencv https://github.com/opencv/opencv/archive/4.1.1.zip

cmake .. \
-DCMAKE_TOOLCHAIN_FILE=/home/ooxx/jetson/toolchain_himix.cmake -DCMAKE_INSTALL_PREFIX:PATH=/home/ooxx/jetson/himix/ \
-DBUILD_TESTS=FALSE -DBUILD_PERF_TESTS=FALSE \
-DCMAKE_BUILD_TYPE=RELEASE -DBUILD_SHARED_LIBS=FALSE \
-DWITH_WEBP=FALSE -DBUILD_WEBP=FALSE -DBUILD_opencv_apps=FALSE\
-DCMAKE_C_FLAGS="-O3 -ffast-math -ftree-vectorize -flto -mcpu=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=softfp -fPIC" \
-DCMAKE_CXX_FLAGS="-O3 -ffast-math -ftree-vectorize -flto -mcpu=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=softfp -fPIC" 

openjpeg https://github.com/uclouvain/openjpeg.git

cmake .. -DCMAKE_TOOLCHAIN_FILE=/home/ooxx/jetson/toolchain_himix.cmake -DCMAKE_INSTALL_PREFIX:PATH=/home/ooxx/jetson/himix/ \
-DCMAKE_BUILD_TYPE=RELEASE -DBUILD_SHARED_LIBS=FALSE \
-DCMAKE_C_FLAGS="-O3 -ffast-math -ftree-vectorize -flto -mcpu=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=softfp -fPIC" \
-DCMAKE_CXX_FLAGS="-O3 -ffast-math -ftree-vectorize -flto -mcpu=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=softfp -fPIC" 

glog https://github.com/google/glog.git

cmake .. -DCMAKE_TOOLCHAIN_FILE=/home/ooxx/jetson/toolchain_himix.cmake -DCMAKE_INSTALL_PREFIX:PATH=/home/ooxx/jetson/himix/ \
-DCMAKE_BUILD_TYPE=RELEASE -DBUILD_SHARED_LIBS=TRUE \
-DCMAKE_C_FLAGS="-O3 -ffast-math -ftree-vectorize -flto -mcpu=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=softfp -fPIC" \
-DCMAKE_CXX_FLAGS="-O3 -ffast-math -ftree-vectorize -flto -mcpu=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=softfp -fPIC"

our project

LDFLAGS="-L/home/ooxx/jetson/himix/lib/" \
cmake .. -DCMAKE_TOOLCHAIN_FILE=/home/ooxx/jetson/toolchain_himix.cmake -DCMAKE_INSTALL_PREFIX:PATH=/home/ooxx/jetson/himix/ -DCMAKE_BUILD_TYPE=RELEASE \
-DCMAKE_C_FLAGS="-O3 -ffast-math -ftree-vectorize -flto -mcpu=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=softfp -fPIC -fdata-sections -ffunction-sections  -Wl,--gc-sections -fvisibility=hidden" \
-DCMAKE_CXX_FLAGS="-O3 -ffast-math -ftree-vectorize -std=gnu++11 -fexceptions -flto -mcpu=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=softfp -fPIC -fdata-sections -ffunction-sections  -Wl,--gc-sections -fvisibility=hidden" 
`