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.
In addition to the minimal set of X11 libraries that pretty much everyone has, you need the following libraries:
The interactive client requires that the Schumacher fonts be installed with X11. These fonts are always included with the X11 distribution, but their installation is frequently optional.
XTide will link with libgps (version 3.x or newer compatible version) 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.
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 Pentium 4 takes less than 1 second.
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.
Under Linux and any other system with GNU tar:
tar xvjf wvs.tar.bz2
Elsewhere:
bzip2 -dc wvs.tar.bz2 | tar xvf -
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 -
There are two ways to do this.
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.
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
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.
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"
--enable-time-workaround | Work around Y2038 problem; disable time zones. See Appendix A — Historical predictions and Y2038 compliance. |
--enable-gnu-attributes | Use with g++ –Wall –Wextra to make warnings smarter. |
--enable-semicolon-pathsep | Use ; instead of : to separate names in HFILE_PATH (good idea if they begin with C:\) |
--enable-local-files | Locate 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.
bash-3.1$ make bash-3.1$ su bash-3.1# make install
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.
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.
Some SGI machines come with a broken make program. Use GNU make.
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.
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.
If running on the minimum recommended hardware (166 MHz Pentium PC) it is advisable to forego installing the World Vector Shoreline database. Graph drawing is faster if an 8-bit display mode (PseudoColor visual) is used, but anti-aliasing and transparency are available only in true color modes. (The –aa setting that formerly could be used to speed up drawing on true color displays by disabling anti-aliasing was retired in XTide version 2.12.)
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.12 RC1 using the collection of packages that was current as of 2011-11-02. As of then, the quirks apparent after brief testing were as follows:
LDFLAGS="-L/usr/local/lib" even
though /usr/local/include was found automatically.Cygwin used to have much worse problems than that, so it is highly advisable to update your installation before compiling XTide.
Note: These instructions were last validated on 2011-11-27 with XTide 2.12.1 and Visual C++ 2010 Express Edition under Windows XP SP3.
A native Windows binary for the command-line client tide can be built using Visual C++ Express Edition. 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.
The source distribution of libpng 1.5.6 includes a Visual Studio project under projects/vstudio that builds both zlib and libpng.
Visual C++ ignores most of the standard command-line switches that the autoconf build process tries to use. These instructions include a minimal set of workarounds so that tide will compile anyway.
export LIB="${LIB}C:\\FunkyLibs\\lib;"
export LIBPATH="${LIB}C:\\FunkyLibs\\lib;"
export INCLUDE="${INCLUDE}C:\\FunkyLibs\\include;"
./configure CC=cl CXX=cl LD=cl CPP="cl /E" and do make../configure CC=cl CXX=cl LD=cl CPP="cl /E" LDFLAGS="zlib.lib libpng15.lib libtcd.lib" --enable-semicolon-pathsep --enable-local-files and do make tide.exe.You will get a lot of warnings.
The following behaviors will differ from the default Unix behaviors:
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
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 (the default appears to be /MT). In Visual Studio, the relevant option is buried under View → Property Pages, Configuration Properties → C/C++ → Code Generation.
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 2010 instead.
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/libOr 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: When compiling XTide, I get an error involving xml-something or lex.xml.c.
A: Do make xmlclean and then try again.