getting predict compiled (under osx 10.4)
KD6BD n KB5MU de AF6EP,
First of All I'd like to thank you for contributing your time, effort, and resources to the creation and support of predict for satellite tracking and vocalizer for osx respectively Presently I see http://www.qsl.net/kd2bd/predict.html mentions it working under osx but I see no link to source that will compile under osx. Maybe the following hints could be included in the readme of a future release, or even better have ./install figure out which unix you are compiling for and get the necessary stuff (bearing in mind the remaining questions below)
I downloaded the linux tarball from http://www.qsl.net/kd2bd/predict.htmlfor use on my mac powerbook G4, running OS X 10.4.11. As stated no source file is directly available there for OSX.
When I first attempted ./configure it couldn't find the c compiler. once I hard coded the osx location of gcc (/usr/bin/cc) into ./configure it attempted to compile only to fail looking for soundcard.h (not quite sure why predict needs a sound card)....ok the voice anouncements could be nice on my mac and I did find vocalizer for mac at http://www.mustbeart.com/software/MacVocalizer.html and replaced vocalizer with that but ./install still had the define for soundcard.h so it bombed again. It FINALLY compiled, though complained of not finding a soundcard after completely removing the include for soundcard.h from install.c.
2 questions at this point:
How do I get it to not complain about not having a soundcard?
How do I get it to use the verson of vocalizer for the mac referenced above?
Is there a means to easily call another external program instead of vocalizer when an event happens? (ultimately I'll be building a sat gateway based around predict and asterisk under linux and it would be nice to have predict trigger voice synthesis or playback within asterisk)
Please reply all, or at least to the amsat-bb (Whom, I cc'd) so all may benifet.
Thanks,
Eric AF6EP
At 2:38 PM -0800 12/1/08, Eric Fort wrote:
... even better have ./install figure out which unix you are compiling for and get the necessary stuff (bearing in mind the remaining questions below)
It does do that, but not in the usual way. The portability problems are really almost entirely in the configuration process itself!
I found the easiest thing to do was ignore the installer program. Just do manually what it does automatically, which is to create a little include file and then compile the rest of the program.
The little include file is named "predict.h" and it contains three definitions, like this:
char *predictpath="/foo/", soundcard=1, *version="2.2.2x";
You'd replace "/foo/" with the path where you want to install Predict. You'd use the version string that matches the version of source code you're compiling, possibly with an "x" or something added to signify that you've messed with it. The variable soundcard=1 is what makes it shut up about not having a soundcard.
Then just compile with something like
cc -lncurses -O3 predict.c -o predict
Back in 2003 I wrote the following; I don't know offhand if it still applies on OS X:
At 3:25 PM -0700 7/13/03, Paul Williamson wrote:
The only other interesting gotcha is that ftime() is used but doesn't exist in OS X's standard tools. You can work around this as follows:
ftime() has been replaced by gettimeofday(). The following function replaces the existing CurrentDaynum() function in the predict.c with one that uses gettimeofday():
double CurrentDaynum() { /* Read the system clock and return the number of days since 31Dec79 00:00:00 UTC (daynum 0) */
//struct timeb tptr; //int x;
// x=ftime(&tptr);
//return ((((double)tptr.time+0.001*(double)tptr.millitm)/86400.0)-3651.0);
struct timeval tv; struct timezone tz;
// gettimeofday() is referenced to Jan 1, 1970; 3651 converts to the reference above. if (gettimeofday(&tv, &tz) != 0) return 8000.0; // how should we handle errors? return ((((double)tv.tv_sec + 0.000001*(double)tv.tv_usec)/86400.0)-3651.0); }
How do I get it to use the verson of vocalizer for the mac referenced above?
Just put the vocalizer program into the vocalizer subdirectory of the installation directory, which must match the value of predictpath from predict.h.
Is there a means to easily call another external program instead of vocalizer when an event happens?
Vocalizer IS an external program. You can substitute any program you like, as long as it's named vocalizer/vocalizer. It takes simple command-line arguments.
73 -Paul kb5mu@amsat.org
FWIW, I compiled predict last night under Leopard (OSX 10.5) on my vanilla Core 2 iMac without difficulty. I have the usual developer stuff that comes with the OS, plus the iPhone SDK and all the goodies that go with it.
I deleted the include of sys/soundcard.h in installer.c, which produced a message about it being a bummer that I didn't have a sound card. Everything else worked, and it ran and generated predictions without comment. No issues with ftime(), no need to specify any additional libraries. I didn't try any of the support utilities.
The GNU-ish way to make programs and their compilation portable is automake and autoconf.
Laura Halliday VE7LDH "Que les nuages soient notre Grid: CN89mg pied a terre..." ICBM: 49 16.05 N 122 56.92 W - Hospital/Shafte _________________________________________________________________
participants (3)
-
Eric Fort
-
laura halliday
-
Paul Williamson