Thursday, April 05, 2007

Status Report for Date 02/08/2007 to Date 04/05/2007

Recently, I am working on migrating Maze Server from my lab desktop linux machine to our new server.
prerequisite:
Library stlport is needed by Maze server programs. So, firstly, I tried to build stlport on our server--gridfarm001. In Maze's documents, there is no description about the building of stlport. As a result, I built it as usual. I tried to build stlport-5.1.3, stlport-5.0.2, stlport-4.6.2. Every time I could build library stlport successfully. However, when I compiled and linked Maze server programs, link errors appeared. From my experience, the source of failure was the configuration of stlport. In other words, I should modify some config files of stlport before building to satisfy the requirement of Maze. I looked up solution on the internet, which did not help a lot. Then I carefully read the documents of Stlport. After lots of trials, I solved this problem. I used Stlport-5.0.2, which can be obtained at http://sourceforge.net/project/showfiles.php?group_id=146814.
Then this file--stlport/stl/_site_config.h must be modified by adding one line:
#define _PTHREADS.
This seems simple. However, it took me lots of time to find out the solution.
Build Maze:
Because layout of the source files is chaotic, I reorganized the directory tree to make it clear and readable. I separated the server programs from client programs and constructed an individual tarball for server programs. Then I wrote a bash script to generate the files and directories needed to run Maze servers. After that, I built Maze servers.
Note:
1) Makefiles used to build Maze servers must be modified to indicate location of library stlport and the location of header files!! (-L and -I options)
2) To run Maze server, LD_LIBRARY_PATH must be set to contain the directory where library stlport is located.
Potential Problems during Building:
(1) special characters
(a)Some source files were written in Windows, so it is possible some srouce files have different line-break characters(\n or \r\n) from unix standard. Some compilers may handle these characters correctly while other compilers may not compile successfully. So, if strange compile error messages are displayed, it may result from this reason.
(b) some comments in Maze Programs are written in Chinese, and it may span several lines. It is possible that some compilers can not handle these characters correctly because they do not support Chinese character encoding.
(2)Some directories are hard coded in source file.
This directory--/home/maze/resource/ is used to store the directory information of users. It is hard coded in file DServer/Server.cpp. I changed it to point to my directory.

Ports Used:
By default, the HeartBeatSvr listens at ports 974. In linux, those ports that are below 1024 can not be used by general user. In other words, only root can listen those ports. So, I change the port to 1974.
UserSvr: 30604
DirServer:30605
HeartBeatSvr:1974 and 30607

Start Up servers:
(1) copy HearBeatSvr, DirServer, UserSvr to maze/bin directory;
(2) create heartbeat.log, log.txt, punishs.dat, traffic.log, userdb.dat
details:
UserSvr needs: userdb.dat
HeartBeatSvr needs: log.txt(write log), heartbeat.log(restart records for HeartBeatSvr)
(3) copy a config.xml to maze/bin. This file is needed by HeartBeatSvr
(4) Start up server:
./UserSvr
./HeartBeatSvr &
./DirServer &

building Enviroments:
my desktop:
gcc version 4.1.2 20060928 (prerelease) (Ubuntu 4.1.1-13ubuntu5)
gridfarm001:
gcc version 3.3.2 20031022 (Red Hat Linux 3.3.2-1)

Next step:
run programs that supports building index and search.

No comments: