GafferHQ / dependencies

All 3rd party dependencies necessary for building Gaffer
33 stars 26 forks source link

Building against GCC 9.3.1 (devtoolset-9) #193

Closed boberfly closed 2 years ago

boberfly commented 3 years ago

Hey John,

I discovered while building on ASWF's docker (aswf/ci-base:2021) that it will fail to build OSL.

The solution I found was putting this into the LLVM config: https://github.com/AcademySoftwareFoundation/aswf-docker/blob/master/scripts/common/build_clang.sh#L19 -DGCC_INSTALL_PREFIX="/opt/rh/devtoolset-9/root/usr"

I am wondering now how would you put this in so that it satisfies all variants. Perhaps current LLVM builds should be building on "/opt/rh/devtoolset-6/root/usr" also? Putting it into platform:linux would affect non-CentOS distros also, as they would just use the system default of /usr. A dedicated variant seems a bit overkill here, what do you think?

johnhaddon commented 3 years ago

Hey Alex, I'm not sure I'm following here. Is the link to build_clang.sh purely for illustration of GCC_INSTALL_PREFIX, and you were actually building GafferHQ/dependencies rather than running build_clang.sh? So you're trying to build GafferHQ/dependencies but in the aswf/ci-base:2021 container?

We're still on GCC 6 in our current build container, but it too is located in /opt/rh/devtoolset-{version}, so I wonder why we're not getting a similar problem. In our build container, we have that GCC on our PATH - is that the case in the aswf container too? And what does the OSL build failure look like?

boberfly commented 3 years ago

Hey John, so yes I am purely building GafferHQ/dependencies ignoring whatever aswf comes with (apart from the gcc 9.3.1 and things like cmake, I am adding a few rpm's that are in GafferHQ/build also). When you boot into the docker the gcc version is already set into the path and defaults to it.

The error I was getting with OSL was that it was picking up the system's /usr/include/c++/4.8.5/ directory for some reason, so it was failing in oslconfig.h on things like integer_sequence not existing in std and something else (sorry moved on from that and didn't copy the exact error). But basically it looked like it was getting the older <type_traits> from gcc 4.8, I guess inherited by LLVM.

Yep I wanted to get ahead on some stuff using a later compiler, hopefully it helps you out without needing to do much effort when you decide to jump onto 9.3.1. All good maybe it's just an oddity with the ASWF container.

johnhaddon commented 3 years ago

Thanks Alex. I'm keen to get up to 9.3.1 myself, but we've only just coaxed certain key stakeholders onto 6.3.1 so I'm moving slowly. Definitely good to know that trouble is coming, so thanks for the heads up! I think maybe the best way to deal with this would be for build.py to add something like compilerRoot to the global variables (by searching on PATH), and then we could do -DGCC_INSTALL_PREFIX={compilerRoot} in the LLVM config. How does that sound?