• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Compiling Compiling TFS 1.3 on CentOS 8

hellboy

Intermediate OT User
Joined
Apr 6, 2008
Messages
544
Solutions
6
Reaction score
121
Location
player:getTown()
Hello.

TL;DR
I tried compile TFS 1.3 on CentOS 8 based on this wiki page:
SELinux is enabled.
cmake throw:
-- Performing Test COMPILER_KNOWS_STDLIB - Failed

Longer answer
So far I created bash script:
Code:
#!/bin/bash

set -e

# Enable PowerTools to install lua-devel
sudo sed -i 's/enabled=0/enabled=1/g' /etc/yum.repos.d/CentOS-PowerTools.repo
sudo sed -i 's/enabled=0/enabled=1/g' /etc/yum.repos.d/CentOS-Devel.repo

# Remove yum cache
sudo yum clean all

# Install this package to get pugixml-devel
sudo yum install epel-release
sudo yum install git cmake gcc-c++ boost-devel gmp-devel mariadb-devel
sudo yum install lua-devel pugixml-devel

# Install to fix cmake error
sudo yum install cryptopp-devel

# IT DOESN'T HELP
# sudo yum groups install "Development tools"

# Prepare tfs user and group
sudo groupadd tfs
sudo useradd -g tfs -s /bin/bash -m tfs
sudo chmod 750 /home/tfs

# Run code as tfs user
sudo su - tfs -c 'git clone --recursive https://github.com/otland/forgottenserver.git'
sudo su - tfs -c 'cd forgottenserver && mkdir build'
sudo su - tfs -c 'cd forgottenserver/build && cmake ..'
sudo su - tfs -c 'cd forgottenserver/build && make'


There is problem with step cmake ..
Code:
[tfs@localhost build]$ cmake ..
-- The C compiler identification is GNU 8.3.1
-- The CXX compiler identification is GNU 8.3.1
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- cotire 1.7.6 loaded.
-- Performing Test COMPILER_KNOWS_CXX11
-- Performing Test COMPILER_KNOWS_CXX11 - Success
-- Performing Test COMPILER_KNOWS_STDLIB
-- Performing Test COMPILER_KNOWS_STDLIB - Failed
-- Performing Test COMPILER_KNOWS_LTO
-- Performing Test COMPILER_KNOWS_LTO - Success
-- Found Crypto++: /usr/include 
-- Found PugiXML: /usr/include 
-- MySQL Include dir: /usr/include/mysql  library dir: /usr/lib64
-- MySQL client libraries: /usr/lib64/libmysqlclient.so
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE 
-- Could NOT find LuaJIT (missing: LUA_LIBRARIES LUA_INCLUDE_DIR)
-- Found Lua: /usr/lib64/liblua.so;/usr/lib64/libm.so (found version "")
-- Boost version: 1.66.0
-- Found the following Boost libraries:
--   system
--   filesystem
--   iostreams
--   regex
-- CXX target tfs cotired without unity build.
-- Configuring done
-- Generating done
-- Build files have been written to: /home/tfs/forgottenserver/build


If I ignore this, then in last step, make throw
Code:
[tfs@localhost build]$ make
[  1%] Generating CXX prefix source cotire/tfs_CXX_prefix.cxx
[  2%] Generating CXX prefix header cotire/tfs_CXX_prefix.hxx
[  3%] Building CXX precompiled header cotire/tfs_CXX_prefix.hxx.gch
Scanning dependencies of target tfs
[  4%] Building CXX object CMakeFiles/tfs.dir/src/otpch.cpp.o
cc1plus: error: /home/tfs/forgottenserver/build/cotire/tfs_CXX_prefix.hxx.gch: had text segment at different address [-Werror]
cc1plus: all warnings being treated as errors
make[2]: *** [CMakeFiles/tfs.dir/build.make:77: CMakeFiles/tfs.dir/src/otpch.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:100: CMakeFiles/tfs.dir/all] Error 2
make: *** [Makefile:84: all] Error 2

I guess I have to install additional package. I don't know which one.
Anyone can help with this issue?
 
Last edited:
Solution
Not even sure since the app in question only uses nginx as a reverse proxy, and generally end-users would be connected to the websocket endpoint directly. Adding nginx into that mix always created extra ambiguities in support tickets so we just stopped because it wasn't worth it. So it was some wierdness between Cloudflare and N|Solid.

Code:
OS template centos-8-x86_64 cache was created
Wow. The amount of guess work and random tries to get that to happen.
(Gotta be real careful playing at updating packages when the OS is the hypervisor of a live mission-critical metal, which is hosting production VMs and CTs)

I should now finally have a CentOS 8 CT in a few minutes. I was worried I'd have to go full VM there for a minute...
did you try it without ?

One more time I read one of your previous posts.
And now compile as it should.
Probably last time I missed something (I don't know what to be honest and how).

I'll show working bash script in githuba of forgottenserver and ask if it's good enough to make pull request to wiki.
Post automatically merged:

Thanks for patience and help!
 
Back
Top