This file contains some common problems/questions regarding Qsieve
and provides answers and hints to solve them.

Q: Question/Problem
A: Answer/Solution
---------------------------------------------------------------------------

Q1: We have problems to compile on Cygwin!

A: - use "make -f Makefile.Cygwin"
   - try to set "CPUFLAGS" in your makefile to a more appropriate
     value, eg. "CPUFLAGS = -march=pentium-mmx"


Q2: Where does Qsieve place its files?

A: By default, persistent files are placed in the current working directory,
   and temporary files are placed in "/tmp".  These values can be changed in
   the configuration file.  If an environment variable "QSIEVE_CFG" is
   defined, then the file given there is used as configuration file. If no
   such environment variable exists, then "qsieve.cfg" in the current
   working directory will be used. If no configuration file is found, then a
   warning message is emitted.


Q3: Binaries have been successfully compiled on Cygwin/Linux, but they do not
   function properly!

A: First check, whether a "/tmp" directory exists. If not, create a folder
   named "/tmp" and try again. (see also Q2)

   If the problem still exists, then you may have compiled the wrong
   binaries for your computer. There are many different optimization levels
   triggered by the makefile. Optimization is done at compile-time to gain
   maximum performance.  For example, if you enable "3D-Now!"-commands, the
   resulting binaries will only run on computers which do support "3D-Now!"
   instructions.

   You can either try to compile a more generic version of the binaries or
   you compile different versions for each machine.

   Please keep also in mind, that static binaries are linked against the
   GMP-library that was provided at compile-time. In most cases this should
   be no problem (except for performance reasons). But if you link against
   tuned versions of GMP, then the resulting binaries are machine-dependent.


Q4: After upgrading to Cygwin 1.5.11-1, Qsieve fails to work properly!

A: - see http://www.mail-archive.com/cygwin@cygwin.com/msg44295.html
   - try to upgrade Cygwin to a newer version or, if no newer version is
     available yet, upgrade your cygwin.dll to a recent snapshot.


Q5: Qsieve client aborts with a message, saying that
   "opening communication_stream "/tmp/... failed" or that
   "communication stream is in error state". Why this? What to do?

A: First check, whether a "/tmp" directory exists. If not, create a
   folder named "/tmp" and try again. (see also Q2)

   Does the problem still exist? -- My guess is, that the client was
   connected via Internet and not via LAN.  If this assumption is correct,
   then most probably the connection was temporarily broken. If IP-addresses
   change during data transfers, such errors/failures are detected (but not
   resolved).

   Restart the client manually, or preferable, write a tiny script:
    1. call client
    2. wait 2 minutes
    3. check, whether connection to server can be established
    4. on success: goto 1.

   Additionally you can monitor periodically the state of the client. On
   Linux you can use a cronjob for this task.  If the client is idle for too
   long, kill it and trigger a restart.

   Take a look to the ./contrib directory for such scripts.


Q6: I want to setup a Qsieve status webpage under the apache httpd-2.0.x
   webserver.  How to do this under Linux?

A: - first ensure, that APACHE and PHP are installed
   - php should be compiled with gd and png support
   - then goto the directory, where the apache "http.conf" is located
   - edit http.conf
   - restart the apache daemon

  for example:
  ------------
    if host.conf has the following entries
   ...
    AddType application/x-httpd-php .php
    NameVirtualHost *:80
    <VirtualHost *:80>
      DocumentRoot /home/yourname/qsieve-2.x/webinterface
      ServerName qsieve
      DirectoryIndex qsieve-status.php
    </VirtualHost>
   ...
    and the /etc/hosts has an entry like
    "127.0.0.3       qsieve"

    then the webservice is locally available under
    "http://qsieve/"
    whenever a Qsieve server is up and running.

    If you define additionally in qsieve.cfg:
    "XMLStatusFile = /home/yourname/qsieve-2.x/webinterface/status.xml"
    then a logfile of the latest factorizations is shown, whenever
    the Qsieve server cannot be connected.
