Add cross-compilation section in build_linux.md#3561
Add cross-compilation section in build_linux.md#3561evroon wants to merge 1 commit intomicrosoft:masterfrom
Conversation
|
I tried to make this work for a good 5 hours but it just wouldn't (or I'm messing something up). Moreover, even when trying to bypass this error by grabbing a WSL2 compiled AirSim plugins folder and placing it into the UE4 project folder, although things end up packaging just fine through UE4, when running the resulting .sh binary the environment works fine but the drone is stagnant mid-air with no physics or prop movement. The car simulation does work though, so I'm assuming its something within AirLib that breaks while doing this since car-mode isn't dependent on AirLib or AirSim's physics (AFAIK). |
|
The first problem I did not encounter as far as I know, but you could also build for linux and copy the 3 or 4 lib files to a temporary location and then build AirLib for windows and paste the files in the original location. The second issue is indeed something I oversaw, I only noticed it today by accident and I don't know exactly why it happens, but has probably indeed to do with AirLib. Sorry about that. |
zimmy87
left a comment
There was a problem hiding this comment.
I think we need extra clarification in this doc. I personally ran into some confusion and wasn't able to get this scenario working locally
| ``` | ||
|
|
||
| ## Cross-compile AirSim from Windows for Linux | ||
| You can cross compile for Linux from a Windows machine. First install clang as instructed [here](https://docs.unrealengine.com/latest/INT/Platforms/Linux/GettingStarted/index.html). Then, build AirSim from Bash for Windows, as instructed above, such that the Linux .lib files are created. Subsequently, build AirSim again but this time for Windows (as instructed [here](build_windows.md)) such that you can open the project in UE4. After building UE4 for Windows, open the project in Unreal Engine. Under Project Settings, go to `Supported Platforms` and enable `Linux` by clicking the checkbox. Now, go to `Plugins` and search for `VR`. Disable `Oculus VR` and `SteamVR` as they will result in build errors. Now, you can start packaging the project by going to File → Package Projct → Linux → Linux. |
There was a problem hiding this comment.
A couple notes here:
- Instead of Bash for Windows, I think it would be better to specify Windows Subsystem for Linux (WSL).
- Where is the AirSim repo that is being built located? When I build from WSL out of a repo located in my windows directory structure, I get build errors. If I instead build out of the WSL directory structure, I get build errors when I build from Windows. Is the expectation to copy binaries from a repo located in WSL to one located in windows?
There was a problem hiding this comment.
WSL is indeed the correct/current term.
I think I used /mnt/c (or another drive) to build AirSim from in WSL. But this method does not work in its current form (atleast AirLib is not working), as in the comments above. So, maybe I should close this PR.
|
Closed due to inactivity. Please, feel free to ask for it to be reopened if you wish to continue. |
About
Cross compilation is possible but requires some instructions. Specifically, the AirLib libraries have to be build from a Linux environment.
How Has This Been Tested?
I did this step-by-step (from Windows 10, for Ubuntu 20.04) and for me it works.