PtokaX wiki

Hub (server) for Direct Connect

User Tools

Site Tools


guides:centos

This is an old revision of the document!


Compile on CentOS

This guide was tested on clean installation of CentOS GNU/Linux 5.3 and 6.3.
Everything is done from command line, that means everything can be done over ssh on remote server.

In my case was only base system installed, that means after startup and login i was already in command line and working directory was my home directory.
If you are not in command line then you need to go here some way (ie if gnome is installed then open terminal).

1. Prerequisites.

For PtokaX compile you need make (tool controlling executable generation from sources), g++ (c++ compiler), zlib (compression library used to save hub badwith) and Lua (programming language used for scripting). They can be installed using package manager (Note: to install packages using package manager you need root permissions).

  • a. Make
    In my case was installed but to be sure you can run: yum install make
  • b. g++
    Install it with command: yum install gcc-c++
  • c. zlib
    Install it with command: yum install zlib-devel
  • d. Lua 5.1
    This one is little complicated because Lua is not available in CentOS packages.
    I'm used RPMforge as easy way how get it. How to add RPMforge to your repositories is here.
    When you have RPMForge added then you can install Lua with this command: yum install lua-devel

2. Downloading source and compile.

  • a. PtokaX source
    Download it with command: wget <html><b>http://www.czdc.org/PtokaX/0.4.2.0-nix-src.tgz</b></html>
    Unpack downloaded archive with command: tar -xf 0.4.2.0-nix-src.tgz
    Now we have in actual directory new directory PtokaX. Go to that directory with command: cd PtokaX
  • b. TinyXml source
    TinyXml is library used by PtokaX for reading and writing xml files.
    Download TinyXml with command: wget <html><b>http://downloads.sourceforge.net/project/tinyxml/tinyxml/2.6.2/tinyxml_2_6_2.tar.gz</b></html>
    Unpack downloaded archive with command: tar -xf tinyxml_2_6_2.tar.gz
  • c. TinyXml compile
    Go to TinyXml directory with command: cd tinyxml
    Compile TinyXml with command: make
    Return back to PtokaX directory with command: cd ..
  • d. PtokaX compile
    PtokaX makefile need minor changes.
    Open makefile with command: vim makefile

    1. When you have CentOS 5.x:
      • Search for this line $(CXX) -lpthread -lz -llua5.1 -lrt -o PtokaX \ and change it to $(CXX) -lpthread -lz -lrt -ldl -o PtokaX \
      • Search for this line $(CURDIR)/tinyxml/tinyxml.a and change it to $(CURDIR)/tinyxml/tinyxml.a /usr/lib/liblua.a or when you use x86_64 CentOS to $(CURDIR)/tinyxml/tinyxml.a /usr/lib64/liblua.a
    2. When you have CentOS 6.x:
      • Search for this line $(CXX) -lpthread -lz -llua5.1 -lrt -o PtokaX \ and change it to $(CXX) -lpthread -lz -llua-5.1 -lrt -o PtokaX \

    3. Now you can finally compile PtokaX with command: make

3. Setup and run.

guides/centos.1350255794.txt.gz · Last modified: 14/10/2012 23:03 by ppk