Linux build failed

[1/3] Compile Module.VulkanShaderFormat.cpp
In file included from /home/mariusz/storage/UnrealEngine-4.27/Engine/Intermediate/Build/Linux/B4D820EA/ShaderCompileWorker/Development/VulkanShaderFormat/Module.VulkanShaderFormat.cpp:2:
In file included from /home/mariusz/storage/UnrealEngine-4.27/Engine/Source/Developer/VulkanShaderFormat/Private/VulkanBackend.cpp:38:
In file included from Developer/ShaderCompilerCommon/Public/ShaderCompilerCommon.h:6:
In file included from Runtime/RenderCore/Public/UniformBuffer.h:9:
In file included from Runtime/RenderCore/Public/ShaderParameterMacros.h:10:
In file included from Runtime/RenderCore/Public/ShaderParameterMetadata.h:12:
In file included from Runtime/RHI/Public/RHI.h:2315:
In file included from Runtime/RHI/Public/RHIUtilities.h:15:
In file included from Runtime/RHI/Public/RHICommandList.h:28:
In file included from Runtime/Core/Public/ProfilingDebugging/CsvProfiler.h:20:
In file included from ThirdParty/Linux/LibCxx/include/c++/v1/atomic:571:
In file included from ThirdParty/Linux/LibCxx/include/c++/v1/__threading_support:33:
/usr/include/semaphore.h:24:11: fatal error: 'bits/types/struct_timespec.h' file not found
# include <bits/types/struct_timespec.h>
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make: *** [Makefile:933: ShaderCompileWorker] Error 6
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04.6 LTS"

I’m following instruction from here: https://docs.unrealengine.com/4.27/en-US/SharingAndReleasing/Linux/BeginnerLinuxDeveloper/SettingUpAnUnrealWorkflow/

Any ideas?

I think you need to download some C++ libraries from the Ubuntu repository

POSIX (Pthreads)

Thank you for your reply.

Sorry I forgot to add. I do have it in system.

/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h in system

None of me projects with default system include paths, complained when I tried add smaphore.h to it. So it seems to me that there is a problem with UE build system.

I try to create link to /usr/include/bits → /usr/include/x86_64-linux-gnu/bits, but that breaks in other beautiful ways :slight_smile:

FLY I’m using 4.27.2 release.

Maybe if you modify the Makefile and put the correct path it will work.
Or maybe you need to modify/create an environment variable.
Another option is that you copy all the files you need inside the this path.

They are just ideas, I really don’t know what the real problem is. I only see that the PATHs are different.

You should not need to edit the paths.
It seems like something about the compilation setup on your system is not correctly configured.
Have you installed “build-essential” ?
Can you build other programs on the same machine?

Yes, no issue with other C++ builds. As stated before I added semaphore.h to one of my projects main.cpp and it build fine. Build is using semaphore.h from /usr/include instead EU ThirdParty folder. I did checked my env settings and I’m not sure what could affect it.

Well, LibCxx/include/c++/v1/__threading_support makes it look like someone’s trying to replace part of the standard library, which is never a good idea.
If you want to do that kind of thing, you should use a Docker container or something similar, for hermetic isolation.
(“you” being whoever made that build rule.)

I can’t offer any other advice than using the standard tools (IWYU, strace, adding -MD to CFLAGS, and so on) to try to figure out what’s going on, and then figure out how to fix it with the minimal amount of surgery.