This file explains how to compile and install the CLAM libraries and 
applications from the source tarballs. Alternatively, CLAM website
provides already compiled packages for several platforms.

 1. Install CLAM dependencies

 This step is different for each architecture (Linux, Windows, MacOSX)
 Please, refere to the specific instructions below.
 
   
 2. Compile CLAM libraries from the source

 Checkout the subversion repository
 $ svn co http://iua-share.upf.edu/svn/clam/trunk 

 Or download the CLAM tarball (stable release or cvs snapshot) from the 
 web: [http://clam.iua.upf.es/download.html] 
 
 Change directory to CLAM/scons/libs/
 
 The simplest way to build and install the libraries is issuing :

        $ scons configure
        $ scons
        $ sudo scons install
 
 This will compile all the libraries with default options, and install
 them to the default dirs ( /usr/lib/ and /usr/include/ )

 In Linux, you should also go to the path where the libraries are installed and run:

        $ for v in "" .0 .0.95; do for a in core processing vmqt vmfl audioio; do ln -s libclam_$a.so.0.95.1 libclam_$a.so$v; done; done

 To see available build options run:

        $ scons --help

 Note that scons saves the last used options in the clam.conf file. 
 These options will be used by default in further "scons" commands.

 MacOSX specific: default prefix is set to /usr/local. Our tests using
 /usr didn't succeed. Another important issue is that in OSX there is
 no LD_LIBRARY_PATH, as the equivalent variable is called DYLD_LIBRARY_PATH.
   

 3. Compile the CLAM application.

 Applications can be download from the CLAM website in separate tarballs.
 If you are using svn they are folders at the CLAM trunk.
 Go to the root of the application source tree and issue:

        $ scons

 If you wish to use CLAM libs installed in a non-standard dir, you 
 will need to specify the clam_prefix :

        $ scons clam_prefix=~/mylibs/ install
 
 For further building options do :

        $ scons --help


++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++



1.1 Install CLAM dependencies on Linux

 Packages needed for Debian or Ubuntu 06.10 "Edgy":
 $ sudo apt-get install scons ladspa-sdk libxerces27-dev fftw-dev sfftw-dev libjack-dev libmad0-dev libogg-dev libsndfile1-dev libvorbis-dev libid3-3.8.3-dev libasound2-dev libfltk1.1-dev libjpeg62-dev libpng12-dev libxext-dev libxft-dev libqt3-headers libqt3-mt-dev doxygen qt4-dev-tools libqt4-dev libcppunit-dev
 
 Redhat / Fedora Core packages list (tested with FC5)
   gcc-c++ scons fftw2-devel fltk-devel libvorbis-devel libogg-devel qt-devel
   qt-designer libxml++-devel alsa-lib-devel libsndfile-devel ladspa-devel 
   id3lib-devel libXi-devel 
   Unofficial Pakages:
   libmad-devel (lvn5) jack-audio-connection-kit-devel (rhfc5.ccrma)
   qt4-devel, qt4 



1.2 Install CLAM dependencies on Mac OSX

  Required tools:
  ---------------

 * Apple's Mac OS X Developer Tools. 
 * Pkgconfig : install it from Fink or from source code taken from 
   [http://pkgconfig.freedesktop.org/wiki/ here].
 * scons : take the source code from [http://www.scons.org/ here]. 
   After decompressing it go to its directory and issue 
   "scons setup.py install". Then add the following line to your 
   ~/.bashrc and ./profile files:
        export PATH=$PATH:/System/Library/Frameworks/Python.framework/Versions/2.3/bin
 * Qt/Mac : download the binary package from [http://naranja.umh.es/~atg/software-qt3.html].
   Get the 10.4.X version since development must be done with gcc v4.
   Decompress and install. 
   Add these lines to your ~/.bashrc and ~/.profile files:

   export QTDIR=/Developer/qt
   export PATH=$PATH:/Developer/qt/bin
   
   Finally, open a console and execute the following commands 

   $ sudo cp /Developer/qt/lib/libqt-mt.3.3.5.dylib /usr/local/lib/
   $ sudo cp /Developer/qt/lib/libqui.1.0.0.dylib /usr/local/lib/

   (this is for workaround for a bug already communicated to the 
   binary package manager that hasn't been solved yet)

  Installing the 3rd party libraries with the dmg package
  -------------------------------------------------------
  This is the easy way. Download and install this file
  external-libraries-for-CLAM-X.Y.Z.dmg . Chapter 2.2 covers this
  simple process.

  Exceptions: Qt is not provided with this package. You'll need
  to get it from their web. See instructions below:

  Installing the 3rd party libraries from source
  ----------------------------------------------
  Alternatively, you can install the libraries form source.

  Where not specified, download latest version. The installation 
  process of these 3rd party libraries is the typical in Unix systems. 
  Special configuration phases are sometimes needed, in that case it 
  will be specified:
 
        $ tar xvzf library-X.Y.Z.tar.gz
        $ cd library-X.Y.Z
        $ ./configure --prefix=/usr/local
        $ make
        $ sudo make install

  * cppunit [http://cppunit.sourceforge.net/]
    default compilation procedure. Install it for unit testing issues 
    only.
  * id3 [http://id3lib.sourceforge.net/]
    default compilation procedure.
  * jack [http://jackit.sourceforge.net/]
    default compilation procedure.
  * fftw [http://www.fftw.org/]
    Download version 2.XX. Default compilation procedure.

        $ ./configure --prefix=/usr/local --enable-shared --enable-float --enable-type-prefix

  * sndfile [http://www.mega-nerd.com/libsndfile sndfile] 
    default compilation procedure.
  * mad [http://www.underbit.com/products/mad/]
    default compilation procedure.
  * ogg-vorbis [http://www.vorbis.com/]
    Download libogg and libvorbis. Default compilation procedure.
  * oscpack [http://www.audiomulch.com/~rossb/code/oscpack/ ] 
    Warning: the mac dynamic library creation makefile is not still 
    included in the main release. Deactivate oscpack or get the binary 
    dependencies.
  * portaudio [http://www.portaudio.com/]
    Get devel version (V19) from the CVS snapshot. 
    Default compilation procedure.
  * xerces-c [http://xml.apache.org/xerces-c/]
    it has special needs, as detailed here:

        $ export XERCESCROOT=$PWD
        $ cd $XERCESCROOT/src/xercesc
        $ autoconf
        $ ./runConfigure -pmacosx -rpthread -P/usr/local



1.3 Install CLAM dependencies on Windows
 
  Required Tools
  --------------

 * cl.exe command line compiler from Microsoft 
   (it comes with Microsoft Visual C++ 7.1).
 * python and scons installed on the system.
 * make sure that any needed tool have its directory added to the 
   PATH variable (in order to execute cl and scons)
   In particular you'll need all the 3rd party library DLLs in the PATH.
 * if you want to create installer you'll need nsis scripting language. 
   You can download it from [http://nsis.sourceforge.net/Main_Page] 
 
  3rd party libraries
  -------------------
  
  You can download the needed external libraries to build CLAM library 
  on the official CLAM webpage [http://www.iua.upf.es/mtg/clam/]. 
  Please make sure that they are installed on a common base directory. 
  i.e:
        devel\CLAM\
        devel\xercesc\ 
        devel\fftw\
        devel\...



