.:: Bots United ::.  
filebase forums discord server github wiki web
cubebot epodbot fritzbot gravebot grogbot hpbbot ivpbot jkbotti joebot
meanmod podbotmm racc rcbot realbot sandbot shrikebot soulfathermaps yapb

Go Back   .:: Bots United ::. > Developer's Farm > General Bot Coding
General Bot Coding See what a pain it is to get those little mechs shooting around

Reply
 
Thread Tools
nOOb trying to compile on Linux...
Old
  (#1)
Drek
Member
 
Status: Offline
Posts: 64
Join Date: Feb 2004
Default nOOb trying to compile on Linux... - 21-02-2006

Here I am, that dreaded animal, the insufferable nOOb...

I switched my clan server to Linux last month and I'm pretty sure my brain has gained at least half a kilo in muscle mass from all the heavy lifting it has had to do. Anywho, I work with Frank McNeil on Marine Bot and I'm trying to compile Marine Bot for The Battle Grounds on Linux. I'm wondering if there is a good tutorial on compiling HL1 bots on Linux somewhere. I've been Googling around, but no joy.

I have unpacked the MB source, and HLSDK 2.3-p2 into my /usr/src directory. I changed to the MB source directory and looked at the makefile and makefile_linux which has a line at the top which is supposed to point to your mod directory, which struck me as odd because I would have thought it would have had to point to the source for the mod. However, not knowing what I was doing I dutifully pointed both files to the bg directory on my server.

I then tried "make" which produced a very long page of errors. The first errors were bot.cpp trying to find some files that I found in the hlsdk, I changed the file to point these to the right files. However now I've run up against more errors (I have run make clean before every attempted make). This is the sort of error I am getting:

Code:
/usr/include/sys/stat.h:208: error: non-local function `int stat(const char*,
   WaypointPathInfo(...)::stat*)' uses local type `WaypointPathInfo(...)::stat'
I guessing it may have something to do with the version of gcc I have installed? If anyone can point me to a good tutorial, or clear up my confusion in some way, I would be grateful.
  
Reply With Quote
Re: nOOb trying to compile on Linux...
Old
  (#2)
Whistler
Summoner
 
Whistler's Avatar
 
Status: Offline
Posts: 1,498
Join Date: Feb 2004
Location: Mist Village
Default Re: nOOb trying to compile on Linux... - 22-02-2006

make sure you have #include'd sys/types.h, sys/stat.h and unistd.h.
  
Reply With Quote
Re: nOOb trying to compile on Linux...
Old
  (#3)
Drek
Member
 
Status: Offline
Posts: 64
Join Date: Feb 2004
Default Re: nOOb trying to compile on Linux... - 23-02-2006

After much searching and reading I'm managed to compile Marine Bot and Waster Bot (both Frank McNeil projects) for Linux. Here is what I've learned. I'll post it here in case anyone else is searching for the answers that I was searching for.

I am using Debian GNU/Linux 3.1 Sarge with gcc 3.4. I guess different Linux distros have different ways of managing packages, so whatever distro you are using will determine how you install this. On Debian it is "apt-get install gcc-3.4" I don't know whether I needed to or not, but I uninstalled gcc 2.95 first - "apt-get --purge remove gcc-2.95".

First get a hold of the patched hlsdk, you can find it here. [url=http://metamod.sourceforge.net/files/sdk/hlsdk-2.3-p3.tar.gz]hlsdk-2.3-p3.tar.gz[/ur] (this link will obviously be outdated as soon as a new version is released, but hopefully you can just get it from the page link)

1. Untar hlsdk-2.3-p3.tar.gz (move or copy the archive to /usr/src and run this command, "tar -xvzf hlsdk-2.3-p3.tar.gz") into your source directory. On Debian Sarge it is /usr/src. It is worth noting that if you are a nOOb like I am, you may think you can unpack it anywhere and compile it, as I have read in more than one set of instructions. However in Debian Sarge, it appears that you must do your compiling in the /usr/src directory.

2. Unpack your bot source into your hlsdk multiplayer directory (on Debian it will be /usr/src/hlsdk-2.3-p3/multiplayer). This was where I went wrong in the first place. I didn't realize you needed to have the bot source folder in the hlsdk directory structure.

3. Navigate to your new bot directory (/usr/src/hlsdk-2.3-p3/multiplayer/whateverbot).

4. Run "make" inside your bot directory. Before I run "make" I will also run "make clean", although you will only need to do this if you have run "make" and it has failed.

5. Now I'm afraid that this is where it can get complicated. If everything goes well, your bot will compile and you will have a brand spanking whateverbot.so file in your /usr/src/hlsdk-2.3-p3/multiplayer/whateverbot directory. However, chances are good that it won't compile the first time you try, and you will have to fix something. All I can say at this point is that Google is your friend, and you will have to probably plow through alot of pages before you find the information you need to fix the problem. Pay attention to what file the error occurred in, and look up the line number for clues. I find that using the generic error can help you find answers, there don't seem to be many Half-Life specific bot help pages out there - although I expect the archives for Botman's old forums are a good place to look as well, although I'm afraid I don't know exactly where to find them. Remember if a page won't load from you Google search you can often get the information on that page by clicking on the "cached" link.

6. Obviously once you've compiled your .so file you will need to install it wherever it needs to be installed to run it.

And this is my newbie's guide to compiling Half-Life bots on Linux. I'm thinking of a new slogan, "Newbie Power! By Newbies, For Newbies! Celebrate the nOOb Within!" - closely related to that old chestnut about "the blind leading the blind..."
  
Reply With Quote
Re: nOOb trying to compile on Linux...
Old
  (#4)
Whistler
Summoner
 
Whistler's Avatar
 
Status: Offline
Posts: 1,498
Join Date: Feb 2004
Location: Mist Village
Default Re: nOOb trying to compile on Linux... - 24-02-2006

Quote:
However in Debian Sarge, it appears that you must do your compiling in the /usr/src directory.
This is not true. I usually put all of the source code to my home directory to avoid requirement of root privilege, and it's always working
  
Reply With Quote
Re: nOOb trying to compile on Linux...
Old
  (#5)
Drek
Member
 
Status: Offline
Posts: 64
Join Date: Feb 2004
Default Re: nOOb trying to compile on Linux... - 24-02-2006

All right then, just don't try to compile it in your /mnt directory like I tried to then...
  
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com