The Dawn Of Time
The Official Forums for the Dawn Of Time Mud Codebase
 
Log in Register FAQ Memberlist Search The Dawn Of Time Forum Index Goto the Official Dawn Website

Broken make under OS X

 
Post new topic   Reply to topic    The Dawn Of Time Forum Index » Getting Started
View previous topic :: View next topic  
Author Message
Territan



Joined: 29 Jan 2003
Posts: 6

PostPosted: Wed Jan 29, 2003 7:21 am    Post subject: Broken make under OS X Reply with quote

I'm running Mac OS 10.2.3, and tried to compile DOT within Terminal (seemed the best place for it)

Here's where the process when kerflooey:

Code:

g++ -c -Wall -g -O  base64.cpp -o obj/base64.o
In file included from websrv.h:75,
                 from base64.cpp:19:
/usr/include/sys/resource.h:81: field `ru_utime' has incomplete type
/usr/include/sys/resource.h:82: field `ru_stime' has incomplete type
make: *** [base64.o] Error 1


Has this happened to anyone else, and is there a workaround?

--Territan


Back to top
View user's profile Send private message AIM Address
Archiel
Moderator


Joined: 05 Feb 2003
Posts: 386
Location: Minnesota, USA

PostPosted: Wed Feb 05, 2003 5:44 pm    Post subject: RE: OS X and dawn Reply with quote

I had the exact same problem. Same error and everything. You can force it to ignore the error (see 'man make' for details), but of course, it still doesn't work, doesn't compile. There's a whole bunch of other errors too, but most of the files work. I never fixed it...

-Caharin Crying or Very sad


Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
Kalahn
Codebase Developer


Joined: 18 Jan 2003
Posts: 710
Location: New Zealand

PostPosted: Thu Feb 06, 2003 11:43 am    Post subject: Reply with quote

Unfortunately I can only offer limited help here as I don't have access to a mac. Nick Gammon of www.mushclient.com successfully got Dawn running on OS X 10.2 around August last year. Based on his feedback, I am including tweaks to make it compile out of the box on OS X in the next release.

In the mean time the following changes should hopefully put you straight:

Manually edit the makefile after running configure.
Change the line which reads:
Code:
C_FLAGS = -Wall $(PROF) $(NOCRYPT)

to read:
Code:
C_FLAGS = -Dunix -Wall $(PROF) $(NOCRYPT)


There is a typo in gio.cpp around line 195 which only shows itself as problem on the mac platform due to the endian-ess difference between the powerpc and i386 processors.

Replace:
Code:

case SHWFLAG: // short wordflag
   if( (int)GIO_DATA!=(int)0
      || is_stat( (flag_type *)gio_table[tableIndex].parameter)){
      fwrite_wordflag( (flag_type *)gio_table[tableIndex].parameter,
         (sh_int)GIO_DATA, (char *)gio_table[tableIndex].heading, fp);
   }
   break;

With:
Code:

case SHWFLAG: // short wordflag
   if( (sh_int)GIO_SHDATA!=(sh_int)0
     || is_stat( (flag_type *)gio_table[tableIndex].parameter)){
      fwrite_wordflag( (flag_type *)gio_table[tableIndex].parameter,
         (sh_int)GIO_SHDATA, (char *)gio_table[tableIndex].heading, fp);
   }
   break;


After these two minor changes are performed, I believe you should be able to compile fine. Smile

I would be interested in feed back if these instructions work and if anything else is required so I can incorporate it into the next release and not have any other supprises.


Back to top
View user's profile Send private message Visit poster's website
Kalahn
Codebase Developer


Joined: 18 Jan 2003
Posts: 710
Location: New Zealand

PostPosted: Thu Feb 06, 2003 11:54 am    Post subject: Reply with quote

Can one of you Mac OS X users please post the output of the following two commands for me:

Code:

uname -a
gcc -x c /dev/null -E -dM


This information means I can make dawn better detect the operating system at compile and run time - acting accordingly...e.g. automatically including "#define unix" on Mac OS X, removing the need to manually add -Dunix to the makefile.

Cheers,

- Kal


Back to top
View user's profile Send private message Visit poster's website
Territan



Joined: 29 Jan 2003
Posts: 6

PostPosted: Thu Feb 06, 2003 5:33 pm    Post subject: Reply with quote

Kalahn wrote:
Can one of you Mac OS X users please post the output of the following two commands for me:

Code:

uname -a
gcc -x c /dev/null -E -dM


My machine, on which I tweaked the system name to fit my perverse sense of vanity, responds thusly:

Code:
[TerritanX:~] dhwood% uname -a
Darwin TerritanX.local. 6.3 Darwin Kernel Version 6.3: Sat Dec 14 03:11:25 PST 2002; root:xnu/xnu-344.23.obj~4/RELEASE_PPC  Power Macintosh powerpc

[TerritanX:~] dhwood% gcc -x c /dev/null -E -dM
# 1 "/dev/null"


Kalahn wrote:
This information means I can make dawn better detect the operating system at compile and run time - acting accordingly...e.g. automatically including "#define unix" on Mac OS X, removing the need to manually add -Dunix to the makefile.


It's not the most pressing of priorities to me; there's a PennMUSH system I should be coding on too. But I see active exploration as a way to expand my horizons, not unlike travel.

--Territan


Back to top
View user's profile Send private message AIM Address
Territan



Joined: 29 Jan 2003
Posts: 6

PostPosted: Fri Feb 07, 2003 5:45 pm    Post subject: I put in the changes... Reply with quote

...and the good news is that it compiled past the place where the problem occurred before! Yay!

The not-so-good news is that there were one or two curiosities in the compile after that:

Code:
g++ -c -Dunix -Wall -g -O  dawnstat.cpp -o obj/dawnstat.o
dawnstat.cpp: In function `char* dawnstat_generate_statistics_text()':
dawnstat.cpp:203: warning: int format, size_t arg (arg 3)

g++ -c -Dunix -Wall -g -O  help.cpp -o obj/help.o
help.cpp: In function `void do_helpcat(char_data*, char*)':
help.cpp:1147: warning: int format, long unsigned int arg (arg 2)

g++ -c -Dunix -Wall -g -O  laston.cpp -o obj/laston.o
laston.cpp: In function `char* laston_generate_mud_client_stats()':
laston.cpp:2661: warning: int format, size_t arg (arg 3)

g++ -c -Dunix -Wall -g -O  note.cpp -o obj/note.o
note.cpp: In function `void load_thread(char*, NOTE_DATA**, int, long int)':
note.cpp:696: warning: int format, size_t arg (arg 2)
note.cpp:704: warning: int format, size_t arg (arg 2)

The bad news is that the compilation of resolver.cpp was a train wreck and a half:

Code:
g++ -o ../resolver extras/resolver.cpp
extras/resolver.cpp: In constructor `hnode::hnode(long unsigned int)':
extras/resolver.cpp:128: `in_addr' undeclared (first use this function)
extras/resolver.cpp:128: (Each undeclared identifier is reported only once for
   each function it appears in.)
extras/resolver.cpp:128: parse error before `;' token
extras/resolver.cpp:129: `address' undeclared (first use this function)
extras/resolver.cpp:130: `inet_ntoa' undeclared (first use this function)
extras/resolver.cpp: At global scope:
extras/resolver.cpp:183: `SOCKET' was not declared in this scope
extras/resolver.cpp:183: parse error before `,' token
extras/resolver.cpp: In function `char* read_from_socket(...)':
extras/resolver.cpp:192: `Socket' undeclared (first use this function)
extras/resolver.cpp:198: `timeout' undeclared (first use this function)
extras/resolver.cpp:201: `recv' undeclared (first use this function)
extras/resolver.cpp: At global scope:
extras/resolver.cpp:350: `SOCKET' was not declared in this scope
extras/resolver.cpp:350: parse error before `,' token
extras/resolver.cpp: In function `int connect_with_timeout(...)':
extras/resolver.cpp:353: `s' undeclared (first use this function)
extras/resolver.cpp:353: `F_SETFL' undeclared (first use this function)
extras/resolver.cpp:353: `O_NONBLOCK' undeclared (first use this function)
extras/resolver.cpp:353: `fcntl' undeclared (first use this function)
extras/resolver.cpp:355: `SOCKET_ERROR' undeclared (first use this function)
extras/resolver.cpp:369: `addr' undeclared (first use this function)
extras/resolver.cpp:369: `SOCKADDR_IN' undeclared (first use this function)
extras/resolver.cpp:369: `connect' undeclared (first use this function)
extras/resolver.cpp:370: `errno' undeclared (first use this function)
extras/resolver.cpp:375: `EINPROGRESS' undeclared (first use this function)
extras/resolver.cpp:375: `EALREADY' undeclared (first use this function)
extras/resolver.cpp: In function `bool resolve_ident(hnode*, int, int)':
extras/resolver.cpp:398: parse error before `;' token
extras/resolver.cpp:399: `AF_INET' undeclared (first use this function)
extras/resolver.cpp:399: `SOCK_STREAM' undeclared (first use this function)
extras/resolver.cpp:399: `IPPROTO_TCP' undeclared (first use this function)
extras/resolver.cpp:399: `socket' undeclared (first use this function)
extras/resolver.cpp:400: `INVALID_SOCKET' undeclared (first use this function)
extras/resolver.cpp:406: aggregate `sockaddr_in addr' has incomplete type and
   cannot be defined
extras/resolver.cpp:412: `getservbyname' undeclared (first use this function)
extras/resolver.cpp:414: invalid use of undefined type `struct servent'
extras/resolver.cpp:411: forward declaration of `struct servent'
extras/resolver.cpp:428: `closesocket' undeclared (first use this function)
extras/resolver.cpp:440: `send' undeclared (first use this function)
extras/resolver.cpp: In function `void resolve_host(hnode*)':
extras/resolver.cpp:495: `gethostbyaddr' undeclared (first use this function)
extras/resolver.cpp:507: invalid use of undefined type `struct hostent'
extras/resolver.cpp:493: forward declaration of `struct hostent'
extras/resolver.cpp: In function `int main(int, char**)':
extras/resolver.cpp:670: `inet_addr' undeclared (first use this function)
extras/resolver.cpp:671: `INADDR_NONE' undeclared (first use this function)
extras/resolver.cpp:688: `gethostbyname' undeclared (first use this function)
extras/resolver.cpp:693: invalid use of undefined type `struct hostent'
extras/resolver.cpp:678: forward declaration of `struct hostent'
extras/resolver.cpp:697: invalid use of undefined type `struct hostent'
extras/resolver.cpp:678: forward declaration of `struct hostent'
extras/resolver.cpp:700: invalid use of undefined type `struct hostent'
extras/resolver.cpp:678: forward declaration of `struct hostent'
extras/resolver.cpp:701: invalid use of undefined type `struct hostent'
extras/resolver.cpp:678: forward declaration of `struct hostent'
extras/resolver.cpp:707: invalid use of undefined type `struct hostent'
extras/resolver.cpp:678: forward declaration of `struct hostent'
extras/resolver.cpp:708: parse error before `;' token
extras/resolver.cpp:709: invalid use of undefined type `struct hostent'
extras/resolver.cpp:678: forward declaration of `struct hostent'
extras/resolver.cpp:709: invalid use of undefined type `struct hostent'
extras/resolver.cpp:678: forward declaration of `struct hostent'
extras/resolver.cpp:719: invalid use of undefined type `struct hostent'
extras/resolver.cpp:678: forward declaration of `struct hostent'
extras/resolver.cpp:719: invalid use of undefined type `struct hostent'
extras/resolver.cpp:678: forward declaration of `struct hostent'
extras/resolver.cpp:721: invalid use of undefined type `struct hostent'
extras/resolver.cpp:678: forward declaration of `struct hostent'
make: *** [../resolver] Error 1

So I've come a little closer than I was before... but there's still a lot of ground to go. Got any more changes you'd recommend? I'm all ears!

--Territan


Back to top
View user's profile Send private message AIM Address
Kalahn
Codebase Developer


Joined: 18 Jan 2003
Posts: 710
Location: New Zealand

PostPosted: Sat Feb 08, 2003 8:34 am    Post subject: Reply with quote

The mud doesn't technically require the resolver to startup/run... the resolver is responsible for converting IP addresses into domain names, ident lookups and used by the in game resolve command.

The others are just warnings, so you should be able to run okay ignoring those.

Let us know how far you can get now.

- Kal


Back to top
View user's profile Send private message Visit poster's website
Territan



Joined: 29 Jan 2003
Posts: 6

PostPosted: Mon Feb 17, 2003 3:25 pm    Post subject: Reply with quote

Kalahn wrote:
The mud doesn't technically require the resolver to startup/run... the resolver is responsible for converting IP addresses into domain names, ident lookups and used by the in game resolve command.

The others are just warnings, so you should be able to run okay ignoring those.

Let us know how far you can get now.

- Kal


The MUD starts up Smile , and lets me log in Very Happy , and then later recognizes me as an immortal when I do the correct jiggery-pokery with my player file. Cool

Just as long as I don't type "skill". Confused

Code:
Feb 16 21:03:14:: starting nasty_signal_handler (11)
:: write_last_command(): callcount=0
:: last_command: [    0] Territan in [ 3023] Hall of Warriors: skill (skills)
:: last_input: Start input 8> [    0] Territan in [ 3023] Hall of Warriors: skill
:: ======INPUTTAIL LOG
:: 21:00:40 Territan<0> (8) R7372 C14 E0 ' '
:: 21:00:46 Territan<0> (8) R7372 C14 E0 'i'
:: 21:00:49 Territan<0> (8) R7372 C0 E0 'look'
:: 21:00:50 Territan<0> (8) R7372 C0 E0 'i'
:: 21:00:52 Territan<0> (8) R7372 C0 E0 'equip'
:: 21:01:05 Territan<0> (8) R7372 C0 E0 'd'
:: 21:01:10 Territan<0> (8) R7359 C0 E0 'i'
:: 21:01:11 Territan<0> (8) R7359 C0 E0 'e'
:: 21:01:23 Territan<0> (8) R27003 C0 E0 'i'
:: 21:01:27 Territan<0> (8) R27003 C0 E0 'recall'
:: 21:01:34 Territan<0> (8) R7359 C0 E0 'w'
:: 21:01:36 Territan<0> (8) R3000 C0 E0 'e'
:: 21:01:37 Territan<0> (8) R3008 C0 E0 'e'
:: 21:01:37 Territan<0> (8) R3009 C0 E0 's'
:: 21:01:38 Territan<0> (8) R3091 C0 E0 's'
:: 21:01:39 Territan<0> (8) R3023 C0 E0 'score'
:: 21:01:45 Territan<0> (8) R3023 C0 E0 'list'
:: 21:01:48 Territan<0> (8) R3023 C0 E0 'buy wristbands'
:: 21:01:54 Territan<0> (8) R3023 C0 E0 'wear wristbands'
:: 21:03:14 Territan<0> (8) R3023 C0 E0 'skill'
:: R = Room vnum, C = Connected state, E = olc editor mode... inputtail does not include force or ordered commands.
:: -= The Dawn of Time 1.69 was last compiled on Feb 16 2003 at 17:32:23 (c++ build)=-

Segmentation fault


Furthermore, when I start back up and try taking another character through, the race list disappears. In the startup log after this mishap, looking for any possible race problems, I found:

Code:
:: ===Saving races...
:: Starting gio_generic_savelist to system/races.txt.write.
:: GIOBACKUP: Renaming old system/races.txt to system/races.txt.giobak
:: Renaming new system/races.txt.write to system/races.txt
:: Finished gio_generic_savelist [59].
:: ===Races saved.


So it crashes when I try to call up my skills, and after it crashes the race list seems to disappear. And I just found a file in my logs folder: logs\admin\secure.txt -- it got interpreted as a single file name because I'm working in a Unix-like environment which uses forward slashes.

It's a curiosity... and thanks for the help with this. I downloaded CircleMUD this afternoon to try *it* out, but canned it immediately. Compared to DOT, it was practically nothing.

--Territan


Back to top
View user's profile Send private message AIM Address
Kalahn
Codebase Developer


Joined: 18 Jan 2003
Posts: 710
Location: New Zealand

PostPosted: Tue Feb 18, 2003 11:59 am    Post subject: Reply with quote

I suspect the problem in do_skills() relates to the insufficient space on the stack to retain the temporary array declared near the top of do_skills().

Can you try changing the line which reads
Code:
char skill_list[MAX_LEVEL][MSL];

to
Code:
char skill_list[MAX_LEVEL][2048];


And let us know if you still have a problem with that command, if this fixes it, I will change do_skills() to use malloc in future.

Regarding the problem with the races file becoming corrupted, I suspect there is a problem in GIO corrupting the file... this one will be difficult to solve via instructions thru the forum. Any chance I can get remote access to the box, is SSH available? If so, send me a private message on the forum and we can organise it from there.

- Kal Smile


Back to top
View user's profile Send private message Visit poster's website
Territan



Joined: 29 Jan 2003
Posts: 6

PostPosted: Tue Feb 18, 2003 1:47 pm    Post subject: Reply with quote

Kalahn wrote:
I suspect the problem in do_skills() relates to the insufficient space on the stack to retain the temporary array declared near the top of do_skills().

Can you try changing the line which reads
Code:
char skill_list[MAX_LEVEL][MSL];

to
Code:
char skill_list[MAX_LEVEL][2048];


And let us know if you still have a problem with that command, if this fixes it, I will change do_skills() to use malloc in future.


The Dawn crash log (generated by Mac OS X) seems to corroborate your theory:

Code:
Date/Time:  2003-02-16 21:03:14 -0500
OS Version: 10.2.4 (Build 6I32)
Host:       TerritanX.local.

Command:    dawn
PID:        15902

Exception:  EXC_BAD_ACCESS (0x0001)
Codes:      KERN_INVALID_ADDRESS (0x0001) at 0xbff2eaa0

Thread 0 Crashed:
 #0   0x0013ee80 in do_skills(char_data*, char*) (skills.cpp:323)
 #1   0x000ac434 in interpret(char_data*, char*) (interp.cpp:1300)
 #2   0x00061044 in process_input(descriptor_data*) (comm.cpp:4357)
 #3   0x0005af54 in game_loop() (comm.cpp:1177)
 #4   0x00059d2c in main (comm.cpp:696)
 #5   0x00001a30 in _start (crt.c:267)
 #6   0x000018b0 in start

PPC Thread State:
  srr0: 0x0013ee80 srr1: 0x0000f030                vrsave: 0x00000000
   xer: 0x20000000   lr: 0x000ac434  ctr: 0x0013ee6c   mq: 0x00000000
    r0: 0xfff35b10   r1: 0xbfff8f90   r2: 0x48000245   r3: 0x018fa368
    r4: 0x005afeb5   r5: 0x0000000e   r6: 0x00007329   r7: 0x6c202873
    r8: 0x73290020   r9: 0x003fa1a8  r10: 0xbfff8d98  r11: 0x003fc8d0
   r12: 0x0013ee6c  r13: 0x00000000  r14: 0x00000000  r15: 0x00000000
   r16: 0x00000000  r17: 0x00000000  r18: 0x00000000  r19: 0x00000000
   r20: 0x00000001  r21: 0x00007900  r22: 0x0000702b  r23: 0x00000001
   r24: 0x018fa368  r25: 0x00000166  r26: 0x003fa1a8  r27: 0x003fa1a8
   r28: 0x005afeb5  r29: 0xbfff93d0  r30: 0x00002728  r31: 0x000ab768


Having just applied the listed patch in skills.cpp, I can now type "skills" without crashing the MUD. Furthermore, it solves a problem where I couldn't gain new skills. Excellent! Smile

Kalahn wrote:
Regarding the problem with the races file becoming corrupted, I suspect there is a problem in GIO corrupting the file... this one will be difficult to solve via instructions thru the forum. Any chance I can get remote access to the box, is SSH available? If so, send me a private message on the forum and we can organise it from there.


Is this perhaps the same gio.cpp that I applied a type-patch to earlier? Interesting coincidence, that. No, I haven't done anything else with that file.

As for setting up access... as fun a notion as that might be, there's a problem: my development environment is a PowerBook G4. Yes, I'm compiling and running the MUD on a laptop. I'm not saying it'll prohibit you from telnetting or SSHing in completely, but it means we have to carefully arrange when you get in. Confused


Back to top
View user's profile Send private message AIM Address
Archiel
Moderator


Joined: 05 Feb 2003
Posts: 386
Location: Minnesota, USA

PostPosted: Tue Mar 25, 2003 7:47 am    Post subject: Reply with quote

I now have a nearly fully working version of DoT running in OS X, Jaguar. everything works except the resolver. I don't even notice it's gone. I had a lot of issues with races, however. They don't show up when creating a character. However, I got my pfile off the mud on a server, and I use that to build areas when I'm offline.

But anyway, it's possible. I only did those changes posted here. (I think)

-Caharin


Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
Territan



Joined: 29 Jan 2003
Posts: 6

PostPosted: Tue Mar 25, 2003 9:18 am    Post subject: Reply with quote

Caharin wrote:
I now have a nearly fully working version of DoT running in OS X, Jaguar. everything works except the resolver. I don't even notice it's gone. I had a lot of issues with races, however. They don't show up when creating a character.

That sounds familiar -- the first time you run it the race list is there. On following trips through (especially after shutting down and restarting), the race list is truncated or wiped completely. It makes creating a new character difficult when no races are allowed. Razz

Could this be more trouble with gio.cc?


Back to top
View user's profile Send private message AIM Address
Kalahn
Codebase Developer


Joined: 18 Jan 2003
Posts: 710
Location: New Zealand

PostPosted: Tue Mar 25, 2003 9:56 am    Post subject: Reply with quote

Does anyone have a machine running OS-X which I can have temporary SSH access to? I will get it working 100% and then include the changes in the next release.

- Kal



_________________
Kalahn
Developer of the Dawn of Time Codebase
http://www.dawnoftime.org/
Back to top
View user's profile Send private message Visit poster's website
Archiel
Moderator


Joined: 05 Feb 2003
Posts: 386
Location: Minnesota, USA

PostPosted: Sat Apr 05, 2003 7:30 am    Post subject: Reply with quote

I do!
Kalahn, I sent you a private message, but I'm not sure how often you check them.

-Caharin


Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
Kalahn
Codebase Developer


Joined: 18 Jan 2003
Posts: 710
Location: New Zealand

PostPosted: Sat Apr 05, 2003 9:35 pm    Post subject: Reply with quote

Thanks Caharin, Smile

I will make contact with you this week,

- Kal


Back to top
View user's profile Send private message Visit poster's website
Archiel
Moderator


Joined: 05 Feb 2003
Posts: 386
Location: Minnesota, USA

PostPosted: Tue Jun 10, 2003 8:28 am    Post subject: Reply with quote

Offer still stands....

Caharin


Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
Display posts from previous:   
Post new topic   Reply to topic    The Dawn Of Time Forum Index » Getting Started All times are GMT + 13 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001-2005 phpBB Group
Theme created by Vjacheslav Trushkin