I download the Tegra_Multimedia_API_R28.2.0_aarch64.tbz2, and then decompression it。I see there are some samples in it,but i cann’t cross compile them successly。
I set the environment variable TARGET_ROOTFS to “/home/mxj/Nvidia_TX2/64_TX2/Linux_for_Tegra/rootfs”.
collect2: error: ld returned 1 exit status
Makefile:60: recipe for target ‘multi_camera’ failed
make: *** [multi_camera] Error 1
I can find the file crt1.o and crti.o under the path ${TARGET_ROOTFS}/usr/lib,but why the compiler cann’t find them? Is there some mistakes in my steps?
/*
* Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of NVIDIA CORPORATION nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
Use the following procedure to set up the cross-compilation environment for
Multimedia API on the host system.
1. Install the CUDA cross-platform toolkit on the host system with the following
commands:
$ sudo dpkg --add-architecture arm64
$ sudo apt-get update
$ sudo dpkg -i cuda-repo-<distro>_<version>_amd64.deb
$ sudo apt-get update
$ sudo apt-get install cuda-cross-aarch64
NOTE: Only cuda-8.x supports cross-platform development for aarch64(arm64).
2. Download the <L4T Sample Root Filesystem> from the following website:
https://developer.nvidia.com/embedded/downloads
3. Decompress the package and export rootfs path with the following command:
$ export TARGET_ROOTFS=<PATH_OF_TEGRA_DRIVER_PACKAGE>/Linux_for_Tegra/rootfs
NOTE: The sample 11_camera_object_identification and backend do not support
cross-compilation in this release.
4. Export the path of cross-compiler tool chain with the following command:
$ export PATH=$PATH:<CROSS_COMPILER_PATH>/bin
5. Create symbolic links with the following commands:
$ export TEGRA_ARMABI=aarch64-linux-gnu
$ cd ${TARGET_ROOTFS}/usr/lib/
$ sudo ln -sf ${TEGRA_ARMABI}/crt1.o crt1.o
$ sudo ln -sf ${TEGRA_ARMABI}/crti.o crti.o
$ sudo ln -sf ${TEGRA_ARMABI}/crtn.o crtn.o
$ cd ${TEGRA_ARMABI}
$ sudo ln -sf libv4l2.so.0 libv4l2.so
$ sudo ln -sf tegra-egl/libEGL.so.1 libEGL.so
$ sudo ln -sf tegra-egl/libGLESv2.so.2 libGLESv2.so
$ sudo ln -sf tegra/libcuda.so.1.1 libcuda.so.1
$ sudo ln -sf ../../../lib/aarch64-linux-gnu/libdl.so.2 libdl.so
6. Enter the sample directories and run make to cross-compile.