L4T Multimedia API Reference

32.2 Release

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
multimedia_api/ll_samples/docs/CROSS_COMPILE_SUPPORT.md
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  * * Redistributions of source code must retain the above copyright
8  * notice, this list of conditions and the following disclaimer.
9  * * Redistributions in binary form must reproduce the above copyright
10  * notice, this list of conditions and the following disclaimer in the
11  * documentation and/or other materials provided with the distribution.
12  * * Neither the name of NVIDIA CORPORATION nor the names of its
13  * contributors may be used to endorse or promote products derived
14  * from this software without specific prior written permission.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27  */
28 
29 @page cross_platform_support Setting Up Cross-Platform Support
30 
31 @note The following samples do not yet support cross-compilation:
32  - 04_video_dec_trt
33  - backend
34  - frontend
35 
36 This section describes how to set up the cross-compilation environment for
37 Multimedia API on the host system.
38 It uses the following terms:
39 - _Host system_ means the x86 based server where you are going to do cross-compilation.
40 - _Jetson board_ means the target board where your samples will run.
41 
42 The following steps should be executed **on your Jetson board**:
43 
44 1. If you have not already set up a complete compilation environment on your
45  Jetson board, please do so now. For more information, see @ref mmapi_build.
46 
47  Before proceeding, you must ensure you can build samples natively without
48  issues on your Jetson board.
49 
50 2. Still on the Jetson board, set up Samba to mount the target rootfs from your
51  host system:
52 
53  - Install and start Samba with the following commands:
54 
55  $ sudo apt-get install samba
56  $ sudo passwd root
57  $ sudo smbpasswd -a root
58  - Add the following configurations to `/etc/samba/smb.conf`.
59 
60  [root]
61  comment= Rootfs for Tegra
62  path = /
63  browseable = yes
64  read only = yes
65  valid user = root
66  - Enter:
67 
68  $ sudo service smbd restart
69  This step ensures you can mount the target rootfs from your host system,
70  which also ensures the sample can link everything needed through the mount node.
71 
72 3. Create symbolic links with the following commands:
73 
74  $ cd /usr/lib/
75  $ sudo ln -sf aarch64-linux-gnu/crt1.o crt1.o
76  $ sudo ln -sf aarch64-linux-gnu/crti.o crti.o
77  $ sudo ln -sf aarch64-linux-gnu/crtn.o crtn.o
78  $ cd /usr/lib/aarch64-linux-gnu/
79  $ sudo ln -sf ../../../lib/aarch64-linux-gnu/libdl.so.2 libdl.so
80 
81 The following steps are executed on your **host system**:
82 
83 1. Mount and export the target rootfs on your Jetson board with the following commands:
84 
85  $ cd $HOME
86  $ mkdir -p jetson
87  $ sudo mount -t cifs -o "username=root,password=nvidia" //10.19.225.125/root jetson
88  $ export TARGET_ROOTFS=$HOME/jetson
89  The username must be root and the password is set previously when you install Samba.
90  The 10.19.225.125 is the IP address of your Jetson board.
91 
92 2. Export the path of cross-compiler tool chain with the following command:
93 
94  $ export PATH=$PATH:<CROSS_COMPILER_PATH>/bin
95  $ export CROSS_COMPILE=aarch64-unknown-linux-gnu-
96 
97  Replace `<CROSS_COMPILER_PATH>` with the correct path of your tool chain.
98 
99  You can download the prebuilt tool chain from the following website,
100  or you can use your own cross-compiler. Because this release is tested with
101  version GCC 4.8.5, NVIDIA recommends using that version.
102 
103  https://developer.nvidia.com/embedded/downloads
104 
105 3. Navigate to the directory for a sample and run `make` to cross-compile.