Nice. That is the best solution.
I’ll point out that there are other solutions here, mostly involving modifications to the OpenVDB source code:
- Compile with a lower optimization level, which may or may not help. This also has the downside that things will run slower.
- Split the offending source file into two or more smaller files.
- Move more implementation out of the header files and into the C++ files. This can make each compilation unit use slightly less memory.
- Reduce the amount of templating in the header files. This is the hardest to do, but also will probably (along with 2) have the most benefit.