Jump to content
The Dark Mod Forums

Linux compilation errors: which distributions & toolsets are known to work when compiling from source?


t405

Recommended Posts

I am curious as to which distributions and tool version are known to work when compiling either the 2.10 source archive or svn trunk.

Cmake errors out with both Archlinux and Mint 21 for me. For good measure I will include some information I gathered about these errors, but I just want to be able to successfully build tdm on something. (My end goal is to compile in either pulseaudio or pipewire support for openal if that's possible; even though this thread got my audio working (arch audio subsystem is pipewire{,-alsa,-audio,-pulse} & jack2 ) )

I've also tried compiling against the latest svn trunk, that fails too, although the point in which it fails is slightly different.

What do the developers use to build the linux release?

System information for the failed builds against the 2.10 archive:

System #1: cmake 3.22.1 | gcc 11.3.0 | kernel 5.15.0-56-generic | distro Linux Mint 21
System #2: cmake 3.25.1 | gcc 12.2.0 | kernel 5.15.83-1-lts | distro Arch Linux

src archive used: 

sha256sum thedarkmod.2.10.src.7z
73aa974635293e6ca07396be19901355f8224637bdf3ce73404b8eef74148a1c  thedarkmod.2.10.src.7z


Build command from root of extracted src:
 

[ -d build ] && rm -rf build
mkdir build && cd build && cmake --debug-output --loglevel=DEBUG -DCMAKE_BUILD_TYPE="Release" .. &> cmake.$distro.log  && \
  make -d --debug=a -j &> make.$distro.log ; cd ..

 

make.mint.log.gz make.arch.log.gz cmake.mint.log.gz cmake.arch.log.gz

Edited by t405
forgot things
Link to comment
Share on other sites

1 hour ago, datiswous said:

Why don't you install the default way with the installer? EFX works.

Btw. I'm using Manjaro Linux (Arch based distro)

TDM works fine (sans the aformentioned audio workaround) when installed via the installer. 

I still want to be able to build it from source.

  • Like 1
Link to comment
Share on other sites

I use GCC 5.4.0, stock on Ubuntu 16.04.
The reason for staying on old version is to generate binaries against old enough GLIBC, so that users can run them on their system (unless it is even older).

Some other people (@nbohr1more, @MirceaKitsune) use whatever they have...


This error is from doctest:

/home/user/tdm210/ThirdParty/artefacts/doctest/include/doctest/doctest.h:3998:47: error: size of array altStackMem is not an integral constant-expression
 3998 |         static char             altStackMem[4 * SIGSTKSZ];
      |                                               ^

It was fixed in doctest 2.4.8, as described here:

So it should happen on trunk (but happens on 2.10).
Given that this is header-only library, you can download its header and put it into ThirdParty/artefacts/doctest manually.


I wonder what's the problem with current trunk?

 

Link to comment
Share on other sites

15 hours ago, stgatilov said:


I wonder what's the problem with current trunk?

 

The problem is the same on both my systems and comes at the very end of `make`, I snipped out irrelevant lines from the log. 

 

    [ ... SNIP ... ]
   Finished prerequisites of target file 'thedarkmod.x64'.
  Must remake target 'thedarkmod.x64'.
[  1%] Linking CXX executable thedarkmod.x64
Error copying directory from "/home/user/tdm-trunk/glprogs" to "/home/user/tdm-trunk/../darkmod/glprogs".
make[2]: *** [CMakeFiles/TheDarkMod.dir/build.make:8727: thedarkmod.x64] Error 1
make[2]: *** Deleting file 'thedarkmod.x64'
make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/TheDarkMod.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

 

make.failure.svn-r10219.arch.log

Link to comment
Share on other sites

Also the same linking problem is happening for me with 2.10, after I got past the doctest problem.

[ 31%] Building CXX object CMakeFiles/TheDarkMod.dir/sys/posix/platform_linux.cpp.o
/home/user/Games/tdm210/sys/posix/platform_linux.cpp: In function void Sys_ReLaunch()’:
/home/user/Games/tdm210/sys/posix/platform_linux.cpp:410:41: warning: int readdir_r(DIR*, dirent*, dirent**)’ is deprecated [-Wdeprecated-declarations]
  410 |                         while( readdir_r( devfd, &entry, &result ) == 0 )
      |                                ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/user/Games/tdm210/sys/posix/platform_linux.cpp:28:
/usr/include/dirent.h:185:12: note: declared here
  185 | extern int readdir_r (DIR *__restrict __dirp,
      |            ^~~~~~~~~
[ 32%] Building CXX object CMakeFiles/TheDarkMod.dir/sys/posix/posix_input.cpp.o
[ 32%] Building CXX object CMakeFiles/TheDarkMod.dir/sys/posix/posix_main.cpp.o
[ 32%] Building CXX object CMakeFiles/TheDarkMod.dir/sys/posix/posix_net.cpp.o
[ 32%] Building CXX object CMakeFiles/TheDarkMod.dir/sys/posix/posix_signal.cpp.o
[ 32%] Building CXX object CMakeFiles/TheDarkMod.dir/sys/posix/posix_threads.cpp.o
[ 33%] Linking CXX executable thedarkmod.x64
Error copying directory from "/home/user/Games/tdm210/glprogs" to "/home/user/Games/tdm210/../darkmod/glprogs".
make[2]: *** [CMakeFiles/TheDarkMod.dir/build.make:8574: thedarkmod.x64] Error 1
make[2]: *** Deleting file 'thedarkmod.x64'
make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/TheDarkMod.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

 

Link to comment
Share on other sites

@Daft Mugi Thanks for the inspiration to write a Dockerfile and have a repeatable build on ubuntu 22.04.
The key gotcha making the different directories /darkmod, /build, /darkmod_src. That's what I was missing.

SVN rev10219 now builds just fine with this dockerfile.

To build:
`docker build -t tdm-docker:2204.01 -f Dockerfile.ub2204.2.10 .`
 

To copy the build artifacts:
 

cont=`docker run -d tdm-docker:2204.01`
docker cp $cont:/darkmod ./darkmod
docker rm $cont

 

Dockerfile.ub2204.2.10

  • Like 2
Link to comment
Share on other sites

9 hours ago, t405 said:
[  1%] Linking CXX executable thedarkmod.x64
Error copying directory from "/home/user/tdm-trunk/glprogs" to "/home/user/tdm-trunk/../darkmod/glprogs".

By default executables are copied to ../darkmod directory. That's the layout all developers have.

You can disable COPY_EXE cmake option if you don't like it.

Link to comment
Share on other sites

  • 2 months later...

Hello.
I am trying to build TDM on Linux and am getting errors. I'm new to Linux, so don't judge too harshly. The game installs and works through the installer, I just want to try to make a reproducible build into a package.


gcc-c++-10
cmake-3.20

+ cmake -DCMAKE_SKIP_INSTALL_RPATH:BOOL=yes '-DCMAKE_C_FLAGS:STRING=-pipe -frecord-gcc-switches -Wall -g -O2' '-DCMAKE_CXX_FLAGS:STRING=-pipe -frecord-gcc-switches -Wall -g -O2' '-DCMAKE_Fortran_FLAGS:STRING=-pipe -frecord-gcc-switches -Wall -g -O2' -DCMAKE_INSTALL_PREFIX=/usr -DINCLUDE_INSTALL_DIR:PATH=/usr/include -DLIB_INSTALL_DIR:PATH=/usr/lib64 -DSYSCONF_INSTALL_DIR:PATH=/etc -DSHARE_INSTALL_PREFIX:PATH=/usr/share -DLIB_DESTINATION=lib64 -DLIB_SUFFIX=64 -S . -B x86_64-linux -DCMAKE_BUILD_TYPE=Release
-- The C compiler identification is GNU 10.3.1
-- The CXX compiler identification is GNU 10.3.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
-- Performing Test MSSE2_SUPPORTED
-- Performing Test MSSE2_SUPPORTED - Success
Determining SVN revision
Setting up precompiled header for GCC
-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    CMAKE_Fortran_FLAGS
    CMAKE_SKIP_INSTALL_RPATH
    INCLUDE_INSTALL_DIR
    LIB_DESTINATION
    LIB_INSTALL_DIR
    LIB_SUFFIX
    SHARE_INSTALL_PREFIX
    SYSCONF_INSTALL_DIR


-- Build files have been written to: /usr/src/RPM/BUILD/thedarkmod-2.11/x86_64-linux
+ cmake --build x86_64-linux --verbose --parallel 4
gmake: Entering directory '/usr/src/RPM/BUILD/thedarkmod-2.11/x86_64-linux'
/usr/bin/cmake -P /usr/src/RPM/BUILD/thedarkmod-2.11/x86_64-linux/CMakeFiles/VerifyGlobs.cmake
/usr/bin/cmake -S/usr/src/RPM/BUILD/thedarkmod-2.11 -B/usr/src/RPM/BUILD/thedarkmod-2.11/x86_64-linux --check-build-system CMakeFiles/Makefile.cmake 0
gmake: Leaving directory '/usr/src/RPM/BUILD/thedarkmod-2.11/x86_64-linux'
gmake: Entering directory '/usr/src/RPM/BUILD/thedarkmod-2.11/x86_64-linux'
/usr/bin/cmake -E cmake_progress_start /usr/src/RPM/BUILD/thedarkmod-2.11/x86_64-linux/CMakeFiles /usr/src/RPM/BUILD/thedarkmod-2.11/x86_64-linux//CMakeFiles/progress.marks
gmake: Leaving directory '/usr/src/RPM/BUILD/thedarkmod-2.11/x86_64-linux'
/usr/bin/gmake  -f CMakeFiles/Makefile2 all
/usr/bin/gmake  -f CMakeFiles/TheDarkMod.dir/build.make CMakeFiles/TheDarkMod.dir/depend
gmake[2]: Entering directory '/usr/src/RPM/BUILD/thedarkmod-2.11/x86_64-linux'
[  0%] Copying header
/usr/bin/cmake -E copy_if_different /usr/src/RPM/BUILD/thedarkmod-2.11/idlib/precompiled.h /usr/src/RPM/BUILD/thedarkmod-2.11/x86_64-linux/TheDarkMod_pch/precompiled.h
gmake[2]: Leaving directory '/usr/src/RPM/BUILD/thedarkmod-2.11/x86_64-linux'
gmake[2]: Entering directory '/usr/src/RPM/BUILD/thedarkmod-2.11/x86_64-linux'
[  0%] Precompiling header
/usr/bin/c++ @/usr/src/RPM/BUILD/thedarkmod-2.11/x86_64-linux/TheDarkMod_pch/compile_flags.rsp -x c++-header -o /usr/src/RPM/BUILD/thedarkmod-2.11/x86_64-linux/TheDarkMod_pch/precompiled.h.gch /usr/src/RPM/BUILD/thedarkmod-2.11/x86_64-linux/TheDarkMod_pch/precompiled.h
In file included from /usr/src/RPM/BUILD/thedarkmod-2.11/idlib/bv/Bvh.h:19,
                 from /usr/src/RPM/BUILD/thedarkmod-2.11/idlib/../renderer/Model.h:19,
                 from /usr/src/RPM/BUILD/thedarkmod-2.11/x86_64-linux/TheDarkMod_pch/precompiled.h:75:
/usr/src/RPM/BUILD/thedarkmod-2.11/idlib/bv/CircCone.h: In member function 'idCircCone& idCircCone::Transform(const idMat3&)':
/usr/src/RPM/BUILD/thedarkmod-2.11/idlib/bv/CircCone.h:166:1: error: no return statement in function returning non-void [-Werror=return-type]
  166 | }
      | ^
/usr/src/RPM/BUILD/thedarkmod-2.11/idlib/bv/CircCone.h: In member function 'idCircCone& idCircCone::Negate()':
/usr/src/RPM/BUILD/thedarkmod-2.11/idlib/bv/CircCone.h:169:1: error: no return statement in function returning non-void [-Werror=return-type]
  169 | }
      | ^
cc1plus: some warnings being treated as errors
gmake[2]: *** [CMakeFiles/TheDarkMod.dir/build.make:80: TheDarkMod_pch/precompiled.h.gch] Error 1
gmake[2]: Leaving directory '/usr/src/RPM/BUILD/thedarkmod-2.11/x86_64-linux'
gmake[1]: *** [CMakeFiles/Makefile2:82: CMakeFiles/TheDarkMod.dir/all] Error 2
gmake: *** [Makefile:91: all] Error 2
error: Bad exit status from /usr/src/tmp/rpm-tmp.8903 (%build)


RPM build errors:
    Bad exit status from /usr/src/tmp/rpm-tmp.8903 (%build)
Command exited with non-zero status 1
9.77user 1.88system 0:13.02elapsed 89%CPU (0avgtext+0avgdata 388056maxresident)k
181768inputs+834096outputs (127major+186554minor)pagefaults 0swaps

It looks like the problem is in CircCone.h, I looked what exactly is there.

ID_INLINE idCircCone &idCircCone::Transform( const idMat3 &rotation ) {
	axis = rotation * axis;
}

I'm not a programmer and don't understand how to fix this. For the test, I tried to build TDM version 2.10. is going, but this file is not there.

Edited by Toni
Link to comment
Share on other sites

Can you try a less verbose compile string such as:

cmake -DCMAKE_BUILD_TYPE="Release" .. -DGAME_DIR=/home/user/darkmod -DCMAKE_C_COMPILER=gcc-10 -DCMAKE_CXX_COMPILER=g++-10

https://wiki.thedarkmod.com/index.php?title=The_Dark_Mod_-_Compilation_Guide

?

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

@stgatilov

Not sure but it seems that this inline is supposed to return the float for the axis?

Shouldn't it be:

ID_INLINE float idCircCone::Transform( const idMat3 &rotation ) {

axis = rotation * axis;

}

?

That said, no issues compiling here with GCC 11. Any chance you would be willing to install that?

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

Actually setting that float will probably just return the same error.

Please try:

ID_INLINE idCircCone &idCircCone::Transform( const idMat3 &rotation ) {
	axis = rotation * axis;
	return idCircCone( axis, cosAngle, sinAngle );

}

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

1 hour ago, nbohr1more said:

Actually setting that float will probably just return the same error.

Please try:

ID_INLINE idCircCone &idCircCone::Transform( const idMat3 &rotation ) {
	axis = rotation * axis;
	return idCircCone( axis, cosAngle, sinAngle );

}

Yes returns an error.

1 hour ago, nbohr1more said:

@stgatilov

Not sure but it seems that this inline is supposed to return the float for the axis?

Shouldn't it be:

ID_INLINE float idCircCone::Transform( const idMat3 &rotation ) {

axis = rotation * axis;

}

?

That said, no issues compiling here with GCC 11. Any chance you would be willing to install that?

We have 10-11-12 in different repositories. I tried 10 and 12 they give the same error. 11 completed successfully. This is weird. Maybe 10-12 needs some fixes. I'll try to write to our technical support.

Link to comment
Share on other sites

  • 4 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • taffernicus

      i am so euphoric to see new FMs keep coming out and I am keen to try it out in my leisure time, then suddenly my PC is spouting a couple of S.M.A.R.T errors...
      tbf i cannot afford myself to miss my network emulator image file&progress, important ebooks, hyper-v checkpoint & hyper-v export and the precious thief & TDM gamesaves. Don't fall yourself into & lay your hands on crappy SSD
       
      · 3 replies
    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 7 replies
    • Ansome

      Turns out my 15th anniversary mission idea has already been done once or twice before! I've been beaten to the punch once again, but I suppose that's to be expected when there's over 170 FMs out there, eh? I'm not complaining though, I love learning new tricks and taking inspiration from past FMs. Best of luck on your own fan missions!
      · 4 replies
    • The Black Arrow

      I wanna play Doom 3, but fhDoom has much better features than dhewm3, yet fhDoom is old, outdated and probably not supported. Damn!
      Makes me think that TDM engine for Doom 3 itself would actually be perfect.
      · 6 replies
    • Petike the Taffer

      Maybe a bit of advice ? In the FM series I'm preparing, the two main characters have the given names Toby and Agnes (it's the protagonist and deuteragonist, respectively), I've been toying with the idea of giving them family names as well, since many of the FM series have named protagonists who have surnames. Toby's from a family who were usually farriers, though he eventually wound up working as a cobbler (this serves as a daylight "front" for his night time thieving). Would it make sense if the man's popularly accepted family name was Farrier ? It's an existing, though less common English surname, and it directly refers to the profession practiced by his relatives. Your suggestions ?
      · 9 replies
×
×
  • Create New...