Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagebash
$ cd ${SDK_DIR}/src/adamapp-py/yuv_yolo_app/external/lib/aarch64-linux-gnu/
$ aarch64-linux-gnu-strip --strip-debug libopencv_world.so.3.4.7

...

Place the downloaded files to “${SDK_DIR}/external/build/sample/docker/docker_volume” directory.

Info

If the SoC is ambaCV5X and the camera firmware is v3.10 or earlier, it will use OpenSSL 1.1.1 in the camera, so it will work without placing OpenSSL. Since the camera firmware is v3.20 or later, OpenSSL has been updated to 3.0.12, so it will not work unless OpenSSL is placed in the app or built using OpenSSL 3.0.12. Please select and use the version of OpenSSL that suits your app environment.

For more information on SoC, see below.

Installation conditions for applications - FAQ - Development Partner Portal (En) (i-pro.com)

Update compilation instructions file

...

Here we take “${SDK_DIR}/src/adamapp-py/additionalhogehoge_info_sample_app” as an example.

Deploy PyCurl

...

${SDK_DIR}/src/adamapp-py/additionalhogehoge_info_sample_app/python/site-packages

Code Block
$ cp -R ${SDK_DIR}/external/build/sample/docker/docker_volume/pycurl-7.45.2/build/lib.linux-aarch64-3.7/pycurl.cpython-37m-aarch64-linux-gnu.so ${SDK_DIR}/src/adamapp-py/additional_info_samplehogehoge_app/python/site-packages

...

${SDK_DIR}/src/adamapp-py/additional_info_samplehogehoge_app/python/site-packages/pycurl.cpython-37m-aarch64-linux-gnu.so

...

Open “${SDK_DIR}/src/adamapp-py/additionalhogehoge_info_sample_app/python/pymain.py” and add as follows.

...

Build the sample application "additionalhogehoge_info_sample_app" and install it on the camera (eg, it can be installed from the green frame in the image below).

Please perform the build method according to each SDK version.Open the app screen (red frame button in the image below), and if the string is displayed like "body", it is successful.

...

Compile a Python module (Numba)

...

Code Block
#!/bin/sh -x

#----------
HOME_PATH=/home/docker
LIB_INSTALL_DIR=${HOME_PATH}/install_path
SITE_PACKAGES=${LIB_INSTALL_DIR}/lib/python3.7/site-packages

NUMPY_ARCHIVES=numpy-1.19.4.tar.gz
NUMPY_DIR=numpy-1.19.4

LLVM_ARCHIVES=llvm-project-llvmorg-11.1.0.tar.gz
LLVM_DIR=llvm-project-llvmorg-11.1.0
LLVM_INSTALL_DIR=${LIB_INSTALL_DIR}/llvm
LLVM_PATCH_SRC=${LLVMLITE_DIR}/conda-recipes
LLVM_PATCH_DST=${LLVM_DIR}/llvm

LLVMLITE_ARCHIVES=llvmlite-0.39.1.tar.gz
LLVMLITE_DIR=llvmlite-0.39.1

NUMBA_ARCHIVES=numba-0.56.4.zip
NUMBA_DIR=numba-0.56.4

#----------

# NumPy
cd ${HOME_PATH}
mkdir -p ${SITE_PACKAGES}
tar xf ${NUMPY_ARCHIVES}
cd ${NUMPY_DIR}
python setup.py build
PYTHONPATH=$PYTHONPATH:${SITE_PACKAGES}
export PYTHONPATH
python setup.py install --prefix=${LIB_INSTALL_DIR}


# LLVM / llvmlite
cd ${HOME_PATH}
tar xf ${LLVM_ARCHIVES}
tar xf ${LLVMLITE_ARCHIVES}

cd ${LLVM_PATCH_DST}
for patchFile in $(find ../../${LLVM_PATCH_SRC} -name "*.patch" -type f); do
	patch --dry-run -f -p1 -i ${patchFile}
	if [ $? -eq 0 ]; then
		patch -p1 -i ${patchFile}
	fi
done

LLVM_BUILD_SH="../../${LLVMLITE_DIR}/conda-recipes/llvmdev/build.sh"
mkdir -p ${LLVM_INSTALL_DIR}
export PREFIX=${LLVM_INSTALL_DIR} CPU_COUNT=2
sed -i -e "s/\(^LLVM_TARGETS_TO_BUILD=\).*/\1\$\{LLVM_TARGETS_TO_BUILD:-\"AArch64\"\}/" ${LLVM_BUILD_SH}
sed -i -e "/LLVM_ENABLE_ASSERTIONS/d" ${LLVM_BUILD_SH}
sed -i -e "/LLVM_EXPERIMENTAL_TARGETS_TO_BUILD/d" ${LLVM_BUILD_SH}
chmod +x ${LLVM_BUILD_SH}
${LLVM_BUILD_SH}
cd ../../

cd ${LLVMLITE_DIR}
export LLVM_CONFIG=${LLVM_INSTALL_DIR}/bin/llvm-config
python setup.py build
python setup.py install --prefix=${LIB_INSTALL_DIR}
cd ../


# numba
unzip ${NUMBA_ARCHIVES}
cd ${NUMBA_DIR}
export NUMBA_DISABLE_TBB=1
python setup.py build
python setup.py install --prefix=${LIB_INSTALL_DIR}
cd ../


# replace some libraries compatible with python3.7
cd ${HOME_PATH}
unzip importlib_metadata-6.7.0.zip
mv importlib_metadata-6.7.0/importlib_metadata ${SITE_PACKAGES}
unzip typing_extensions-4.7.1.zip
mv typing_extensions-4.7.1/src/typing_extensions.py ${SITE_PACKAGES}
unzip zipp-3.15.0.zip
mv zipp-3.15.0/zipp ${SITE_PACKAGES}


# cleanup
cd ${SITE_PACKAGES}
rm -f easy-install.pth setuptools.pth site.py
find . -maxdepth 2 -name numpy -type d -exec mv {} . \;
find . -maxdepth 2 -name numba -type d -exec mv {} . \;
rm -rf *.egg*
find . -name *pycache* -type d -print | xargs rm -rf
find . -name tests -type d -print | xargs rm -rf
find . -name *.so | xargs aarch64-linux-gnu-strip --strip-debug
cd ${HOME_PATH}

...