   [1]<- Previous [2]-> Next [3]Contents

   [4]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 [5]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 [6]contrib files.
   (Thanks to the relevant package maintainers.)

  Mandatory library dependencies

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

     * [7]libXpm, last tested = 3.5.9
     * [8]libpng, last tested = 1.5.9
     * [9]zlib (a.k.a. libz), last tested = 1.2.5
     * [10]libtcd last tested = 2.2.5-r2

   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.

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

  Optional libraries

   New for XTide 2.13:  Configure will look for Xaw3dXft (>= 1.6.2),
   Xaw3d, or Xaw, in that order.  (XTide 2.12 and prior versions supported
   only plain Athena Widgets.)

   [Xaw-sample.png]   Plain Athena Widgets (Xaw) can be forced using
   --disable-3d.
   [Xaw3d-sample.png]   Xaw3d is a fork from an old version of Athena
   Widgets that offers improved scrollbars and a different look for
   buttons.  Version 1.5E was released in 2003.  Some issues that were
   subsequently fixed in Athena Widgets, such as long menus running off
   the screen, were fixed differently in Xaw3d.  (This affects the Set
   Time dialog, where the list of years to choose from can be quite
   long.)  [11]New developments on this library began in August 2011.
   [Xaw3dXft-sample.png]   Xaw3dXft is a fork from Xaw3d 1.5E that uses
   FreeType fonts.  The primary site is
   [12]http://sourceforge.net/projects/sf-xpaint/files/libxaw3dxft/.
   XTide enables a tweak in version 1.6.2 that fixes the problem with long
   menus in the Set Time dialog.

   XTide will link with [13]libgps (version 3.x or newer compatible
   version) if it is found on the system.  If a GPS is present and
   working, XTide will zoom in on your current location automatically.

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

  Downloading

   Mandatory:  You need the XTide source code distribution, available in
   bzipped tar format at
   [15]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.  Harmonics files are available at
   [16]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
   [17]http://www.flaterco.com/xtide/files.html#WVS.

  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

   The tar file also includes a change log and the disclaimers and terms
   applying to the 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/xti
de/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-nonfr
ee.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 [18]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.

   If building with Xaw3dXft, it is advisable to specify its directory in
   the runtime library search path to avoid a clash with Xaw3d:

bash-3.1$ ./configure LDFLAGS="-L/usr/local/libXaw3dXft-1.6.2/lib -Wl,-rpath,/us
r/local/libXaw3dXft-1.6.2/lib"

   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==scarydmons

   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-workaround Work around Y2038 problem; disable time
   zones.  See [19]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
   --disable-3d Use only genuine Athena Widgets.

   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 [20]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

  Library name conflict

   As of version 1.6.2, the result of building libXaw3dXft is called
   libXaw3d.so.8.0.1, which clashes with any version of libXaw3d that is
   installed on the same system.  To avoid dynamic linking problems, pass
   LDFLAGS="-L/usr/local/libXaw3dXft-1.6.2/lib
   -Wl,-rpath,/usr/local/libXaw3dXft-1.6.2/lib" (substituting whatever
   path to libXaw3dXft) to the configure script.

  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.

  Old PCs, CPU- and memory-constrained platforms

   [21]GCC, as of version 4.7.0, is broken for the i586 target; it uses
   instructions that the Pentium doesn't have, resulting in "Illegal
   instruction" failures.  It is possible that the i486 and i386 targets
   are broken as well, but I have not tested them.

   I succeeded in building XTide 2.13 on a 166 MHz Pentium PC with 96 MiB
   of RAM using the stock compiler package gcc-g++-4.5.2-i486-2 from
   Slackware 13.37, but it took hours and I had to set CXXFLAGS to -O1
   instead of -O2 to avoid running out of memory.  (Building without X
   running probably would have helped too.)

   There are some CPU bottlenecks to be aware of.  Real time estimates in
   the following are from the 166 MHz Pentium:
     * Updating the map in the location chooser takes between 0 and 20
       seconds depending on how much of the world has to be redrawn.  To
       avoid the lag when zoomed out, don't install the optional [22]World
       Vector Shoreline database.
     * On the first run, libXaw3dXft 1.6.2 bogs down for minutes trying to
       process exposure events on the long text of the disclaimer window.
       Since the disclaimer is normally read once and then disabled for
       future runs, one can either put up with it that one time or avoid
       the problem by building with libXaw3d or libXaw instead of
       libXaw3dXft.
     * Redrawing a default-sized tide graph takes about 1 second, which
       seems slow when one is scrolling forward or backward.  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.

  Cygwin

  XTide can be compiled and run using [23]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
  [24]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.13 RC1 using the collection of packages that was current as of
  2012-02-21.  As of then, the quirks apparent after brief testing were as
  follows:

    1. Whatever version of libXaw3d that Cygwin had did not work right.
       Configure with --disable-3d.
    2. Had to specify LDFLAGS="-L/usr/local/lib" even though
       /usr/local/include was found automatically.
    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.

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

  Visual C++ Express Edition

  The following instructions were validated on 2011-11-27 with XTide 2.12.1 and
  Visual C++ 2010 Express Edition under Windows XP SP3.  XTide 2.13 will not
  build under Visual C++ 2010 because [25]Visual C++ 2010 does not support C++11
  extended initializer lists.

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

    Building zlib and libpng with VC++ in Visual Studio

  The source distribution of libpng 1.5.6 includes a Visual Studio project under
  projects/vstudio that builds both zlib and libpng.

    1. Edit zlib.props in a text editor to specify the full path to the
       zlib sources.
    2. Open the project.
    3. Change the pull-down from Debug to Release.
    4. Do View -> Property Pages.
    5. Under Common Properties -> General -> Configuration Type, change
       the setting from .DLL to .LIB.
    6. For the zlib and libpng subprojects listed in the left side pane,
       change the setting under Configuration Properties -> C/C++ -> Code
       Generation from /MD to /MT.
    7. Build the zlib and libpng subprojects.
    8. Copy zlib.lib and libpng15.lib from Release to C:\FunkyLibs\lib.
    9. Copy zconf.h, zlib.h, png.h, pngconf.h, and pnglibconf.h to
       C:\FunkyLibs\include.

    Building libtcd and tide with VC++ in Cygwin

   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.

    1. Do Start -> Microsoft Visual Studio 2010 Express -> Visual Studio
       Command Prompt (2010).
    2. At the command line, execute C:\cygwin\Cygwin.bat (substitute the
       correct path to your Cygwin.bat file).
    3.
export LIB="${LIB}C:\\FunkyLibs\\lib;"
export LIBPATH="${LIB}C:\\FunkyLibs\\lib;"
export INCLUDE="${INCLUDE}C:\\FunkyLibs\\include;"

    4. Configure libtcd with ./configure CC=cl CXX=cl LD=cl CPP="cl /E"
       and do make.
    5. Move libtcd.lib to C:\FunkyLibs\lib and move tcd.h to
       C:\FunkyLibs\include.
    6. Configure xtide with ./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:

     * File names in the environment variable HFILE_PATH or the
       configuration file xtide.conf should be separated by semicolons
       instead of colons.
     * The file xtide.conf (and any other configuration files that you
       use) should go in the current working directory.  Not in PATH
       folders, not in the directory where tide.exe executable is.
     * Because the Microsoft Visual Studio run time doesn't support the
       zoneinfo database natively, you will get the message "XTide
       Warning:  Using obsolete time zone database.  Summer Time (Daylight
       Savings Time) adjustments will not be done for some locations."
     * PNG format output cannot be redirected from standard output because
       it gets corrupted by an ASCII conversion.  You must instead use the
       -o command line option to specify the output file.

   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 Setting
s\Mumble\Foo\harmonics-nonfree.tcd

UNIX flavors--old information

   The following old information has not been validated any time recently
   and might no longer apply.

  Mac OS X

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

  A [28]native port to OS X is also available.
  Sun

  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 [29]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:

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

Troubleshooting

Q: When compiling XTide, I get thousands of warnings of the form "warning:
'auto_ptr' is deprecated".

A: To suppress these nuisance warnings in GCC, use
CPPFLAGS="-Wno-deprecated-declarations" or upgrade to GCC 4.6 or newer.

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 fil
e: 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: When compiling XTide, I get an error involving xml-something or
   lex.xml.c.

   A: Do make xmlclean and then try again.

   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(m
alloc.obj)
MSVCRT.lib(MSVCR80.dll) : error LNK2005: _free already defined in LIBCMT.lib(fre
e.obj)
LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; us
e /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: Trying to compile XTide using Sun compilers, the following error
   occurs:
"/opt/SUNWspro/prod/include/CC/Cstd/./map", line 251: Error: Multiple declaratio
n for std::map<const Dstr, Configurable, std::less<const Dstr>, std::allocator<s
td::pair<const Dstr, Configurable>>>::insert(const std::pair<const Dstr, Configu
rable>&).
"BetterMap.hh", line 28:     Where: While specializing "std::map<const Dstr, Con
figurable, std::less<const Dstr>, std::allocator<std::pair<const Dstr, Configura
ble>>>".
"BetterMap.hh", line 28:     Where: Specialized in BetterMap<const Dstr, Configu
rable>.
"Settings.hh", line 30:     Where: Specialized in non-template code.

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

   [30]<- Previous [31]-> Next [32]Contents

References

   1. http://www.flaterco.com/xtide/sysreq.html
   2. http://www.flaterco.com/xtide/ports.html
   3. http://www.flaterco.com/xtide/xtide.html#contents
   4. http://www.flaterco.com/
   5. http://www.flaterco.com/xtide/files.html
   6. http://www.flaterco.com/xtide/files.html#contrib
   7. ftp://ftp.x.org/contrib/libraries/
   8. http://www.libpng.org/pub/png/libpng.html
   9. http://www.zlib.net/
  10. http://www.flaterco.com/xtide/files.html#libtcd
  11. http://cgit.freedesktop.org/xorg/lib/libXaw3d/
  12. http://sourceforge.net/projects/sf-xpaint/files/libxaw3dxft/
  13. http://gpsd.berlios.de/
  14. http://www.flaterco.com/util/index.html
  15. http://www.flaterco.com/xtide/files.html#xtide
  16. http://www.flaterco.com/xtide/files.html#harmonicsfiles
  17. http://www.flaterco.com/xtide/files.html#WVS
  18. http://www.gnu.org/software/automake/automake.html
  19. http://www.flaterco.com/xtide/time_t.html
  20. http://www.flaterco.com/xtide/advanced.html#cp
  21. http://www.mail-archive.com/debian-gcc@lists.debian.org/msg41019.html
  22. http://www.flaterco.com/xtide/installation.html#WVS
  23. http://www.cygwin.com/
  24. http://www.cygwin.com/
  25. http://connect.microsoft.com/VisualStudio/feedback/details/618392/c-0x-unified-extended-initializer-lists
  26. http://www.cygwin.com/
  27. http://fink.sourceforge.net/
  28. http://www.flaterco.com/xtide/ports.html#Mac
  29. http://www.blastwave.org/
  30. http://www.flaterco.com/xtide/sysreq.html
  31. http://www.flaterco.com/xtide/ports.html
  32. http://www.flaterco.com/xtide/xtide.html#contents
