PennMUSH Community

Ticket #7549 (new build problems)

Opened 6 months ago

Last modified 6 months ago

Problems with log2 on cygwin

Reported by: Talvo Assigned to:
Priority: crash Milestone:
Keywords: Cc:
Visibility: Public

Description

This could just be me being stupid, but I'm having problems compiling 1.8.3p6 on cygwin. With an unmodified copy of Penn, I get an error when running a 'make':

funmath.c:1101: error: parse error before '/' token

I tried several things to get around it; adding a '#define HAVE_LOG2' sorted the compile problem, but the game immediately crashed on restart (I'm not able to get a useful coredump with cygwin, I'm afraid). Tried changing the definition of log2 to be:

#define log2(x) (log(x)/log(2.0))

which gave me the warning

funmath.c:1100:1: warning: "log2" redefined in file included from funmath.c:12: /usr/include/math.h:225:1 warning: this is the location of the previous definition

On the assumption that maybe cygwin had a log2 but it was broken, I tried changing all the calls of log2() to use log2New(), and renamed the definition in funmath.c the same, which again let it compile successfully, but caused a crash on reboot. Not sure of anything else that might fix it or provide more useful info, but if there is anything I can do/check for you, please let me know...

Mike

Change History

(in reply to: ↑ description ) 01/28/08 14:26:16 changed by raevnos

Replying to Talvo:

This could just be me being stupid, but I'm having problems compiling 1.8.3p6 on cygwin. With an unmodified copy of Penn, I get an error when running a 'make':

Is this specific to cygwin? Does it work on other Windows compilers? Microsoft's? Mingw? Is HAVE_LOG2 defined on them?

funmath.c:1101: error: parse error before '/' token I tried several things to get around it; adding a '#define HAVE_LOG2' sorted the compile problem, but the game immediately crashed on restart (I'm not able to get a useful coredump with cygwin, I'm afraid). Tried changing the definition of log2 to be: #define log2(x) (log(x)/log(2.0)) which gave me the warning funmath.c:1100:1: warning: "log2" redefined in file included from funmath.c:12: /usr/include/math.h:225:1 warning: this is the location of the previous definition

If cygwin/windows has log2(), why isn't configure picking it up? Anyways, this shouldn't cause a crash. I suspect that's coming from something else. Try starting the mush under a debugger?

01/28/08 14:29:30 changed by Vchat20

I know this doesn't help much, but it's a workaround: But I also have ran into the same issue on cygwin and since I have never used the softcode log function, I commented out the full log2 function in funmath.c around line 1101 and it compiled fine afterwards and even booted without fail.

Just a thought. I haven't been able to find out why the problem comes up in the first place though.

01/28/08 19:40:22 changed by Talvo

cygwin's log2 is an #define. Javelin tells me that the way the test program works, it won't detect that, and suggested a configure override or a hints file.

To get around that particular issue, I just threw a '#define HAVE_LOG2' into funmath.c again, and it compiled fine. Still getting the crash on reboot, though.

I have 1.8.3p5 (and other previous versions) running fine. I've tried compiling with --with-pcre=no, as that's the only thing in the changelog I could see that was a major difference, and at Javelin's suggestion tried compiling without SSL, too, but to no avail. When I run under gdb, it gives me a message like

Program exited normally 7 [main] netmud 3220 _cygtls::handle_exceptions: Error while dumping state (probably corrupted stack)

and trying to run a 'where' gives "No stack." Can't think of anything else to try...