VCVRack / rack-plugin-toolchain

53 stars 12 forks source link

Linux cross compiler missing KHR/khrplatform.h #26

Closed qno closed 1 year ago

qno commented 1 year ago

Hi,

if a plugin includes <GLFW/glfw3.h> form Rack-SDK (Rack-SDK-lin-x64/dep/include/GLFW/glfw3.h) it doesn't compile using the rack-toolchain.

It fails with fatal error: KHR/khrplatform.h: No such file or directory.

/home/build/rack-plugin-toolchain/local/x86_64-ubuntu16.04-linux-gnu/bin/x86_64-ubuntu16.04-linux-gnu-g++  -DARCH_LIN -DARCH_X64 -Dplugin_EXPORTS -I/__w/QRX/QRX/include -I/home/build/rack-plugin-toolchain/Rack-SDK-lin-x64/include -I/home/build/rack-plugin-toolchain/Rack-SDK-lin-x64/dep/include -I/__w/QRX/QRX/thirdparty/sml/include -I/__w/QRX/QRX/thirdparty/sigslot/include  -fPIC -g -O3 -fPIC -march=nehalem -O3 -DNDEBUG -fPIC   -fvisibility=hidden -fvisibility-inlines-hidden -fPIC -g -O3 -funsafe-math-optimizations -fno-omit-frame-pointer -Wall -Wextra -Wno-unused-parameter -fno-gnu-unique -Wl,-rpath=/tmp/Rack2 -Wno-subobject-linkage -std=gnu++17 -o CMakeFiles/plugin.dir/src/PluginSettings.cpp.o -c /__w/QRX/QRX/src/PluginSettings.cpp
In file included from /home/build/rack-plugin-toolchain/local/x86_64-ubuntu16.04-linux-gnu/x86_64-ubuntu16.04-linux-gnu/sysroot/usr/include/GL/gl.h:2050,
                 from /home/build/rack-plugin-toolchain/Rack-SDK-lin-x64/dep/include/GLFW/glfw3.h:241,
                 from /__w/QRX/QRX/include/boundary/io/Keys.hpp:3,
                 from /__w/QRX/QRX/include/cvwizard/ModuleSettings.hpp:3,
                 from /__w/QRX/QRX/include/PluginSettings.hpp:3,
                 from /__w/QRX/QRX/src/PluginSettings.cpp:1:
/home/build/rack-plugin-toolchain/local/x86_64-ubuntu16.04-linux-gnu/x86_64-ubuntu16.04-linux-gnu/sysroot/usr/include/GL/glext.h:56:10: fatal error: KHR/khrplatform.h: No such file or directory
   56 | #include <KHR/khrplatform.h>
      |          ^~~~~~~~~~~~~~~~~~~
compilation terminated.
qno commented 1 year ago

Looks like you also need to copy /usr/include/KHR into the x86_64-ubuntu16.04-linux-gnu/sysroot/usr/include from the host.

https://github.com/VCVRack/rack-plugin-toolchain/blob/v2/Makefile#L45

cschol commented 1 year ago

Thanks for the report. Can you provide an example plugin where this fails so I can test the solution?

qno commented 1 year ago

It failes for https://github.com/qno/QRX and it is required to switch to the branch feature/create_cvwizard.

https://github.com/qno/QRX/tree/feature/create_cvwizard

This is the failing CI log - https://github.com/qno/QRX/actions/runs/3724910802/jobs/6317385917#step:5:99

qno commented 1 year ago

Oh - and just run the Makefile, ignore all other setup stuff from README (it is not required at all anymore).

cschol commented 1 year ago

Reproduced the issue. Thanks. I will apply your fix and check again.