-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Linking errors while compiling against static libraries on Ubuntu 20.04 LTS #10
Comments
Hi Oleg,
On Wed, 2 Sep 2020 at 22:58, olegded ***@***.***> wrote:
I have tried to build vsgXchange against default static glslang libraries
installed via native package manager on Ubuntu 20.04 LTS. It looks like
that this Ubuntu version includes latest glslang version including breaking
changes as described here
<KhronosGroup/glslang#2277>, see deletion of
glslang/Include/revision.h.
Somewhat easy change is to fix <glslang/Include/revision.h> include here
<https://github.com/vsg-dev/vsgXchange/blob/master/src/glsl/ResourceLimits.cpp#L41>,
although it requires changes "#if GLSLANG_PATCH_LEVEL > 3727" test
<https://github.com/vsg-dev/vsgXchange/blob/master/src/glsl/ResourceLimits.cpp#L139-L141>
to make it right.
However, what I really failed so far is to link against the static
libraries resulting in tons of linker errors. I have tried to change add_library(glslang::glslang
UNKNOWN IMPORTED)
<https://github.com/vsg-dev/vsgXchange/blob/master/src/glslangConfig.cmake#L147>
to add_library(glslang::glslang STATIC IMPORTED) (and all subsequent
libraries further in the CMake file), still no success. I couldn't figure
out whether set_target_properties calls need some changes or not, at
least I cannot find which flags would be required here.
Latest self-compiled glslang master branch
<https://github.com/KhronosGroup/glslang> using dynamic libraries works.
Do you have an idea what might be missing?
I don't know what is missing. I'll try it first hand today as I now have a
Kubuntu 20.04 install as a dual boot on my dev system, I have it building
against VulkanSDK but that doesn't help recreate the issue you are seeing.
What were the package names you used of glslang and vulkan?
One thing I'm considering is to see how easy it would be to make glslang a
submodule which is built locally.
Robert.
|
I guess using VulkanSDK could break things too when it will be updated to the latest version (at least the breaking change). Really wondering if there any difference between installing the VulkanSDK via tarball or provided Ubuntu packages. Ubuntu packages look like easier to update via system tools. |
Hi Oleg,
On Thu, 3 Sep 2020 at 09:26, olegded ***@***.***> wrote:
-
Vulkan SDK is at 1.2.148.0, updated as described here Ubuntu packages
<https://vulkan.lunarg.com/sdk/home#linux> - libvulkan1/libvulkan-dev,
lunarg and vulkan* packages
-
glslang-dev, glslang-tools, v8.13.3743+193-1ubuntu20.04-2
I've moved across to Kubuntu 20.04, remove VulkanSDK from my search path,
installed all the above and VSG, vsgXchange & vsgExamples all builds and
link cleanly,
The only problem I had was when I didn't install glslang-tools and
vsgXchange couldn't find the SPIRV-Tools libs and build and attempted a
link anyway, which suggest these are now required libs rather than options.
So are you still getting compile errors with VSG, vsgXchange & vsgExamples
master and the above installed libvulkan-dev, glslang-dev and glslang-tools?
|
Yes and I definitely don't have |
Hi Oleg,
On Thu, 3 Sep 2020 at 13:40, olegded ***@***.***> wrote:
Yes and definitely don't have glslang/Include/revision.h resulting in a
compiler error.
Curious. My install did have this header - my system compiled without any
changes. I wonder if ubuntu has issued a patch for this.
I would say having a self-compiled version with dynamic libraries is a
working solution/workaround. Maybe it's worth to add an install readme file
describing how to install known working version of the glslang library.
I'm currently looking at the glslang repository on github. They look to
have a bit of lets break 3rd party code spree, indicative of projects more
focused on runtimes rather than focused on 3rd parties linking the libs to
do shader compilation/validation.
I haven't figured out a route through this mess with glslang shifting the
goal posts in ways that make it hard to keep code compiling against newer
and older versions of glslang. I will look at the practicality of just
checking out and building glslang locally. If the VSSG/vsgXchange is built
statically then it'd make sense to link glslang statically as well, and
match the dynamic build if this is used as well.
I'd much rather be working on developing the VSG itself rather than trying
to figure out how to cope with libs like glslang breaking code. Reminds me
of the problems working with ffmpeg and Apple over the years...
Robert.
|
Hi Robert, I can confirm that both Oleg |
Hi Robert,
I have tried to build vsgXchange against default static
glslang
libraries installed via native package manager on Ubuntu 20.04 LTS. It looks like that this Ubuntu version includes latestglslang
version including breaking changes as described here, see deletion ofglslang/Include/revision.h
.Somewhat easy change is to fix <glslang/Include/revision.h> include here, although it requires changes to "#if GLSLANG_PATCH_LEVEL > 3727" test to make it right.
However, what I really failed so far is to link against the static libraries resulting in tons of linker errors. I have tried to change add_library(glslang::glslang UNKNOWN IMPORTED) to
add_library(glslang::glslang STATIC IMPORTED)
(and all subsequent libraries further in the CMake file), still no success. I couldn't figure out whetherset_target_properties
calls need some changes or not, at least I cannot find which flags would be required here.Latest self-compiled glslang master branch using dynamic libraries works. This issue can be reproduced by compiling latest
glslang
master as static libraries under Ubuntu 20.04 LTS.Do you have an idea what might be missing?
Regards,
Oleg
The text was updated successfully, but these errors were encountered: