Merewether Weather, Merewether Tides and Solar Power Monitoring for Merewether, NSW, Australia - Newcastle Weather

Twitter Contact Login Search

Main

Getting Xtide working on Mac Server

Date:
By Mangrove Mike
Category: Linux Code

The objective was to move my xtide code (http://www.flaterco.com/xtide/xtide.html) which was running on an old Fedora Linux box and get it running on my Mac Mini Server running OSX Server 10.6.5 .

I contemplated using the Mac port put together by Lee-Ann Rucker (http://homepage.mac.com/lrucker/XTide/) put it didn't include the harmonics files from the entire world, so I decided to compile the native version.

(I already had Xcode and the SDK installed so you *MAY* need to do this first).

Essentially if you follow the instructions on the xtide site, although I did have to muck about with the compile switches to get it to compile.

I downloaded the following files from http://www.flaterco.com/xtide/files.html:

libtcd-2.2.5.tar.bz2
xtide-2.11.tar.bz2
harmonics-dwf-20100529-free.tar.bz2
harmonics-dwf-20100529-nonfree.tar.bz2

1.  Setup

I did the installation under /usr/local as root.

mkdir /usr/local/xtide

mkdir /usr/local/xtide/harmonics

Copy the harmonics files to /usr/local/xtide/harmonics and extract their contents.

tar xvjf harmonics-dwf-20100529-nonfree.tar.bz2
tar xvjf harmonics-dwf-20100529-free.tar.bz2

2.  Install libtcd

cd /usr/local
tar xvjf libtcd-2.2.5.tar.bz2
cd libtcd-2.2.5

read the README --> libtcd.html

./configure

(worked perfectly)

make

(some minor warnings like :
tide_db.c:1176: warning: format '%u' expects type 'unsigned int', but argument 3 has type 'size_t'
but all was mostly OK)

make install

I probably should have read and followed the message:

----------------------------------------------------------------------
Libraries have been installed in:
   /usr/local/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `DYLD_LIBRARY_PATH' environment variable
     during execution

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------

but didn't although things worked out in the end.

3.  Install Xtide

cd /usr/local
tar xvjf xtide-2.11.tar.bz2
cd xtide-2.11

Create the file /etc/xtide.conf and make the first line the location of your harmonics files:

cat /etc/xtide.conf
/usr/local/xtide/harmonics

I then had a series of failures - predominately aroung a png library failure doing just ./configure and the successful one is below.

the error was similar to:

configure: error: cannot find png.h; try setting CPPFLAGS.

 

./configure CPPFLAGS="-I/usr/X11/include" LDFLAGS="-L/usr/X11/lib"

Worked!

 

I then just generated the graphs and data required for the site, set it up in a cron job and that's what I'm using on the site.

 

 

 

 

 

 

 

 

2 comments

Any luck getting this running on 10.7?

Posted by M, 03/07/2012 6:17:05 am

I haven't upgraded my Mac Mini to 10.7 yet. I haven't looked for a few months but originally there were quite a few problems with the USB-to-Serial drivers for the Weather Station. This in itself put a stop to the desire to upgrade. I'll give it a crack soon though (or maybe jump straight to Mountain Lion!).

Posted by Mangrove Mike, 03/07/2012 7:26:55 am