Successful build on WSL (Ubuntu 22.04 LTS) #90
DJtheRedstoner
started this conversation in
General
Replies: 2 comments 6 replies
-
I tried just that and am now having this issue: Error: Unknown option "--ignore-preprocessor-errors". How can I fix it? Is there a way to get around it? |
Beta Was this translation helpful? Give feedback.
6 replies
-
@DJtheRedstoner Got it to build on native Ubuntu 22.04 including optix support following this guide. Thank you very much!! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I was able to successfully build and run MoonRay using WSL (Ubuntu). Thanks to everyone who has tried building MoonRay and posted their advice/patches, especially #45.
It’s important to note that my WSL environment was not clean when I started this, so my instructions may not work exactly. Additionally, I’ve upgraded to Ubuntu 22.04 LTS, which may be different than your WSL environment. These instructions should also work for a non-WSL Ubuntu environment.
Here’s the complete patch I used to get things to compile: https://gist.github.com/DJtheRedstoner/55e8d66226d04f9158bf22ccd9bd176f. I didn’t need to make any changes to the source code, only the build files.
Here are some rough instructions to reproduce my build. I recommend fully reading them and all my notes before attempting this, since it’s important to get all the details correct.
Notes:
Directories
MoonRay’s build is based around absolute directories. My patch changes these directories to be within
/home/ubuntu/openmoonray
. If your path is different, you will need to make changes based on my patch./home/ubuntu/openmoonray
/home/ubuntu/openmoonray/build
/home/ubuntu/openmoonray/installs
/home/ubuntu/openmoonray/release
Python Version
The version of boost MoonRay uses will fail to build with Python 3.10 (which Ubuntu 22.04 ships). Because of this, we add the deadsnakes PPA, install Python 3.9 and configure Boost to build using it (
python-config.jam
).GCC Version
MoonRay doesn’t appear to build on GCC 11 (the default for me), changing to GCC 9 works and is as easy as setting
CC=/usr/bin/gcc-9 CXX=/usr/bin/g++-9
(done by myenv.sh
).Dual ABI Configuration
MoonRay is designed to be built with the dual ABI macro
_GLIBCXX_USE_CXX11_ABI
set to0
, however it defaults to1
with Ubuntu’s packages. Other people have successfully built MoonRay but changing this value to1
within MoonRay, but I decided to set it to0
for everything in order to stay closer to the VFX Reference Platform. Setting this can be done using environment variables:CXX_FLAGS=-D_GLIBCXX_USE_CXX11_ABI=0
(again done by myenv.sh
), with two additional changes tobuilding/CMakeLists.txt
because Boost doesn’t use CMake and OpenColorIO overwrites this environment variable for one of its projects. I’m not an expert on C linking and such, so I’m not sure of the benefits and consequences of each approach. This will likely change in the future ones MoonRay migrates to the 2023 VFX RefPlat (which uses_GLIBCXX_USE_CXX11_ABI=1
).Cyclic Linking Dependencies
It seems like certain MoonRay shared objects have cyclic dependencies, which the linker I’m using wasn’t too happy about. I’ve fixed these using CMake’s
LINK_GROUP
generator expression. If someone with more experience could shed some light on why only some linkers care and if there’s a better fix, I’d appreciate it.Missing Link Dependency
arras/arras4_core/arras4_client/lib/client/api/CMakeLists.txt
is missing a link dependency toBoost::filesystem
, which causes linking to fail on my seemingly stricter linker.Boost::filesystem
is on the link path due to transitive dependencies, but not in the correct order. I’m 90% sure this could be considered a bug, if someone can confirm this I’ll make an issue.GPU Support
I was able to get GPU support to compile & run (after bypassing the
/proc/driver/nvidia/version
checks that don’t work on WSL), but OptiX is seemingly non-functional in WSL:Once again, thank you to everyone who documented their previous efforts and thanks to the DWA team for open sourcing this project and helping out the community. If anyone is not able (or is able) to reproduce my build like this, please let me know in the comments. I’ll try to help out as best as I can.
And finally, some renders:
Rendered in 24 minutes on my i5-10400
Denoised with OIDN
Beta Was this translation helpful? Give feedback.
All reactions