Skip to content
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

Can't compile from master #964

Open
roland-5 opened this issue Jan 6, 2025 · 12 comments
Open

Can't compile from master #964

roland-5 opened this issue Jan 6, 2025 · 12 comments

Comments

@roland-5
Copy link

roland-5 commented Jan 6, 2025

I tried to compile from master from newest commit f9ca463 but I got error.
Arch Linux
From AUR https://aur.archlinux.org/packages/rbdoom3-bfg-git

Compile error:
https://gist.github.com/roland-5/b1976fef9ac6c8c6a1b860af96f8c320

@ericwomer
Copy link

Compile for me on Fedora 41 system info on master branch up to commit 67987ab

@roland-5
Copy link
Author

roland-5 commented Jan 9, 2025

From version of GCC you have?

@roland-5
Copy link
Author

roland-5 commented Jan 9, 2025

I tried again, and had the same error:

[100%] Building CXX object CMakeFiles/RBDoom3BFG.dir/renderer/NVRHI/BufferObject_NVRHI.cpp.o
[100%] Building CXX object CMakeFiles/RBDoom3BFG.dir/renderer/NVRHI/Framebuffer_NVRHI.cpp.o
[100%] Building CXX object CMakeFiles/RBDoom3BFG.dir/renderer/NVRHI/Image_NVRHI.cpp.o
cc1plus: warning: /home/roland/.cache/paru/clone/rbdoom3-bfg-git/src/rbdoom3-bfg-git/neo/idlib/precompiled.h.gch: created with 'none' debug info, but used with 'dwarf-2' [-Winvalid-pch]
cc1plus: warning: /home/roland/.cache/paru/clone/rbdoom3-bfg-git/src/rbdoom3-bfg-git/neo/idlib/precompiled.h.gch: created with 'none' debug info, but used with 'dwarf-2' [-Winvalid-pch]
cc1plus: warning: /home/roland/.cache/paru/clone/rbdoom3-bfg-git/src/rbdoom3-bfg-git/neo/idlib/precompiled.h.gch: created with 'none' debug info, but used with 'dwarf-2' [-Winvalid-pch]
[100%] Building CXX object CMakeFiles/RBDoom3BFG.dir/renderer/NVRHI/RenderBackend_NVRHI.cpp.o
cc1plus: warning: /home/roland/.cache/paru/clone/rbdoom3-bfg-git/src/rbdoom3-bfg-git/neo/idlib/precompiled.h.gch: created with 'none' debug info, but used with 'dwarf-2' [-Winvalid-pch]
[100%] Building CXX object CMakeFiles/RBDoom3BFG.dir/renderer/NVRHI/RenderDebug_NVRHI.cpp.o
/home/roland/.cache/paru/clone/rbdoom3-bfg-git/src/rbdoom3-bfg-git/neo/sys/posix/posix_main.cpp: In function ‘const char* Posix_Cwd()’:
/home/roland/.cache/paru/clone/rbdoom3-bfg-git/src/rbdoom3-bfg-git/neo/sys/posix/posix_main.cpp:753:15: warning: ignoring return value of ‘char* getcwd(char*, size_t)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
  753 |         getcwd( cwd, sizeof( cwd ) - 1 );
      |         ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
/home/roland/.cache/paru/clone/rbdoom3-bfg-git/src/rbdoom3-bfg-git/neo/sys/posix/posix_main.cpp: In function ‘void tty_Del()’:
/home/roland/.cache/paru/clone/rbdoom3-bfg-git/src/rbdoom3-bfg-git/neo/sys/posix/posix_main.cpp:1145:14: warning: ignoring return value of ‘ssize_t write(int, const void*, size_t)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
 1145 |         write( STDOUT_FILENO, &key, 1 );
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
/home/roland/.cache/paru/clone/rbdoom3-bfg-git/src/rbdoom3-bfg-git/neo/sys/posix/posix_main.cpp:1147:14: warning: ignoring return value of ‘ssize_t write(int, const void*, size_t)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
 1147 |         write( STDOUT_FILENO, &key, 1 );
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
/home/roland/.cache/paru/clone/rbdoom3-bfg-git/src/rbdoom3-bfg-git/neo/sys/posix/posix_main.cpp:1149:14: warning: ignoring return value of ‘ssize_t write(int, const void*, size_t)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
 1149 |         write( STDOUT_FILENO, &key, 1 );
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
/home/roland/.cache/paru/clone/rbdoom3-bfg-git/src/rbdoom3-bfg-git/neo/sys/posix/posix_main.cpp: In function ‘void tty_Left()’:
/home/roland/.cache/paru/clone/rbdoom3-bfg-git/src/rbdoom3-bfg-git/neo/sys/posix/posix_main.cpp:1155:14: warning: ignoring return value of ‘ssize_t write(int, const void*, size_t)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
 1155 |         write( STDOUT_FILENO, &key, 1 );
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
/home/roland/.cache/paru/clone/rbdoom3-bfg-git/src/rbdoom3-bfg-git/neo/sys/posix/posix_main.cpp: In function ‘void tty_Right()’:
/home/roland/.cache/paru/clone/rbdoom3-bfg-git/src/rbdoom3-bfg-git/neo/sys/posix/posix_main.cpp:1161:14: warning: ignoring return value of ‘ssize_t write(int, const void*, size_t)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
 1161 |         write( STDOUT_FILENO, &key, 1 );
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
/home/roland/.cache/paru/clone/rbdoom3-bfg-git/src/rbdoom3-bfg-git/neo/sys/posix/posix_main.cpp:1162:14: warning: ignoring return value of ‘ssize_t write(int, const void*, size_t)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
 1162 |         write( STDOUT_FILENO, "[C", 2 );
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
/home/roland/.cache/paru/clone/rbdoom3-bfg-git/src/rbdoom3-bfg-git/neo/sys/posix/posix_main.cpp: In function ‘void tty_Show()’:
/home/roland/.cache/paru/clone/rbdoom3-bfg-git/src/rbdoom3-bfg-git/neo/sys/posix/posix_main.cpp:1210:30: warning: ignoring return value of ‘ssize_t write(int, const void*, size_t)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
 1210 |                         write( STDOUT_FILENO, buf, strlen( buf ) );
      |                         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/roland/.cache/paru/clone/rbdoom3-bfg-git/src/rbdoom3-bfg-git/neo/sys/posix/posix_main.cpp: In function ‘char* Posix_ConsoleInput()’:
/home/roland/.cache/paru/clone/rbdoom3-bfg-git/src/rbdoom3-bfg-git/neo/sys/posix/posix_main.cpp:1275:46: warning: ignoring return value of ‘ssize_t write(int, const void*, size_t)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
 1275 |                                         write( STDOUT_FILENO, &key, 1 );
      |                                         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
cc1plus: warning: /home/roland/.cache/paru/clone/rbdoom3-bfg-git/src/rbdoom3-bfg-git/neo/idlib/precompiled.h.gch: created with 'none' debug info, but used with 'dwarf-2' [-Winvalid-pch]
[100%] Building CXX object CMakeFiles/RBDoom3BFG.dir/renderer/NVRHI/RenderProgs_NVRHI.cpp.o
cc1plus: warning: /home/roland/.cache/paru/clone/rbdoom3-bfg-git/src/rbdoom3-bfg-git/neo/idlib/precompiled.h.gch: created with 'none' debug info, but used with 'dwarf-2' [-Winvalid-pch]
/home/roland/.cache/paru/clone/rbdoom3-bfg-git/src/rbdoom3-bfg-git/neo/sys/DeviceManager_VK.cpp: In member function ‘virtual bool DeviceManager_VK::CreateDeviceAndSwapChain()’:
/home/roland/.cache/paru/clone/rbdoom3-bfg-git/src/rbdoom3-bfg-git/neo/sys/DeviceManager_VK.cpp:1274:26: error: ‘DynamicLoader’ in namespace ‘vk’ does not name a type; did you mean ‘DynamicState’?
 1274 |         static const vk::DynamicLoader dl;
      |                          ^~~~~~~~~~~~~
      |                          DynamicState
/home/roland/.cache/paru/clone/rbdoom3-bfg-git/src/rbdoom3-bfg-git/neo/sys/DeviceManager_VK.cpp:1276:33: error: ‘dl’ was not declared in this scope
 1276 |         vkGetInstanceProcAddr = dl.getProcAddress<PFN_vkGetInstanceProcAddr>( "vkGetInstanceProcAddr" );
      |                                 ^~
/home/roland/.cache/paru/clone/rbdoom3-bfg-git/src/rbdoom3-bfg-git/neo/sys/DeviceManager_VK.cpp:1276:76: error: expected primary-expression before ‘>’ token
 1276 |         vkGetInstanceProcAddr = dl.getProcAddress<PFN_vkGetInstanceProcAddr>( "vkGetInstanceProcAddr" );
      |                                                                            ^
make[2]: *** [CMakeFiles/RBDoom3BFG.dir/build.make:6575: CMakeFiles/RBDoom3BFG.dir/sys/DeviceManager_VK.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:283: CMakeFiles/RBDoom3BFG.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
==> ERROR: A failure occurred in build().
    Aborting...
error: failed to build 'rbdoom3-bfg-git-r2027.a51833e4-1':
checking dependencies...

Package (2)              Old Version  Net Change

directx-shader-compiler  1.8.2407-1   -38.58 MiB
rapidjson                1.1.0-6       -0.62 MiB

@runlevel5
Copy link

I can compile the code successfully on Fedora 41.

Could you please provide the C++ compiler?

I am not familiar with how arch configure the compilation flag so I guess you could try NOT to use system libs and try to use the bundled libraries to see if the game could be compiled successfully or not

@roland-5
Copy link
Author

gcc -v

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/14.2.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /build/gcc/src/gcc/configure --enable-languages=ada,c,c++,d,fortran,go,lto,m2,objc,obj-c++,rust --enable-bootstrap --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://gitlab.archlinux.org/archlinux/packaging/packages/gcc/-/issues --with-build-config=bootstrap-lto --with-linker-hash-style=gnu --with-system-zlib --enable-__cxa_atexit --enable-cet=auto --enable-checking=release --enable-clocale=gnu --enable-default-pie --enable-default-ssp --enable-gnu-indirect-function --enable-gnu-unique-object --enable-libstdcxx-backtrace --enable-link-serialization=1 --enable-linker-build-id --enable-lto --enable-multilib --enable-plugin --enable-shared --enable-threads=posix --disable-libssp --disable-libstdcxx-pch --disable-werror
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.2.1 20240910 (GCC)

glibc 2.40+r16+gaa533d58ff-2

/etc/makepkg.conf

#!/hint/bash
# shellcheck disable=2034

#
# /etc/makepkg.conf
#

#########################################################################
# SOURCE ACQUISITION
#########################################################################
#
#-- The download utilities that makepkg should use to acquire sources
#  Format: 'protocol::agent'
DLAGENTS=('file::/usr/bin/curl -qgC - -o %o %u'
          'ftp::/usr/bin/curl -qgfC - --ftp-pasv --retry 3 --retry-delay 3 -o %o %u'
          'http::/usr/bin/curl -qgb "" -fLC - --retry 3 --retry-delay 3 -o %o %u'
          'https::/usr/bin/curl -qgb "" -fLC - --retry 3 --retry-delay 3 -o %o %u'
          'rsync::/usr/bin/rsync --no-motd -z %u %o'
          'scp::/usr/bin/scp -C %u %o')

# Other common tools:
# /usr/bin/snarf
# /usr/bin/lftpget -c
# /usr/bin/wget

#-- The package required by makepkg to download VCS sources
#  Format: 'protocol::package'
VCSCLIENTS=('bzr::breezy'
            'fossil::fossil'
            'git::git'
            'hg::mercurial'
            'svn::subversion')

#########################################################################
# ARCHITECTURE, COMPILE FLAGS
#########################################################################
#
CARCH="x86_64"
CHOST="x86_64-pc-linux-gnu"

#-- Compiler and Linker Flags
#CPPFLAGS=""
CFLAGS="-march=native -mtune=native -O2 -pipe -fno-plt -fexceptions \
        -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security \
        -fstack-clash-protection -fcf-protection \
        -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer"
CXXFLAGS="$CFLAGS -Wp,-D_GLIBCXX_ASSERTIONS"
LDFLAGS="-Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now \
         -Wl,-z,pack-relative-relocs,-fuse-ld=mold"
LTOFLAGS="-flto=auto"
#-- Make Flags: change this for DistCC/SMP systems
MAKEFLAGS="-j$(nproc)"
NINJAFLAGS="-j$(nproc)"
#-- Debugging flags
DEBUG_CFLAGS="-g"
DEBUG_CXXFLAGS="$DEBUG_CFLAGS"

#########################################################################
# BUILD ENVIRONMENT
#########################################################################
#
# Makepkg defaults: BUILDENV=(!distcc !color !ccache check !sign)
#  A negated environment option will do the opposite of the comments below.
#
#-- distcc:   Use the Distributed C/C++/ObjC compiler
#-- color:    Colorize output messages
#-- ccache:   Use ccache to cache compilation
#-- check:    Run the check() function if present in the PKGBUILD
#-- sign:     Generate PGP signature file
#
BUILDENV=(!distcc color !ccache check !sign)
#
#-- If using DistCC, your MAKEFLAGS will also need modification. In addition,
#-- specify a space-delimited list of hosts running in the DistCC cluster.
#DISTCC_HOSTS=""
#
#-- Specify a directory for package building.
#BUILDDIR=/tmp/makepkg

#########################################################################
# GLOBAL PACKAGE OPTIONS
#   These are default values for the options=() settings
#########################################################################
#
# Makepkg defaults: OPTIONS=(!strip docs libtool staticlibs emptydirs !zipman !purge !debug !lto !autodeps)
#  A negated option will do the opposite of the comments below.
#
#-- strip:      Strip symbols from binaries/libraries
#-- docs:       Save doc directories specified by DOC_DIRS
#-- libtool:    Leave libtool (.la) files in packages
#-- staticlibs: Leave static library (.a) files in packages
#-- emptydirs:  Leave empty directories in packages
#-- zipman:     Compress manual (man and info) pages in MAN_DIRS with gzip
#-- purge:      Remove files specified by PURGE_TARGETS
#-- debug:      Add debugging flags as specified in DEBUG_* variables
#-- lto:        Add compile flags for building with link time optimization
#-- autodeps:   Automatically add depends/provides
#
OPTIONS=(strip docs !libtool !staticlibs emptydirs zipman purge debug lto)

#-- File integrity checks to use. Valid: md5, sha1, sha224, sha256, sha384, sha512, b2
INTEGRITY_CHECK=(sha256)
#-- Options to be used when stripping binaries. See `man strip' for details.
STRIP_BINARIES="--strip-all"
#-- Options to be used when stripping shared libraries. See `man strip' for details.
STRIP_SHARED="--strip-unneeded"
#-- Options to be used when stripping static libraries. See `man strip' for details.
STRIP_STATIC="--strip-debug"
#-- Manual (man and info) directories to compress (if zipman is specified)
MAN_DIRS=({usr{,/local}{,/share},opt/*}/{man,info})
#-- Doc directories to remove (if !docs is specified)
DOC_DIRS=(usr/{,local/}{,share/}{doc,gtk-doc} opt/*/{doc,gtk-doc})
#-- Files to be removed from all packages (if purge is specified)
PURGE_TARGETS=(usr/{,share}/info/dir .packlist *.pod)
#-- Directory to store source code in for debug packages
DBGSRCDIR="/usr/src/debug"
#-- Prefix and directories for library autodeps
LIB_DIRS=('lib:usr/lib' 'lib32:usr/lib32')

#########################################################################
# PACKAGE OUTPUT
#########################################################################
#
# Default: put built package and cached source in build directory
#
#-- Destination: specify a fixed directory where all packages will be placed
#PKGDEST=/home/packages
#-- Source cache: specify a fixed directory where source files will be cached
#SRCDEST=/home/sources
#-- Source packages: specify a fixed directory where all src packages will be placed
#SRCPKGDEST=/home/srcpackages
#-- Log files: specify a fixed directory where all log files will be placed
#LOGDEST=/home/makepkglogs
#-- Packager: name/email of the person or organization building packages
#PACKAGER="John Doe <[email protected]>"
#-- Specify a key to use for package signing
#GPGKEY=""

#########################################################################
# COMPRESSION DEFAULTS
#########################################################################
#
COMPRESSGZ=(gzip -c -f -n)
COMPRESSBZ2=(bzip2 -c -f)
COMPRESSXZ=(xz -c -z -)
COMPRESSZST=(zstd -c -T0 --ultra -20 -)
COMPRESSLRZ=(lrzip -q)
COMPRESSLZO=(lzop -q)
COMPRESSZ=(compress -c -f)
COMPRESSLZ4=(lz4 -q)
COMPRESSLZ=(lzip -c -f)

#########################################################################
# EXTENSION DEFAULTS
#########################################################################
#
# PKGEXT='.pkg.tar.zst'
# SRCEXT='.src.tar.gz'

# Disable compression
PKGEXT='.pkg.tar'
SRCEXT='.src.tar'

#########################################################################
# OTHER
#########################################################################
#
#-- Command used to run pacman as root, instead of trying sudo and su
#PACMAN_AUTH=()
# vim: set ft=sh ts=2 sw=2 et:

@AlphaHeX
Copy link

I got the same issue. I have even stripped out all C and CXX flags but the error is in the same place

[100%] Building CXX object CMakeFiles/RBDoom3BFG.dir/renderer/NVRHI/RenderProgs_NVRHI.cpp.o
/home/h3x/.cache/paru/clone/rbdoom3-bfg-git/src/rbdoom3-bfg-git/neo/sys/DeviceManager_VK.cpp: In member function ‘virtual bool DeviceManager_VK::CreateDeviceAndSwapChain()’:
/home/h3x/.cache/paru/clone/rbdoom3-bfg-git/src/rbdoom3-bfg-git/neo/sys/DeviceManager_VK.cpp:1274:26: error: ‘DynamicLoader’ in namespace ‘vk’ does not name a type; did you mean ‘DynamicState’?
1274 | static const vk::DynamicLoader dl;
| ^~~~~~~~~~~~~
| DynamicState
/home/h3x/.cache/paru/clone/rbdoom3-bfg-git/src/rbdoom3-bfg-git/neo/sys/DeviceManager_VK.cpp:1276:33: error: ‘dl’ was not declared in this scope
1276 | vkGetInstanceProcAddr = dl.getProcAddress<PFN_vkGetInstanceProcAddr>( "vkGetInstanceProcAddr" );
| ^~
/home/h3x/.cache/paru/clone/rbdoom3-bfg-git/src/rbdoom3-bfg-git/neo/sys/DeviceManager_VK.cpp:1276:76: error: expected primary-expression before ‘>’ token
1276 | vkGetInstanceProcAddr = dl.getProcAddress<PFN_vkGetInstanceProcAddr>( "vkGetInstanceProcAddr" );
| ^
make[2]: *** [CMakeFiles/RBDoom3BFG.dir/build.make:6575: CMakeFiles/RBDoom3BFG.dir/sys/DeviceManager_VK.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:283: CMakeFiles/RBDoom3BFG.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
==> ERROR: A failure occurred in build().
Aborting...

@hollowleviathan
Copy link

The root cause of the issue for arch users seems to be incompatibility with compiling with vulkan-headers 1.4.303.

I was able to compile and run rbdoom-3-bfg on arch after I downgraded vulkan-headers from 1.4.303 to 1.3.295. (After install, you can upgrade the headers again, it does not need them to run, just compile)

@AlphaHeX
Copy link

AlphaHeX commented Feb 3, 2025

The root cause of the issue for arch users seems to be incompatibility with compiling with vulkan-headers 1.4.303.

I was able to compile and run rbdoom-3-bfg on arch after I downgraded vulkan-headers from 1.4.303 to 1.3.295. (After install, you can upgrade the headers again, it does not need them to run, just compile)

Thank you, but I would call it a workaround. When can we expect RBDOOM would be compatible with vulkan-headers 1.4.x?

@RobertBeckebans
Copy link
Owner

Can you checkout the branch nvrhi-update-20250204 which should resolve the Vulkan 1.4 headers issue? See #976

git pull
git checkout nvrhi-update-20250204
git submodule update --init --recursive

and then just redo cmake and recompile.

@hollowleviathan
Copy link

hollowleviathan commented Feb 4, 2025

I cloned the repo to a fresh folder, built from this branch, but got the same error as before

git clone --recursive https://github.com/RobertBeckebans/RBDOOM-3-BFG.git
cd RBDOOM-3-BFG/
git checkout nvrhi-update-20250204
git submodule update --init --recursive
cd neo/
./cmake-linux-release.sh
cd ../build/
make -j8
/home/hollow/src/RBDOOM-3-BFG/neo/sys/DeviceManager_VK.cpp:1274:26: error: ‘DynamicLoader’ in namespace ‘vk’ does not name a type; did you mean ‘DynamicState’?
 1274 |         static const vk::DynamicLoader dl;
      |                          ^~~~~~~~~~~~~
      |                          DynamicState

@RobertBeckebans
Copy link
Owner

Then it might be something different. NVRHI got an explicit Vulkan update.

* Updated Vulkan-Headers to v1.4.307.

@hollowleviathan
Copy link

hollowleviathan commented Feb 4, 2025

based on this commit, RobertBeckebans/nvrhi@edfa604

I changed line 1274 from static const vk::DynamicLoader dl; to static const vk::detail::DynamicLoader dl;

and it compiled and ran.

EDIT: in fact, this change gets master branch to compile and run as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants