RobertBeckebans / RBDOOM-3-BFG

Doom 3 BFG Edition source port with updated DX12 / Vulkan renderer and modern game engine features
https://www.moddb.com/mods/rbdoom-3-bfg
GNU General Public License v3.0
1.38k stars 247 forks source link

several errors compiling on Linux: nvrhi/nvrhi.h not found and Ternary error with non scalar #814

Closed legluondunet closed 7 months ago

legluondunet commented 7 months ago

Hello, I need help to compile RBDOOM-3-BFG . I followed your guide:

downloaded DXC package and extracted it in ~/.local
made .local/bin/dxc as executable
git clone --recursive https://github.com/RobertBeckebans/RBDOOM-3-BFG.git
cd RBDOOM-3-BFG
git submodule init
git submodule update --recursive
cd neo
./cmake-linux-release.sh 
cd ../build/
make

this is the results of cmake-linux-release.sh command:

$ ./cmake-linux-release.sh 
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.

-- The C compiler identification is GNU 13.2.1
-- The CXX compiler identification is GNU 13.2.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- CMAKE_BUILD_TYPE:Release
-- Performing Test COMPILER_SUPPORTS_CXX17
-- Performing Test COMPILER_SUPPORTS_CXX17 - Success
-- Using module to find Vulkan and components
CMake Warning (dev) at /usr/share/cmake/Modules/FindVulkan.cmake:474 (find_program):
  Policy CMP0109 is not set: find_program() requires permission to execute
  but not to read.  Run "cmake --help-policy CMP0109" for policy details.
  Use the cmake_policy command to set the policy and suppress this warning.

  The file

    /home/romain/.local/bin/dxc

  is readable but not executable.  CMake is using it for compatibility.
Call Stack (most recent call first):
  CMakeLists.txt:386 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found Vulkan: /lib/libvulkan.so (found version "1.3.264") found components: glslc glslangValidator missing components: dxc
-- Using Vulkan: /lib/libvulkan.so
CMake Warning (dev) at extern/nvrhi/CMakeLists.txt:33 (option):
  Policy CMP0077 is not set: option() honors normal variables.  Run "cmake
  --help-policy CMP0077" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.

  For compatibility with older versions of CMake, option is clearing the
  normal variable 'NVRHI_INSTALL'.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Deprecation Warning at extern/nvrhi/thirdparty/cxxopts/CMakeLists.txt:20 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.

-- cxxopts version 2.2.0
-- Found DXCspirv: /home/romain/.local/bin/dxc  
CMake Warning (dev) at idlib/CMakeLists.txt:127 (GET_DIRECTORY_PROPERTY):
  Policy CMP0059 is not set: Do not treat DEFINITIONS as a built-in directory
  property.  Run "cmake --help-policy CMP0059" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found OpenAL: /usr/lib/libopenal.so  
CMake Warning (dev) at CMakeLists.txt:1709 (GET_DIRECTORY_PROPERTY):
  Policy CMP0059 is not set: Do not treat DEFINITIONS as a built-in directory
  property.  Run "cmake --help-policy CMP0059" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Shader include path /run/media/romain/JEUX/Dos-Windows/DOOM/DOOM 3 BFG/RBDOOM-3-BFG/neo/shaders
-- Configuring done (0.4s)
-- Generating done (0.1s)
-- Build files have been written to: /run/media/romain/JEUX/Dos-Windows/DOOM/DOOM 3 BFG/RBDOOM-3-BFG/build

this is the result of the make command:

$ make
[  1%] Creating idlib/precompiled.h.gch for idlib
precompiled.h:96:10: erreur fatale: nvrhi/nvrhi.h : Aucun fichier ou dossier de ce type
   96 | #include "nvrhi/nvrhi.h"
      |          ^~~~~~~~~~~~~~~
compilation terminée.
make[2]: *** [idlib/CMakeFiles/precomp_header_idlib.dir/build.make:71: idlib/CMakeFiles/precomp_header_idlib] Error 1
make[1]: *** [CMakeFiles/Makefile2:416: idlib/CMakeFiles/precomp_header_idlib.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

I verified in this directory:

cd ../neo/extern/nvrhi/include/nvrhi
common  d3d11.h  d3d12.h  nvrhi.h  utils.h  validation.h  vulkan.h

The needed file nvrhi is present. I forgot a step? Why the compile script does not this file nvrhi/nvrhi.h?

my config:

Manjaro 23.0.2 Uranos
Kernel: x86_64 Linux 6.5.3-1-MANJARO
Proc: AMD Ryzen 9 5900HX
GPU: AMD Radeon RX 6600M
Drivers: Mesa 23.1.7
32 Go RAM
legluondunet commented 7 months ago

I resolved this error, the issue caused by a path that contained space, accented characters or was too long. I put RBDOOM-3-BFG GitHub folder to a shorter folder without any space and it finally found nvrhi.h.

Then I had a new compilation error, the same as this one: https://github.com/RobertBeckebans/RBDOOM-3-BFG/issues/803

Modifying code in neo/shaders/builtin/SSAO/ssao_compute.cs.hlsl as described resolved this second compiling issue.

And finally RBDOOM-3-BFG compiling completed.