Work-in-progress and notes for building Dawn for Linux on Power9 (x64 should be easier). Tested on Debian Bullseye.
- Depot Tools doesn't work, so CMake appears to be the only way. If this is of further interest Depot Tools fails because some prebuilt binaries aren't available for ppc64le (some are, some are out of date, and some are missing). Building
gn
manually (see building Chrome) then settingDEPOT_TOOLS_UPDATE=0
allowsgn
to generate the build scripts but this was still failing. CMake works so don't try any further. - Install all the depdendencies. The ones to build Chrome were already added but also:
sudo apt install libx11-dev xcb libxcb-xcb-dev x11-xkb-utils libx11-xcb-dev
. - GCC will build but with warnings (mostly ABI changes but also the
UNREACHABLE()
macro usage needs slightly reworking do be GCC friendly) so install Clang (which is what Dawn is developed with anyway). - Clang needs setting as the default compiler:
sudo update-alternatives --config c++ sudo update-alternatives --config cc
- Configure CMake to build (with Ninja) as a shared library:
cmake -B out/rel -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -G Ninja
- Optionally other settings can be configured such as:
-DENABLE_OPENGLES=OFF
- Build the WebGPU library:
ninja -C out/rel webgpu_dawn
- This (after a lot of noise from the 144 core Power9!) should have generated
libwebgpu_dawn.so
,libdawn_native.so
andlibdawn_platform.so
. - Building the sample files currently fails:
$ ninja -C out/rel FAILED: samples/dawn/ComputeBoids /usr/bin/ld: src/dawn/common/libdawn_common.a(SystemUtils.cpp.o): undefined reference to symbol 'dladdr@@GLIBC_2.17' /usr/bin/ld: /lib/powerpc64le-linux-gnu/libdl.so.2: error adding symbols: DSO missing from command line
- So far I fixed this manually by passing
-ldl
on the same command lines showing the failures:
More to come.