In this tutorial, we will show how easy it is to build an application for Linux when you are running the Unity editor on Windows.
Note that the current official plugin version does not support Linux. The Linux support is currently in beta.
We won't cover how to create the scenes, as it's the exact same as Windows and covered in our Unity documentation.
The Unity plugin revolves around the ZED Unity wrapper, sl_unitywrapper.dll, a single library that provides access to ZED SDK functions. Under Windows, you can find this library in SDK/Plugins/Win64/.
Under Linux, it's instead an .so library (similar to a dll for Linux) called libsl_unitywrapper.so in the SDK/Plugins/Linux/ folder.
Under the hood, there are some differences with the Windows version:
To solve this, the ZED SDK is statically embedded in the Linux wrapper library. The big advantage this provides is that you don't need to worry about the CUDA version and even the Ubuntu version (for 16LTS and 18LTS). Furtermore, unlike Windows, you don't need to install the ZED SDK on the target device since it is already inside the wrapper. One library to rule them all...
When you install Unity on Windows, it does not come with Linux build support by default. This is what you need to specify that the application will run on Linux. To install it, go to the Unity Hub on the Installs tab : On the desired Unity version, click on ... and select Add Component:
This will open a list of components you can add to your installation. Select Linux Build Support:
Wait for the installation to complete and restart Unity Hub.
On the Unity Menu bar, click on File -> then Build Settings to build your application (or Ctrl+Shift+B). A familiar popup will open. Now that you've installed Linux support in Unity, you can choose Linux as the Target Platform in addition to Windows.
Select Linux and click on Build.
Under Linux, the application will be called XXXXX.x86_64 with a XXXX_data folder attached. Inside the XXX_data/plugins folder, you will see the libsl_unitywrapper.so directly inside.
$ chmod +x ./XXXXX.x86_64
Launch the application and enjoy it running on Linux.