Autodesk / Autodesk/Aurora

Help Building for Fedora Linux

Open
#36 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
620
Forks
57
PR merge metrics
No merged PRs in 30d

Description

First of all, thanks for upgrading Aurora and its USD version.

I've been trying to build Aurora all day, but I keep having _A LOT_ of errors. I even tried to build it on an Ubuntu 20.04 Container using [Distrobox](https://github.com/89luca89/distrobox), but I encounter the same errors as my host machine.

Would appreciate some help since I'm not that advanced in programming :)

Here's a diff of the patches I made:
```
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f1fb42a..040a2d6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -94,7 +94,7 @@ if(MSVC)
set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1)
else()
# Enables strict standard conformance and warning as errors
- add_compile_options(-Wall -Wextra -Wpedantic -Werror -Wno-unknown-pragmas -Wno-gnu-zero-variadic-macro-arguments)
+ add_compile_options(-Wextra -Wno-unknown-pragmas -Wno-deprecated)
endif()

include(externalsConfig OPTIONAL RESULT_VARIABLE EXTERNALS_CONFIG)
diff --git a/Libraries/Aurora/Source/HGI/HGIMaterial.cpp b/Libraries/Aurora/Source/HGI/HGIMaterial.cpp
index 1e94684..6cca38d 100644
--- a/Libraries/Aurora/Source/HGI/HGIMaterial.cpp
+++ b/Libraries/Aurora/Source/HGI/HGIMaterial.cpp
@@ -40,7 +40,7 @@ void HGIMaterial::update()
{
// Build a structure from values map into staging buffer.
void* pStaging = _ubo->handle()->GetCPUStagingAddress();
- ::memcpy_s(pStaging, uniformBuffer().size(), uniformBuffer().data(), uniformBuffer().size());
+ std::memcpy(pStaging, uniformBuffer().data(), uniformBuffer().size());

// Transfer staging buffer to GPU.
pxr::HgiBlitCmdsUniquePtr blitCmds = _pRenderer->hgi()->CreateBlitCmds();
diff --git a/Libraries/Aurora/Source/MaterialShader.cpp b/Libraries/Aurora/Source/MaterialShader.cpp
index 188a06e..15dddca 100644
--- a/Libraries/Aurora/Source/MaterialShader.cpp
+++ b/Libraries/Aurora/Source/MaterialShader.cpp
@@ -21,7 +21,7 @@ MaterialShader::MaterialShader(MaterialShaderLibrary* pShaderLibrary, int librar
_def(def)
{
// Initialize ref. counts to zero.
- for (int i = 0; i < entryPoints.size(); i++)
+ for (size_t i = 0; i < entryPoints.size(); i++)
{
_entryPointNameLookup[entryPoints[i]] = i;
_entryPoints.push_back({ entryPoints[i], 0 });
@@ -251,7 +251,7 @@ bool MaterialShaderLibrary::update(CompileShader compileFunction, DestroyShader
void MaterialShaderLibrary::forceRebuildAll()
{
// Add all active shaders to compilation pending list.
- for (int i = 0; i < _shaderState.size(); i++)
+ for (size_t i = 0; i < _shaderState.size(); i++)
{
MaterialShaderPtr pShader = _shaderState[i].first.lock();
if (pShader)
diff --git a/Libraries/Aurora/Source/MaterialShader.h b/Libraries/Aurora/Source/MaterialShader.h
index 5137bb4..f646e5b 100644
--- a/Libraries/Aurora/Source/MaterialShader.h
+++ b/Libraries/Aurora/Source/MaterialShader.h
@@ -16,6 +16,7 @@
#include "Aurora/Foundation/Log.h"
#include "Properties.h"
#include "UniformBuffer.h"
+#include

BEGIN_AURORA

diff --git a/Libraries/Foundation/API/Aurora/Foundation/Utilities.h b/Libraries/Foundation/API/Aurora/Foundation/Utilities.h
index d446f6a..8c28827 100644
--- a/Libraries/Foundation/API/Aurora/Foundation/Utilities.h
+++ b/Libraries/Foundation/API/Aurora/Foundation/Utilities.h
@@ -24,6 +24,7 @@
#include
#include
#include
+#include

namespace Aurora
{
```

### Minifying Shaders

It seems to be an issue in [MainEntryPoints.slang](https://github.com/Autodesk/Aurora/blob/main/Libraries/Aurora/Source/Shaders/MainEntryPoints.slang), also it doesn't automatically set the Slang Compiler, so I have to specify it using **Slang_COMPILER**
```
[ 4%] Minifying path tracing shaders to /home/adro/Applications/Aurora/SourceFedora/Build/Libraries/Aurora/CompiledShaders/CommonShaders.h
Compiling main entry point /home/adro/Applications/Aurora/SourceFedora/Libraries/Aurora/Source/Shaders/MainEntryPoints.slang with Slang compiler /home/adro/Applications/Aurora/Externals/Slang/bin/linux-x64/release/slangd to DXIL in header /home/adro/Applications/Aurora/SourceFedora/Build/Libraries/Aurora/CompiledShaders/MainEntryPoints.h
```
A workaround (?) is to manually execute the python command: `python Scripts/minifyShadersFolder.py Libraries/Aurora/Source/Shaders Build/Libraries/Aurora/CompiledShaders/CommonShaders.h`

### Current Errors

```
[ 4%] Building CXX object Libraries/Aurora/CMakeFiles/Aurora.dir/Source/HGI/HGIRenderer.cpp.o
In file included from /home/adro/Applications/Aurora/SourceFedora/Libraries/Aurora/Source/HGI/HGIMaterial.h:17,
from /home/adro/Applications/Aurora/SourceFedora/Libraries/Aurora/Source/HGI/HGIRenderer.cpp:21:
/home/adro/Applications/Aurora/SourceFedora/Libraries/Aurora/Source/MaterialBase.h: In constructor ‘Aurora::TextureProperties::TextureProperties(const std::vector&)’:
/home/adro/Applications/Aurora/SourceFedora/Libraries/Aurora/Source/MaterialBase.h:34:27: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
34 | for (int i = 0; i < names.size(); i++)
| ~~^~~~~~~~~~~~~~
/home/adro/Applications/Aurora/SourceFedora/Libraries/Aurora/Source/HGI/HGIRenderer.cpp: In constructor ‘Aurora::HGIRenderer::HGIRenderer(uint32_t)’:
/home/adro/Applications/Aurora/SourceFedora/Libraries/Aurora/Source/HGI/HGIRenderer.cpp:47:35: error: ‘g_sInitializeDefaultMaterialType’ is not a member of ‘CommonShaders’
47 | "Default", CommonShaders::g_sInitializeDefaultMaterialType);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/adro/Applications/Aurora/SourceFedora/Libraries/Aurora/Source/HGI/HGIRenderer.cpp: In member function ‘virtual void Aurora::HGIRenderer::render(uint32_t, uint32_t)’:
/home/adro/Applications/Aurora/SourceFedora/Libraries/Aurora/Source/HGI/HGIRenderer.cpp:436:71: error: no matching function for call to ‘pxrInternal_v0_24__pxrReserved__::Hgi::CreateComputeCmds()’
436 | HgiComputeCmdsUniquePtr computeCmds = hgi()->CreateComputeCmds();
| ~~~~~~~~~~~~~~~~~~~~~~~~^~
In file included from /home/adro/Applications/Aurora/SourceFedora/Libraries/Aurora/Source/pch.h:126,
from /home/adro/Applications/Aurora/SourceFedora/Build/Libraries/Aurora/CMakeFiles/Aurora.dir/cmake_pch.hxx:5,
from :
/home/adro/Applications/Aurora/ExternalsFedora/USD/include/pxr/imaging/hgi/hgi.h:191:37: note: candidate: ‘virtual pxrInternal_v0_24__pxrReserved__::HgiComputeCmdsUniquePtr pxrInternal_v0_24__pxrReserved__::Hgi::CreateComputeCmds(const pxrInternal_v0_24__pxrReserved__::HgiComputeCmdsDesc&)’
191 | virtual HgiComputeCmdsUniquePtr CreateComputeCmds(
| ^~~~~~~~~~~~~~~~~
/home/adro/Applications/Aurora/ExternalsFedora/USD/include/pxr/imaging/hgi/hgi.h:191:37: note: candidate expects 1 argument, 0 provided
/home/adro/Applications/Aurora/SourceFedora/Libraries/Aurora/Source/HGI/HGIRenderer.cpp:449:86: error: no matching function for call to ‘pxrInternal_v0_24__pxrReserved__::Hgi::CreateComputeCmds()’
449 | HgiComputeCmdsUniquePtr postProcessComputeCmds = hgi()->CreateComputeCmds();
| ~~~~~~~~~~~~~~~~~~~~~~~~^~
/home/adro/Applications/Aurora/ExternalsFedora/USD/include/pxr/imaging/hgi/hgi.h:191:37: note: candidate: ‘virtual pxrInternal_v0_24__pxrReserved__::HgiComputeCmdsUniquePtr pxrInternal_v0_24__pxrReserved__::Hgi::CreateComputeCmds(const pxrInternal_v0_24__pxrReserved__::HgiComputeCmdsDesc&)’
191 | virtual HgiComputeCmdsUniquePtr CreateComputeCmds(
| ^~~~~~~~~~~~~~~~~
/home/adro/Applications/Aurora/ExternalsFedora/USD/include/pxr/imaging/hgi/hgi.h:191:37: note: candidate expects 1 argument, 0 provided
```

```
[ 22%] Building CXX object Tests/AuroraInternals/CMakeFiles/AuroraInternalsTests.dir/__/__/Libraries/Aurora/Source/MaterialShader.cpp.o
/home/adro/Applications/Aurora/SourceFedora/Libraries/Aurora/Source/HGI/HGIScene.cpp: In member function ‘void Aurora::HGIScene::rebuildInstanceList()’:
/home/adro/Applications/Aurora/SourceFedora/Libraries/Aurora/Source/HGI/HGIScene.cpp:131:19: error: ‘using std::__shared_ptr_access::element_type = class Aurora::HGIMaterial’ {aka ‘class Aurora::HGIMaterial’} has no member named ‘hasValue’; did you mean ‘clearValue’?
131 | if (pMtl->hasValue("base_color_image"))
| ^~~~~~~~
| clearValue
/home/adro/Applications/Aurora/SourceFedora/Libraries/Aurora/Source/HGI/HGIScene.cpp:133:68: error: ‘using std::__shared_ptr_access::element_type = class Aurora::HGIMaterial’ {aka ‘class Aurora::HGIMaterial’} has no member named ‘asImage’
133 | pBaseColorImage = dynamic_pointer_cast(pMtl->asImage("base_color_image"));
| ^~~~~~~
/home/adro/Applications/Aurora/SourceFedora/Libraries/Aurora/Source/HGI/HGIScene.cpp:145:19: error: ‘using std::__shared_ptr_access::element_type = class Aurora::HGIMaterial’ {aka ‘class Aurora::HGIMaterial’} has no member named ‘hasValue’; did you mean ‘clearValue’?
145 | if (pMtl->hasValue("specular_roughness_image"))
| ^~~~~~~~
| clearValue
/home/adro/Applications/Aurora/SourceFedora/Libraries/Aurora/Source/HGI/HGIScene.cpp:148:54: error: ‘using std::__shared_ptr_access::element_type = class Aurora::HGIMaterial’ {aka ‘class Aurora::HGIMaterial’} has no member named ‘asImage’
148 | dynamic_pointer_cast(pMtl->asImage("specular_roughness_image"));
| ^~~~~~~
/home/adro/Applications/Aurora/SourceFedora/Libraries/Aurora/Source/HGI/HGIScene.cpp:160:19: error: ‘using std::__shared_ptr_access::element_type = class Aurora::HGIMaterial’ {aka ‘class Aurora::HGIMaterial’} has no member named ‘hasValue’; did you mean ‘clearValue’?
160 | if (pMtl->hasValue("opacity_image"))
| ^~~~~~~~
| clearValue
/home/adro/Applications/Aurora/SourceFedora/Libraries/Aurora/Source/HGI/HGIScene.cpp:162:66: error: ‘using std::__shared_ptr_access::element_type = class Aurora::HGIMaterial’ {aka ‘class Aurora::HGIMaterial’} has no member named ‘asImage’
162 | pOpacityImage = dynamic_pointer_cast(pMtl->asImage("opacity_image"));
| ^~~~~~~
/home/adro/Applications/Aurora/SourceFedora/Libraries/Aurora/Source/HGI/HGIScene.cpp:174:19: error: ‘using std::__shared_ptr_access::element_type = class Aurora::HGIMaterial’ {aka ‘class Aurora::HGIMaterial’} has no member named ‘hasValue’; did you mean ‘clearValue’?
174 | if (pMtl->hasValue("normal_image"))
| ^~~~~~~~
| clearValue
/home/adro/Applications/Aurora/SourceFedora/Libraries/Aurora/Source/HGI/HGIScene.cpp:176:65: error: ‘using std::__shared_ptr_access::element_type = class Aurora::HGIMaterial’ {aka ‘class Aurora::HGIMaterial’} has no member named ‘asImage’
176 | pNormalImage = dynamic_pointer_cast(pMtl->asImage("normal_image"));
| ^~~~~~~
/home/adro/Applications/Aurora/SourceFedora/Libraries/Aurora/Source/HGI/HGIScene.cpp: In member function ‘void Aurora::HGIScene::createResources()’:
/home/adro/Applications/Aurora/SourceFedora/Libraries/Aurora/Source/HGI/HGIScene.cpp:490:52: error: ‘g_sInitializeDefaultMaterialType’ is not a member of ‘CommonShaders’
490 | "InitializeMaterial.slang", CommonShaders::g_sInitializeDefaultMaterialType);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```

_Thanks a lot in advance._

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the Fedora build and reviewing CMakeLists.txt plus Scripts/minifyShadersFolder.py for the shader-generation path. Then inspect MainEntryPoints.slang, HGIRenderer.cpp, HGIScene.cpp, and the referenced USD hgi.h API alongside the reported compiler errors. Done means the documented build completes on Fedora without the reported shader and C++ compilation failures.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, cpp, linux, python
Domain
build-system, devtools, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.