← Previous → Next Contents

Prospect Harbor Pt. Light, Prospect Harbor, Maine, 1998-06-14

Installation instructions for supported platforms

Assumptions

These installation instructions assume that you are building from sources obtained from http://www.flaterco.com/xtide/files.html.  However, some users may be able to shortcut this process:  binary packages for some platforms are available under contrib files.  (Thanks to the relevant package maintainers.)

These instructions also assume that you are building XTide version 2.9 or newer.  Previous versions of XTide were not packaged with GNU automake, so the installation process was not as standardized.  In addition, they statically linked with an included version of libtcd instead of using a shared libtcd that was installed separately.  For these reasons and others it is advisable that you upgrade to the current version of XTide.

Dependencies

In addition to the minimal set of X11 libraries that pretty much everyone has, you need the following libraries:

XTide will link with libgps (version 2.92 or compatible) if it is found on the system, but installing it is completely optional.  If a GPS is present and working, XTide will zoom in on your current location automatically.

XTide will link with libdstr (version 20080124 or compatible) if it is found on the system, but installing it is completely optional.  If it is not present, XTide will link statically with a bundled copy of Dstr.

tide and xttpd can be compiled in the absence of X11 libraries and libXpm.  However, you still need the other stuff.

Downloading

Mandatory:  You need the XTide source code distribution, available in bzipped tar format at http://www.flaterco.com/xtide/files.html#xtide.

Mandatory:  You need at least one harmonics file.  Harmonics files contain the data that are required for XTide to predict tides for different locations.  Canonical harmonics files and information on getting others is provided at http://www.flaterco.com/xtide/files.html#harmonicsfiles.

Optional:  If you want to enable XTide to draw coastlines on the map, you will also have to download the World Vector Shoreline (WVS) files, which are available in bzipped tar format at http://www.flaterco.com/xtide/files.html#WVS.

WVS is optional because the minimum recommended hardware (166 MHz Pentium PC) takes 16 seconds to draw shorelines for a hemisphere of the globe.  A 3.2 GHz P4 takes less than 1 second.

Installing a harmonics file

You will download a file with a name similar to harmonics-dwf-YYYYMMDD-free.tar.bz2.  With GNU tar, you can unpack it as follows:

tar xvjf harmonics-dwf-YYYYMMDD-free.tar.bz2

With another tar that does not include builtin support for bzip2, you need to do this instead:

bzip2 -dc harmonics-dwf-YYYYMMDD-free.tar.bz2 | tar xvf -

Unpack the archive in a temporary directory, then move the TCD file to a permanent location, e.g., /usr/local/share/xtide, and make it world readable:

mkdir /usr/local/share/xtide
chmod 755 /usr/local/share/xtide
chmod 644 harmonics-dwf-YYYYMMDD-free.tcd
mv harmonics-dwf-YYYYMMDD-free.tcd /usr/local/share/xtide

From the tar file, you will also get a file called harmonics_boilerplate.txt that explains the legal encumbrances of the -free and -nonfree data.

Installing the World Vector Shoreline files (optional)

  1. Create a directory to contain the WVS files.
  2. Change your current working directory to that directory.
  3. Unpack the tar file in that directory.

Under Linux and any other system with GNU tar:

tar xvjf wvs.tar.bz2

Elsewhere:

bzip2 -dc wvs.tar.bz2 | tar xvf -

Unpacking the sources

Under Linux and any other system with GNU tar:

tar xvjf xtide-2.xyz.tar.bz2

Elsewhere:

bzip2 -dc xtide-2.xyz.tar.bz2 | tar xvf -

Configuring

I.  Specify the location of the harmonics file(s)

There are two ways to do this.

  1. The first way is by setting the environment variable HFILE_PATH.

    export HFILE_PATH=/usr/local/share/xtide/harmonics.tcd
    

    In the event that you have more than one harmonics file that you wish to use simultaneously, list them separated by colons.

    export HFILE_PATH=/usr/local/share/xtide/harmonics-free.tcd:/usr/local/share/xtide/harmonics-nonfree.tcd
    

    Alternately, make sure that they are by themselves in a special directory and specify that directory as the value of HFILE_PATH.  If an element of HFILE_PATH is a directory, XTide will attempt to load every file in that directory (so be sure that they are all harmonics files!)

    If you are installing as root, then it is recommended that you add this definition to a system-wide script such as /etc/profile if you have one.

  2. The other way is by creating the file /etc/xtide.conf.  The environment variable, if set, takes precedence over the config file.

    If a configuration file is used, the first line should consist of the value that would be assigned to HFILE_PATH:

    /usr/local/share/xtide/harmonics-free.tcd:/usr/local/share/xtide/harmonics-nonfree.tcd

II.  Specify the location of the World Vector Shoreline files (optional)

Either set the environment variable WVS_DIR to the name of that directory or supply the directory name as the second line of the configuration file /etc/xtide.conf.

III.  Run the configure script

bash-3.1$ ./configure

XTide is packaged with the popular and portable GNU automake, so all usual GNU tricks should work.  Help on configuration options can be found in the CONFIGURE-HELP file or obtained by entering ./configure --help.

The web server xttpd is not necessary to use tide or xtide, so most users needn't worry about it.  However, if you plan to run it, there is additional configuration at this point.

To change the user and/or group under which xttpd tries to run (the defaults are nobody/nobody), provide the options --with-xttpd-user=user and/or --with-xttpd-group=group to configure.  If you want to run xttpd but you don't have root, you will have to set these to your own username and the name of some group to which you belong.

bash-3.1$ ./configure --with-xttpd-user=xttpd --with-xttpd-group==scarydæmons

You can also set the webmaster address for xttpd this way.

bash-3.1$ ./configure --with-webmaster="somebody@somewehere.else"

IV.  Other optional and alternative configurables

--enable-time-workaroundWork around Y2038 problem; disable time zones.  See Appendix A — Historical predictions and Y2038 compliance.
--enable-gnu-attributesUse with g++ –Wall –Wextra to make warnings smarter.
--enable-semicolon-pathsepUse ; instead of : to separate names in HFILE_PATH (good idea if they begin with C:\)
--enable-local-filesLocate xtide.conf, .xtide.xml, and .disableXTidedisclaimer files in current working directory

You can change the compile-time defaults (colors, etc.) set in config.hh if you so choose.  However, the easiest way to set all of those things is with the control panel in the interactive XTide program.

The e-mail address for feedback in xttpd can also be changed by setting the environment variable XTTPD_FEEDBACK, in lieu of the configure option mentioned above.

Compiling

bash-3.1$ make
bash-3.1$ su
bash-3.1# make install

Special cases

Mac OS X

XTide version 2.9.5 or newer should compile and run under Mac OS 10.3.3 or later.

If the PNG package is installed via Fink (http://fink.sourceforge.net/), use CPPFLAGS="-I/sw/include" and LDFLAGS="-L/sw/lib" to find the Fink-installed PNG files.

A native port to OS X is also available.

Sun

XTide version 2.10 or newer should work.

If compiling with Sun's own compiler, use CXX="CC -fast -library=stlport4" and CPPFLAGS="-I.".

Use CPPFLAGS="-I/opt/csw/include" and LDFLAGS="-R/opt/csw/lib/ -L/opt/csw/lib" to find libraries from Blastwave installed under /opt/csw.

IRIX

Some SGI machines come with a broken make program.  Use GNU make.

HP-UX

Long ago, a user submitted the following flags to get XTide to compile using the aCC compiler under HP-UX.  If somebody still uses this platform and the flags are still needed, they can be supplied to configure:

bash-3.1$ CXX="aCC" CXXFLAGS="-Wc,-koenig_lookup,on +DAportable" LDFLAGS="-lPW" ./configure

It is possible that the latest configuration scripts add all needed flags automatically, but they have not been tested under HP-UX.

Don't have X11

If you don't have any version of X11 installed and just want to compile xttpd or tide, generate a Makefile using ./configure and then type 'make xttpd' or 'make tide'.  You will probably need to install the binaries by hand.

CPU-bound platform

If running on the minimum recommended hardware (166 MHz Pentium PC) it is advisable to forego installing the World Vector Shoreline database.  If a true color display is present, graph drawing can be sped up enormously by turning off anti-aliasing (see settings, XTide*antialias).

Cygwin

XTide can be compiled and run using Cygwin, which is an emulated Unix environment for Windows that is free for typical non-commercial users.  The Cygwin distribution and its full license terms are available from http://www.cygwin.com/.

Cygwin packages are all versioned separately, so there is no baseline "Cygwin version" against which to test XTide.  Testing was most recently performed with XTide 2.11 RC1 using the collection of packages that was current as of 2010-07-02.  As of then, the quirks apparent after brief testing were as follows.

  1. Had to specify LDFLAGS="-L/usr/local/lib" even though /usr/local/include was found automatically.
  2. There were irreproducible problems with llround being either missing or duplicated at link time.  The workaround was to edit Station.cc to remove the HAVE_LLROUND conditional from around the substitute llround function and then replace the function name llround with something arbitrary in two places (where defined and where used).
  3. If only building certain of the programs, you must type (e.g.) 'make tide.exe' instead of 'make tide'.  'make tide' causes the automake-generated makefile to do something silly.
  4. Graph drawing in the interactive interface is an order of magnitude slower.  The slowdown can be mitigated by turning off anti-aliasing (see settings, XTide*antialias).

Cygwin used to have worse problems than that, so it is highly advisable to update your installation before compiling XTide.

Visual C++ Express Edition

A native Windows binary for the command-line client tide can be built using Visual C++ Express Edition (either 2005 or 2008).  However, you will still need a Cygwin environment to run the build process.  GCC is not required, but you'll need the bash shell, GNU make, etc.

Visual C++ ignores most of the standard command-line switches that the build process tries to use.  These instructions include a minimal set of workarounds so that tide will compile anyway.  However, because of the basic incompatibilities, you will still get a lot of warnings.

Before attempting to run configure or make, the environment variables PATH, INCLUDE, and LIB must be set to cover (A) the Visual C++ environment itself and (B) your installations of libpng, zlib and libtcd native Windows libraries.

To set variables for Visual C++, Visual C++ provides a batch file called vsvars32.bat that can be found somewhere in the Visual C++ program folder (e.g., C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools\vsvars32.bat).  To get these settings into the Cygwin environment, follow these three steps:

  1. Start a Command Prompt (Start→Accessories→Command Prompt or run cmd.exe).
  2. At the command prompt, invoke vsvars32.bat (use Search to find it if necessary).
  3. At the command prompt, invoke cygwin.bat (use Search to find it if necessary).

At that point you should have a bash prompt, and Visual C++ should work.  You can add the directories for your libpng, zlib and libtcd library installations using bash commands, e.g.,

export LIB="${LIB};C:\\FunkyLibs\\lib"
export INCLUDE="${INCLUDE};C:\\FunkyLibs\\include"

Having done that, run the configure script like this:

bash-3.1$ ./configure CC=cl CXX=cl LD=cl CPP="cl /E" LDFLAGS="zdll.lib libpng.lib libtcd.lib" --enable-semicolon-pathsep --enable-local-files

Depending on how you compiled your libpng, zlib and libtcd libraries, the specific file names to be listed in LDFLAGS may be different.

If you get a pop-up saying that "conftest.exe has encountered a problem," keep clicking on "Don't Send" until configuration proceeds.  Then run 'make tide.exe'.  You will get a lot of warnings.  The resulting executable might not work from the Cygwin bash prompt but it should work when run from a Windows command prompt (DOS box).

In accordance with the selected configure options, the following behaviors will differ from the default Unix behaviors:

So for example you could put the following in an xtide.conf file in the current working directory:

C:\Documents and Settings\Mumble\Foo\harmonics-free.tcd;C:\Documents and Settings\Mumble\Foo\harmonics-nonfree.tcd

Troubleshooting

Q: When compiling XTide, I get thousands of warnings of the form "warning: deprecated conversion from string constant to 'char*'".

A: Society is to blame.  To suppress these warnings in GCC, use CPPFLAGS="–Wno-write-strings".

Q: Trying to compile tide using Visual C++, the configure script complains that it can't find a library, and the following error messages appear in config.log.  Alternately, these errors can occur when linking tide.exe.

MSVCRT.lib(MSVCR80.dll) : error LNK2005: _malloc already defined in LIBCMT.lib(malloc.obj)
MSVCRT.lib(MSVCR80.dll) : error LNK2005: _free already defined in LIBCMT.lib(free.obj)
LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
conftest.exe : fatal error LNK1169: one or more multiply defined symbols found

A: These errors occur when libraries are compiled with conflicting settings of the Visual C++ compiler switches /MT, /MD and /LD.  Try recompiling the libraries without using any such switches.

Q: tide.exe compiles and runs with Visual C++ 2003, but non-ASCII characters (degrees symbol, accented characters, etc.) are not output correctly.

A: This is why Visual C++ 2003 is unsupported.  The function that is needed to select a codeset other than the default MS-DOS legacy codeset does not work.  Use 2005 or 2008 instead.

Q: Trying to compile XTide 2.9.4 or earlier on a Mac or Windows file system, the configure script crashes immediately.

A: This is fixed in XTide 2.9.5.  XTide 2.9.4 and earlier did not anticipate case-insensitive file systems..

Q: XTide compiles, but when I try to run it I get an error like

error while loading shared libraries: libtcd.so.0: cannot open shared object file: No such file or directory

A: Somehow, g++ found the shared library but your dynamic linker didn't.  To get the dynamic linker to find the library, you can just add its directory to the environment variable LD_LIBRARY_PATH.  For example, if you find the library in /usr/local/lib, you would add this to your .bashrc (if using bash):

export LD_LIBRARY_PATH=/usr/local/lib
Or you would add this to your .cshrc (if using csh or tcsh):
setenv LD_LIBRARY_PATH /usr/local/lib

Another workaround is to hard-code the directory into the executable using magic GNU linker switches:  configure with LDFLAGS="–Wl,–rpath,/usr/local/lib".  Finally, you could just link statically with libtcd.

Q: Trying to compile XTide using Sun compilers, the following error occurs:

"/opt/SUNWspro/prod/include/CC/Cstd/./map", line 251: Error: Multiple declaration for std::map<const Dstr, Configurable, std::less<const Dstr>, std::allocator<std::pair<const Dstr, Configurable>>>::insert(const std::pair<const Dstr, Configurable>&).
"BetterMap.hh", line 28:     Where: While specializing "std::map<const Dstr, Configurable, std::less<const Dstr>, std::allocator<std::pair<const Dstr, Configurable>>>".
"BetterMap.hh", line 28:     Where: Specialized in BetterMap<const Dstr, Configurable>.
"Settings.hh", line 30:     Where: Specialized in non-template code.

A: This problem is resolved by the -library=stlport4 compiler switch.

Q: XTide 2.8.3 or earlier compiles, but when run the following error occurs:

X Error of failed request:  BadName (named color or font does not exist)
  Major opcode of failed request:  45 (X_OpenFont)

A: You need to install the Schumacher fonts.  These fonts were reliably present on every X11 installation until 2006, when Linux distributions started breaking fonts out into lots of separate packages in accordance with upstream advice.  For what it's worth, XTide 2.9 gives a more helpful error message that tells you which font it could not load.

Q: When compiling XTide, I get an error involving xml-something or lex.xml.c.

A: For XTide 2.9 or later, do make xmlclean and then try again.  For XTide 2.8.3 or earlier, run the script do_xml.sh and then try again.


← Previous → Next Contents