How to compile Trinity Core on Slackware 13
This is based on a Trinity Core Linux Build post by Jerry over at mmopro.org. This one was built with Ubuntu and I’m not a big fan of that distribution (it’s a personal taste thing – Ubuntu is a great Linux distribution, it’s just not for me). [Credits also go to FeestBijtje, Elegos, SP_Black, Aokromes, lowwe and the Trinity Core Community.]
As I followed the how to I found that it didn’t work with Slackware out of the box so I had to adapt the how to for Slackware 13.
Step 1: Create a user [optional]
Run the following as root:
useradd -d /home/trinity -s /bin/bash -p users -m trinity
passwd trinity -d
useradd explained:
- -d /home/trinity — This is where the home directory is located
- -s /bin/bash — This the the shell the user will use (If you prefer another then use it.)
- -p users — This is the primary group the user belongs to. In the case we don’t need anymore rights than this.
- -m — This will create the home directory if it doesn’t exist
- trinity — The username we are creating.
passwd explained:
- trinity — The account we want to work with.
- -d — This removes the password for the account – THIS IS A SECURITY RISK but it allows me to script it a little easier. You should change this password to something you can remember!
Why create an account for this? The nice thing is that all of trinity will be packaged up in a single home directory. If we move to another box we only have to worry about one folder to archive. For me, this also makes the build environment clean and I don’t clutter the rest of my linux box with things that won’t be used globally. It should also make nightly or weekly builds easier.
Step 2: Install Pre-Requirements [required]
Login as the user you will be building Trinity with via:
su - trinity
Download ACE and extract it
wget http://download.dre.vanderbilt.edu/previous_versions/ACE-5.7.0.tar.gz
tar xf ACE-5.7.0.tar.gz
mv ACE_wrappers ACE
Note: This version of tar auto-magically figures out it’s a gzip or bzip2.
Next we build ACE
mkdir buildace
cd buildace
../ACE/configure --prefix=/home/trinity/.sys/
make -j 3
make install
cd ..
rm -rf buildace
NOTE: We are done with the ACE directory now so you can delete it by ‘rm -rf ACE’ if you like.
UPDATE: Below I’ve added an ‘ace.SlackBuild’ script that, when run, creates a standard package that you just have to install.
Step 3: Download and Build Trinity Core [required]
Again, we are running everything as our normal user, trinity in my case. ‘su – trinity’
Get the latest sources of Trinity Core
hg clone https://trinitycore.googlecode.com/hg/ trinitycore
Build Trinity Core
mkdir buildtrinity
cd buildtrinity
cmake ../trinitycore
-DPREFIX=/home/trinity/current
-DCONF_DIR=/home/trinity/current/etc
-DACE_LIBRARY=/home/trinity/.sys/lib/libACE.so
-DACE_INCLUDE_DIR=/home/trinity/.sys/include/
-DDO_RA=1
-DDO_MYSQL=1
-DDO_SCRIPTS=1
-DDO_CLI=1
-DDO_SQL=1
-DCMAKE_CXX_FLAGS=-mmmx
-DCMAKE_C_FLAGS=-mmmx
-DCMAKE_EXE_LINKER_FLAGS=-lncurses
-DCMAKE_SHARED_LINKER_FLAGS=-lncurses
make -j 3
make install
The flags to be concerned about are the LINKER_FLAGS. I added ‘-lncurses’. I’m not sure why this is required but it seems to fix my compiling problem on a default install of Slackware 13.0. The C_FLAGS and CXX_FLAGS you can add extra compile optimizations that may or may not help. I was just experimenting and used MMX as most procs now days have that extension.
UPDATE: Below I’ve added ‘trinitycore.SlackBuild’ script that creates a nice package to install. (Sometimes the build will fail due to source issues in source control.)
Step 4: Installing the Database and Beyond
This how to won’t cover that as Slackware isn’t any different than Ubuntu in that respect. Please refer to the above cited article or the official article on the Trinity Core wiki.
Sources:
- [Ubuntu] How to compile Trinity Core 2 at mmopro.org
- Howto linux tc2 at the Trinity Core WIKI
Other Notes:
If your version of Slackware is missing libssl or openssl or any other package, you should be able to just get the packages off of the Slackware installation disks or download them from a Slackware mirror. (Install the package via ‘installpkg ‘)
I may come back and edit this later for a complete install on Slackware, but I don’t see that happening too soon. I do see scripting a trinitycore.SlackBuild in the near future though. (This allows a user to just run: ‘installpkg trinitycore-VERSION-ARCH.txz’)
SlackBuilds
These SlackBuilds are self contained. They download the needed files and build the package auto-matically and it’s done the Slackware way.
ace.SlackBuild - A pre-requirement for the ACE(tm) library.
trinitycore.SlackBuild - The server itself. Next is to add scripts to create the base databases but it’s not in this release.
Pingback: The Blog of Micah » Blog Archive » Compiling TrinityCore on Slackware 13