There are some mandatory environment variables need to be set before cross compiling PaddlePaddle for iOS:
There are some mandatory environment variables need to be set before cross compiling PaddlePaddle for iOS:
- `CMAKE_SYSTEM_NAME`, CMake compiling target platform name, has to be `iOS`. PaddlePaddle CMake will compile all the third party dependencies and enforce some parameters (`WITH_C_API=ON`、`WITH_GPU=OFF`、`WITH_AVX=OFF`、`WITH_PYTHON=OFF`、`WITH_RDMA=OFF`) when this variable is set with value `iOS`.
- `CMAKE_SYSTEM_NAME`, CMake compiling target platform name, has to be `iOS`. PaddlePaddle CMake will compile all the third party dependencies and enforce some parameters (`WITH_C_API=ON`, `WITH_GPU=OFF`, `WITH_AVX=OFF`, `WITH_PYTHON=OFF`,`WITH_RDMA=OFF`) when this variable is set with value `iOS`.
- `WITH_C_API`, Whether to compile inference C-API library, has to be `ON`, since C-API is the only supported interface for inferencing in iOS.
- `WITH_C_API`, Whether to compile inference C-API library, has to be `ON`, since C-API is the only supported interface for inferencing in iOS.
- `WITH_SWIG_PY`, has to be `ON`. It's not supported to inference or train via swig in iOS.
- `WITH_SWIG_PY`, has to be `OFF`. It's not supported to inference or train via swig in iOS.
Optional environment variables for iOS are:
Optional environment variables for iOS are:
- `IOS_PLATFORM`, either `OS` (default) or `SIMULATOR`.
- `IOS_PLATFORM`, either `OS` (default) or `SIMULATOR`.
- `OS`, build targets ARM-based physical devices like iPhone or iPad.
- `OS`, build targets ARM-based physical devices like iPhone or iPad.
...
@@ -115,6 +115,6 @@ Please Note: if you compiled PaddlePaddle in the source directory for other plat
...
@@ -115,6 +115,6 @@ Please Note: if you compiled PaddlePaddle in the source directory for other plat
- `third_party` contains all the 3rd party libraries.
- `third_party` contains all the 3rd party libraries.
Please note: if PaddlePaddle library need to support both physical devices and simulators, you will need to compile correspondingly, then merge fat library with `lipo`
Please note: if PaddlePaddle library need to support both physical devices and simulators, you will need to compile correspondingly, then merge fat library with `lipo`.
Now you will have PaddlePaddle library compiled and installed, the fat library can be used in deep learning related iOS APPs. Please refer to C-API documentation for usage guides.
Now you will have PaddlePaddle library compiled and installed, the fat library can be used in deep learning related iOS APPs. Please refer to C-API documentation for usage guides.
<liclass="toctree-l2"><aclass="reference internal"href="../../../../../mobile/cross_compiling_for_android_en.html">Build PaddlePaddle for Android</a></li>
<liclass="toctree-l2"><aclass="reference internal"href="../../../../../mobile/cross_compiling_for_android_en.html">Build PaddlePaddle for Android</a></li>
<liclass="toctree-l2"><aclass="reference internal"href="../../../../../mobile/cross_compiling_for_ios_en.html">PaddlePaddle Compiling Guide for iOS</a></li>
<liclass="toctree-l2"><aclass="reference internal"href="../../../../../mobile/cross_compiling_for_raspberry_en.html">Build PaddlePaddle for Raspberry Pi</a></li>
<liclass="toctree-l2"><aclass="reference internal"href="../../../../../mobile/cross_compiling_for_raspberry_en.html">Build PaddlePaddle for Raspberry Pi</a></li>
<liclass="toctree-l2"><aclass="reference internal"href="../../../../../mobile/cross_compiling_for_android_en.html">Build PaddlePaddle for Android</a></li>
<liclass="toctree-l2"><aclass="reference internal"href="../../../../../mobile/cross_compiling_for_android_en.html">Build PaddlePaddle for Android</a></li>
<liclass="toctree-l2"><aclass="reference internal"href="../../../../../mobile/cross_compiling_for_ios_en.html">PaddlePaddle Compiling Guide for iOS</a></li>
<liclass="toctree-l2"><aclass="reference internal"href="../../../../../mobile/cross_compiling_for_raspberry_en.html">Build PaddlePaddle for Raspberry Pi</a></li>
<liclass="toctree-l2"><aclass="reference internal"href="../../../../../mobile/cross_compiling_for_raspberry_en.html">Build PaddlePaddle for Raspberry Pi</a></li>
<p>PaddlePaddle provides cross-compiling toolchain configuration documentation <aclass="reference external"href="https://github.com/PaddlePaddle/Paddle/blob/develop/cmake/cross_compiling/ios.cmake">cmake/cross_compiling/ios.cmake</a>, which has some default settings for frequently used compilers.</p>
<p>PaddlePaddle provides cross-compiling toolchain configuration documentation <aclass="reference external"href="https://github.com/PaddlePaddle/Paddle/blob/develop/cmake/cross_compiling/ios.cmake">cmake/cross_compiling/ios.cmake</a>, which has some default settings for frequently used compilers.</p>
<p>There are some mandatory environment variables need to be set before cross compiling PaddlePaddle for iOS:</p>
<p>There are some mandatory environment variables need to be set before cross compiling PaddlePaddle for iOS:</p>
<ulclass="simple">
<ulclass="simple">
<li><codeclass="docutils literal"><spanclass="pre">CMAKE_SYSTEM_NAME</span></code>, CMake compiling target platform name, has to be <codeclass="docutils literal"><spanclass="pre">iOS</span></code>. PaddlePaddle CMake will compile all the third party dependencies and enforce some parameters (<codeclass="docutils literal"><spanclass="pre">WITH_C_API=ON</span></code>、<codeclass="docutils literal"><spanclass="pre">WITH_GPU=OFF</span></code>、<codeclass="docutils literal"><spanclass="pre">WITH_AVX=OFF</span></code>、<codeclass="docutils literal"><spanclass="pre">WITH_PYTHON=OFF</span></code>、<codeclass="docutils literal"><spanclass="pre">WITH_RDMA=OFF</span></code>) when this variable is set with value <codeclass="docutils literal"><spanclass="pre">iOS</span></code>.</li>
<li><codeclass="docutils literal"><spanclass="pre">CMAKE_SYSTEM_NAME</span></code>, CMake compiling target platform name, has to be <codeclass="docutils literal"><spanclass="pre">iOS</span></code>. PaddlePaddle CMake will compile all the third party dependencies and enforce some parameters (<codeclass="docutils literal"><spanclass="pre">WITH_C_API=ON</span></code>, <codeclass="docutils literal"><spanclass="pre">WITH_GPU=OFF</span></code>, <codeclass="docutils literal"><spanclass="pre">WITH_AVX=OFF</span></code>, <codeclass="docutils literal"><spanclass="pre">WITH_PYTHON=OFF</span></code>,<codeclass="docutils literal"><spanclass="pre">WITH_RDMA=OFF</span></code>) when this variable is set with value <codeclass="docutils literal"><spanclass="pre">iOS</span></code>.</li>
<li><codeclass="docutils literal"><spanclass="pre">WITH_C_API</span></code>, Whether to compile inference C-API library, has to be <codeclass="docutils literal"><spanclass="pre">ON</span></code>, since C-API is the only supported interface for inferencing in iOS.</li>
<li><codeclass="docutils literal"><spanclass="pre">WITH_C_API</span></code>, Whether to compile inference C-API library, has to be <codeclass="docutils literal"><spanclass="pre">ON</span></code>, since C-API is the only supported interface for inferencing in iOS.</li>
<li><codeclass="docutils literal"><spanclass="pre">WITH_SWIG_PY</span></code>, has to be <codeclass="docutils literal"><spanclass="pre">ON</span></code>. It’s not supported to inference or train via swig in iOS.</li>
<li><codeclass="docutils literal"><spanclass="pre">WITH_SWIG_PY</span></code>, has to be <codeclass="docutils literal"><spanclass="pre">OFF</span></code>. It’s not supported to inference or train via swig in iOS.</li>
</ul>
</ul>
<p>Optional environment variables for iOS are:</p>
<p>Optional environment variables for iOS are:</p>
<ul>
<ul>
<li><pclass="first"><codeclass="docutils literal"><spanclass="pre">IOS_PLATFORM</span></code>, either <codeclass="docutils literal"><spanclass="pre">OS</span></code> (default) or <codeclass="docutils literal"><spanclass="pre">SIMULATOR</span></code>.</p>
<li><pclass="first"><codeclass="docutils literal"><spanclass="pre">IOS_PLATFORM</span></code>, either <codeclass="docutils literal"><spanclass="pre">OS</span></code> (default) or <codeclass="docutils literal"><spanclass="pre">SIMULATOR</span></code>.</p>
<li><codeclass="docutils literal"><spanclass="pre">third_party</span></code> contains all the 3rd party libraries.</li>
<li><codeclass="docutils literal"><spanclass="pre">third_party</span></code> contains all the 3rd party libraries.</li>
</ul>
</ul>
<p>Please note: if PaddlePaddle library need to support both physical devices and simulators, you will need to compile correspondingly, then merge fat library with <codeclass="docutils literal"><spanclass="pre">lipo</span></code></p>
<p>Please note: if PaddlePaddle library need to support both physical devices and simulators, you will need to compile correspondingly, then merge fat library with <codeclass="docutils literal"><spanclass="pre">lipo</span></code>.</p>
<p>Now you will have PaddlePaddle library compiled and installed, the fat library can be used in deep learning related iOS APPs. Please refer to C-API documentation for usage guides.</p>
<p>Now you will have PaddlePaddle library compiled and installed, the fat library can be used in deep learning related iOS APPs. Please refer to C-API documentation for usage guides.</p>