thomasoa / andrews-deal

Automatically exported from code.google.com/p/andrews-deal
Other
10 stars 7 forks source link

Build Problem on OS X #11

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I'm trying to install Deal 317 on my iBookG4 (PPC) running OSX 10.5.7.

I first tried the .dmg file, but running Deal from that gives me the
following error:

-bash: ./deal: Bad CPU type in executable

Downloaded the source and tried to build it per your instructions. Created
empty Makefile.dep, then ran make. Got the following error:

g++ -g -ansi -Wall -O2 -I/usr/include/tcl8.5  random.o additive.o hand.o
deal.o formats.o tcl_deal.o maindeal.o stat.o counttable.o vector.o dist.o
stringbox.o dealtypes.o keywords.o holdings.o tcl_dds.o dds.o ddsLookup.o 
 -o deal -L/usr/lib -ltcl8.5 -lm
ld: library not found for -ltcl8.5
collect2: ld returned 1 exit status
make: *** [deal] Error 1

I have current tools, so I took a look at the Makefile. Found the following
lines:

#include Make.mac-osx
include Make.ubuntu

Uncommented include for mac-osx and commented out the include for ubuntu.
Did 'make clean', then ran make again. This time with the following results:

g++ -fast -ansi -Wall  -I/usr/local/include  random.o additive.o hand.o
deal.o formats.o tcl_deal.o maindeal.o stat.o counttable.o vector.o dist.o
stringbox.o dealtypes.o keywords.o holdings.o tcl_dds.o dds.o ddsLookup.o 
 -o deal -L/usr/lib -ltcl -lm
Undefined symbols:
  "_counttable", referenced from:
      _counttable$non_lazy_ptr in hand.o
      _counttable$non_lazy_ptr in deal.o
      _counttable$non_lazy_ptr in dist.o
      _counttable$non_lazy_ptr in dealtypes.o
      _counttable$non_lazy_ptr in holdings.o
      _counttable$non_lazy_ptr in tcl_dds.o
      _counttable$non_lazy_ptr in dds.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [deal] Error 1

I'm now at a loss as to what to do next. Any help would be appreciated.

Jerry

Original issue reported on code.google.com by Jerry.Wi...@gmail.com on 6 Jul 2009 at 6:25

GoogleCodeExporter commented 9 years ago
I'm guessing the "make clean" didn't delete the file counttable.c - if your
counttable.c file is empty, delete it and try 'make' again.

I'm not sure why the version in the DMG file doesn't work for you - it tells me 
it is
a universal binary, but I don't have a PPC machine to test on, so I'll take 
your work
for it.

Original comment by thomasoa on 6 Jul 2009 at 6:43

GoogleCodeExporter commented 9 years ago
You are correct, counttable.c was not removed and was empty. I deleted it, reran
'make' and got the following error:

./makecounttable > counttable.c
/bin/sh: ./makecounttable: Bad CPU type in executable

Did 'make clean' and deleted counttable.c again, then tried 'make'. Successfully
compiled through stat.c, then got the same error.

Thanks for any help you can offer.

Jerry

Original comment by Jerry.Wi...@gmail.com on 6 Jul 2009 at 7:39

GoogleCodeExporter commented 9 years ago
Delete makecounttable as well, then

Original comment by thomasoa on 6 Jul 2009 at 7:44

GoogleCodeExporter commented 9 years ago
Delete makecounttable, but *not* makecounttable.c

Original comment by thomasoa on 6 Jul 2009 at 7:44

GoogleCodeExporter commented 9 years ago

Original comment by thomasoa on 7 Jul 2009 at 1:49

GoogleCodeExporter commented 9 years ago
I'm pretty frustrated at this point. No matter what I do, I cannot build on my 
PPC
machine. I always get the "bad cpu type in executable" message on the 
makecounttable
execution. I guess I'll just have to wait until I can upgrade my ppc machine to 
an
intel box.

Jerry

Original comment by Jerry.Wi...@gmail.com on 8 Jul 2009 at 3:12

GoogleCodeExporter commented 9 years ago
On last thing to try.

First, delete the following lines from Makefile:

   makecounttable: makecounttable.c
    $(CC) $(CFLAGS) makecounttable.c -o makecounttable $(LDFLAGS)

Then change the line in Make.mac-osx from:

    MAC_ARCH =

to:

    MAC_ARCH = -arch ppc

If that doesn't work, I'm at a loss.

Then, do a "make clean," delete counttable.c, makecounttable, and run "make".

Original comment by thomasoa on 8 Jul 2009 at 9:48

GoogleCodeExporter commented 9 years ago
Also, googling the error message turned up this discussion:

   http://lists.apple.com/archives/darwin-dev/2007/Aug/msg00087.html

Original comment by thomasoa on 8 Jul 2009 at 3:17

GoogleCodeExporter commented 9 years ago
Thanks, Andrew. This discussion gave me a solution that appears to have worked. 
I
changed the line to read

MAC_ARCH = -arch ppc -mcpu=G4

and I was able to successfully build deal, with makecounttable. I used the 
latest
sources from your Google project.

I know this isn't the ideal solution but it works for me so far and will keep 
me busy
until I get my new Intel-based Mac later this summer.

Again, thanks for all the help. I really appreciate it.

Jerry

Original comment by Jerry.Wi...@gmail.com on 8 Jul 2009 at 10:36