1 .. _cross_compile_macos :
3 Cross compilation on MacOS
4 ==========================
6 This is a first attempt to support Cross compilation of VPP on MacOS for development (linting, completion, compile_commands.json)
11 * You'll need to install the following packages
16 brew install diffutils gnu-sed pkg-config ninja crosstool-ng
18 * You'll also need to install ``gnu-ident 2.2.11`` to be able to ``make checkstyle``. You can get it from `GNU <https://www.gnu.org/prep/ftp.html>`_
19 * You should link the binaries to make them available in your path with their original names e.g. :
23 ln -s $(which gsed) /usr/local/bin/sed
24 ln -s $(which gindent) /usr/local/bin/indent
25 ln -s /usr/local/Cellar/diffutils/3.7/bin/diff /usr/local/bin/diff
30 * Create a `cross compile toolchain <https://crosstool-ng.github.io/>`_
31 * Create a case sensitive volume and mount the toolchain in it e.g. in ``/Volumes/xchain``
32 * Create a xchain.toolchain file with ``$VPP_DIR/extras/scripts/cross_compile_macos.sh conf /Volumes/xchan``
34 For now we don't support e-build so dpdk, rdma, quicly won't be compiled as part of ``make build``
36 To build with the toolchain do:
40 $VPP_DIR/extras/scripts/cross_compile_macos.sh build
43 To get the compile_commands.json do
47 $VPP_DIR/extras/scripts/cross_compile_macos.sh cc
48 # >> ./build-root/build-vpp[_debug]-native/vpp/compile_commands.json
52 This should build vpp on MacOS