The components of the distribution are
To install HippoDraw, just double click on the .msi file and follow the instructions. The installer file includes everything you need except Python. To use HippoDraw with Python, pre-built binaries for Python are available from the Python download page. You'll need to add HippoDraw to your Python path. Right click on MyComputer icon and go to
MyComputer->Properties->Advanced->Environmental Variables.
Create a new variable, PYTHONPATH, if you don't already have one, and add HippoDraw to it, for example, C:\Program Files\HippoDraw
Building HippoDraw from source under Windows requires a Trolltech Qt commercial license, Microsoft VC++ 7.1 project files and instructions on how to use them are located in the vs.net2003 directory.
Alternatively, one can find pre-built installer file at the Apple download site or versiontracker. These download sites are not maintained by the HippoDraw developers, but seems to stay up to date.
In most cases, just doing the standard configure, make, and make install dance should work. The configure script will find the required software if they are installed in their default locations (usually /usr/local). If it doesn't, read the Required and Optional Software. section below for what required software might be missing or located on usual places (especially for Mac OS X).
The following compilers have been used :
If an adequate version of Qt is not already installed on your system, it must be built and installed from source. See Installing Trolltech's Qt section below.
This release was developed with Qt 3.3.4.
Python can be obtained from http://www.python.org. This release was tested with Python 2.2, 2.3, and 2.4.
Only one class, FunctionWrap, requires this recent version of Boost, all others could use Boost-1.29.0 or later. See Boost path and library. for configuring HippoDraw for older versions of Boost.
See the Installing Boost section for tips on installing Boost.
http://seal.web.cern.ch/seal/snapshot/work-packages/mathlibs/minuit/index.html
This release was built against Minuit-1.5.2. Versions earlier than 1.4.0 are incompatible. This version does not require a Fortran compiler, versions earlier than 1.4.0 do.
Do not get confused by the libMinuit.so shared library that comes with the ROOT distribution, it is not the same thing. That library is an f2c'd version of the original Fortran. HippoDraw uses the grounds up re-write of Minuit in C++.
HippoDraw can return a numerical array to Python from any of the type of DataSource objects that are supported. One can also import data to a HippoDraw DataSource from a numerical array. This requires that at least one of numerical array Python modules has been installed and HippoDraw configured to build with to use it.
In source directory, just type ...
> ./autogen
This will create the Makefile.in in each subdirectory and the configure script that will be used in the next step. It will also create symbolic links in the config directory for scripts required by autoconf, automake, and libtool.
> ../hippodraw/configure
one should be configured with with the required external packages and any optional packages that were found to be installed. If this doesn't work, then read on in this section for configuring with external packages installed in non-standard places and see section If Configure Fails. for possible causes of the failure. The latter section also contains some special problems with Mac OS X.
It is recommended that you build in a separate directory from the source code. For example, if the name of the directory where the hippodraw source code is located is hippodraw/, then from the directory above it you might do
> mkdir hippodraw-BUILD > cd hippodraw-BUILD > ../hippodraw/configure --with-Qt-dir=/usr/local/qt --with-Qt-lib=qt-mt
This will force using Qt in /usr/local and its multi threaded library. The configure script will test the Qt installation and fail if faulty or incorrect path.
The configure script setups the build for the version of Python in your path. If this is not the version you want to build with, set your PATH environmental variable before running configure.
On Mac OS X, there are some special steps to be taken before running configure. See Old version of libtool on Mac OS X and Boost includes not found on Mac OS X below.
The configure script has many other options, which you can see by typing...
> ./configure --help
Most options are the same as other packages that use the GNU auto-tools suite. Some specific to HippoDraw are
--with-Qt-lib= sets the name of the Qt shared library. The default is qt-mt corresponding to libqt-mt.so which has multi-threading enabled.
Normally, under the directory where Qt has been installed, one finds Qt's bin, include, and lib directories. If this is not the case, then you need to use the remaining Qt related options to set the appropriate paths.
To try out the Qt 4 build, issue the following...
./hippodraw/configure --with-Qt-include-dir=/usr/local/qt-x11-opensource-4.0.0-b1/include/Qt --with-Qt-lib-dir=/usr/local/qt-x11-opensource-4.0.0-b1/lib --with-Qt-bin-dir=/usr/local/qt-x11-opensource-4.0.0-b1/bin --with-Qt-lib=QtGui
--with-boost-root= sets the path to the root of the boost installation. The default is /usr/local. This option only works if under this directory there is a subdirectory include/Boost-1_32/ subdirectory and a lib subdirectory.
--with-boost-include= sets the path to directory that contains a subdirectory boost/ which contains the header files. The default is /usr/local/include/boost-1_32/.
--with-boost-lib= sets the path to the boost libraries. The default is /usr/local/lib/.
--with-boost-libname= sets the name of the Boost.Python library. The default, if not given, is boost_python-gcc-1_32. A normal Boost install creates a dozen or so variations of each library. Because the compiler name is part of the library you may need to use this option when not compiling with gcc.
--with-minuit-lib= sets the path to the directory where the libMinuit.so shared library is installed. The default, if not given, is /usr/local/lib which is the default install of the Minuit package.
--with-minuit-libname= sets the name the Minuit shared library. The default is lcg_Minuit corresponding to the installed liblcg_Minuit.so file. If the version of Minuit you have installed is 1.5.1 or earlier, then this option should be used to set the library name to Minuit.
If Minuit is not found in the default location, or if the path of one of the above options is set to `no' or incorrect, then HippoDraw will be built without Minuit support.
--with-cfitsio-lib= sets the path to the directory where the libCfitsio.so shared library is installed. The default, if not given, is /usr/local/cfitsio/lib which is the default install of the CFITSIO package.
CFITSIO might be installed as part of the FTOOLS package, in which case one should use its installation path.
If CFITSIO is not found in the default location, or if the path of one of the above options is set to `no' or incorrect, then HippoDraw will be built without CFITSIO support.
--with-root-lib= sets the path to the ROOT library files. The default if not given, is /usr/local/lib/root.
If you want to build without ROOT support and ROOT is installed in the above default paths, then use --without-root-include or --without-root-lib.
If ROOT is not found in its default location, or if the path is set to `no' or incorrect, then HippoDraw will be built without ROOT support.
There is one warning coming from the build ...
g++ -DHAVE_CONFIG_H -I. -I../../hippodraw/numarray -I.. -I../../hippodraw -I../../hippodraw/python -I/usr/local/include/boost-1_32 -ftemplate-depth-60 -I/usr/local/include/python2.3 -g -O2 -Wall -c ../../hippodraw/numarray/NumArrayTuple.cxx -MT NumArrayTuple.lo -MD -MP -MF .deps/NumArrayTuple.TPlo -fPIC -DPIC /usr/local/include/python2.4/numarray/libnumeric.h:47: warning: 'libnumeric_API' defined but not used
which can be ignored.
> make
This command first compiles core library, than the Qt specific parts and standalone executable, and finally the Python extension module. It will take about 20 minutes on an 850MHz laptop.
To generate the documentation for the C++ library, requires installation of Doxygen (http://www.stack.nl/~dimitri/doxygen/index.html) and Graphviz (http://www.research.att.com/sw/tools/graphviz). You can change the Doxygen configuration file, `doc/Doxyfile.in', so Graphviz is not needed, but you will lose ability to generate some graphs.
If these tools are install type ...
> make docs
This will create a directory in your build directory called doc/html, and all of the html documentation will be created in this directory. There is one warning coming from HippoDraw sources depending on the version of Doxygen you are using For example ...
/home/pfkeb/hippodraw/graphics/ViewBase.h:191 Warning: argument `font' of command @param is not found in the argument list of EpsView::drawText(const std::string &s, float x, float y, float fontsize, float angle, char xp, char yp, bool resize, const FontBase *)
which appears to be a bug in Doxygen.
To install HippoDraw just type ...
> su Password: # make install
By default, installation is in /usr/local/bin. usr/local/include/HippoDraw-1.9.0, and usr/local/lib. Also, the Python module will be installed in /usr/local/lib/python<n.m>/site-packages where `<n.m>' is the Python version (without any further. bug fix releases number). You can change the path to the install area with the --prefix= option to the configure command.
If you did not install HippoDraw in the default area, then you need to add the path to the HippoDraw executable to your PATH environment variable or type the full path to the executable. To use HippoDraw as a Python extension module in this case, you need to add the path to the module to your PYTHONPATH environment variable. For example, if you installed HippoDraw in /usr/local/test, then csh users would do ...
> setenv PATH /usr/local/test/bin:$PATH > setenv PYTHONPATH /usr/local/test/lib/python2.4/site-packages:$PYTHONPATH
checking whether the C++ compiler works... configure: error: cannot run C++ compiled programs.
then configure is not finding the libstdc++.so version corresponding to the version of gcc it is using. This can happen, for example, if gcc in /usr/local/bin is being used and your system doesn't use /usr/local/lib in its shared library paths. The fix is to run configure like this ...
> ../hippodraw/configure LD_LIBRARY_PATH=/usr/local/lib
--disable-libtool-lock
Failure to do so will lead to the following error message to appear every two seconds
Waiting for BinnerBase.o.lock to be removed
With libtool locking disabled, one should not attempt to do parallel builds, i.e. using the `-j' option with the make command.
With this release, the temporary fix is to pre-pend to your PATH environment variable the following
export PATH=/System/Library/Frameworks/Python.framework/Versions/2.3/bin:$PATH
A second problem is that the Boost library name is different than the default. On most UNIX systems (including Linux), gcc is part of the library name when the GCC compiler is used. On Mac OS X, even though GCC is the compiler, gcc is not part of the library name. Thus, you need to configure the Boost options something like this
bartok:~/hippodraw-BUILD pfkeb$ ../hippodraw/configure --with-Qt-dir=$HOME/qt\ --with-Qt-lib=qt-mt --with-boost-include=$HOME/include/boost-1_32\ --with-boost-lib=$HOME/lib --with-boost-libname=boost_python-1_32
With this release, the configure script will fail to find the Boost shared libraries with a warning message like this...
configure: checking boost installation with BOOST_CXXFLAGS=-I/Users/pfkeb/include/boost-1_32 BOOST_LIB=/Users/pfkeb/lib BOOST_LIBNAME=boost_python-1_32 checking boost/python.hpp usability... yes checking boost/python.hpp presence... yes checking for boost/python.hpp... yes checking for /Users/pfkeb/lib/libboost_python-1_32.so... no configure: WARNING: Build will fail to build Python module, the last step
This is because the script is dumb enough to assume that shared libraries file names end with .so while on Mac OS X, they end with .dylib . The warning can be ignored as the Makefile is correctly generated anyway.
> configure --prefix=$HOME
then they will be installed in your home directory under bin/, include/, and lib/. This will it easier to install and use them and other packages that depend on them. Just set your PATH environment variable in include $HOME/bin and your LD_LIBRARY_PATH (DYLD_LIBRARY_PATH on Mac OS X) to include $HOME/lib.
Some external packages cause some trouble if you don't read the instructions carefully. This sections give some tips that have been learn over time by the developers of HippoDraw.
> tar zxvf qt-x11-free-3.3.4.tar.gz > cd /home/pfkeb/qt-x11-free-3.3.4/ > setenv QTDIR /home/pfkeb/qt-x11-free-3.3.4 > setenv PATH $QTDIR/bin:$PATH > setenv MANPATH $QTDIR/doc/man > setenv LD_LIBRARY_PATH $QTDIR/lib:/usr/local/lib > ./configure -prefix /usr/local/qt-x11-free-3.3.4 -R/usr/local/qt-x11-free-3.3.4/lib -R/usr/local/lib -thread -qt-gif > make > su Password: # make install
The multi-thread version is required so that HippoDraw can be used as a Python extension modules. You must also build Qt with the same compiler as you will use to build HippoDraw.
Boost version 1_31.0 and later are easy to build following the its web pages. Its seems that setting the environment variable `PYTHON_VERSION' is missing from these pages, otherwise it builds as instructed. This is true for both Windows and Unix like systems. With Boost version 1_31 there are warning messages about redefining _POSIX_C_SOURCE which apparently can be ignored. These warning don't appear with version 1_32
The following was done for installing Boost
> tar zxvf boost_1_32_0.tar.gz > cd boost_1_32_0 > su Password: # export PYTHON_VERSION=2.4 # bjam "-sTOOLS=gcc" install
This puts dozens of shared and static library files in /usr/local/lib. One probably doesn't need them all. If short on disk space, one might try the --without-<library> option to the bjam command. Or one might use the `stage' option and only copy the header directory boost and the required library files to /usr/local manually.
[pfkeb@localhost testsuite]$ python -i canvas.py Traceback (most recent call last): File "canvas.py", line 13, in ? from hippo import HDApp ImportError: /usr/local/lib/libboost_python-gcc-1_32.so.1.32.0: undefined symbol: PyUnicodeUCS4_FromEncodedObject
it is most likely caused by building Boost.Python with one version of Python and building Hippodraw with another that has different Unicode handling. The fix is to make sure you are using the same version of Python for building Boost.Python and HippoDraw.
Using that bjam was still not enough on my first try. I found I also had to do the following...
export PYTHON_VERSION=2.3 bjam --with-python-root=/System/Library/Frameworks/Python.framework/Versions/2.3 "-sTOOLS=darwin" install
Maybe if I had done the second in the first place I wouldn't have to build bjam.
/* Define to activate features from IEEE Stds 1003.1-2001 */ #define _POSIX_C_SOURCE 199506L
/usr/include/boost/python/detail/def_helper.hpp:80: internal compiler error: Segmentation fault
then the following might help...
Modified "boost/python/detail/translate_exception.hpp"(line 40) From: catch(exception_cref e) To: catch(exception_cref& e)
This problem was reported by Akito Kusaka. He was using SuSE 9.1, boost.python 1.31.0 from RPM package, gcc 3.3.3 from RPM package. He found the fix in http://mail.python.org/pipermail/c++-sig/2004-June/007587.html
/usr/include/boost/python/converter/as_to_python_function.hpp:28: sorry, unimplemented: `method_call_expr' not supported by dump_expr
Suggested work around is found on Python C++-sig mailing list . It allows compilation and linking but two the the test scripts, datareps.py and cuts.py, both fail at runtime.
>>> QThread: internal error: zero data for running thread.
> cd Python-2.4 > ./configure > make > su Password: # make install
When installing Python as root user with its make install it might fail with
/usr/bin/install -c -m 644 ./LICENSE /usr/local/lib/python2.3/LICENSE.txt PYTHONPATH=/usr/local/lib/python2.3 \ ./python -Wi -tt /usr/local/lib/python2.3/compileall.py \ -d /usr/local/lib/python2.3 -f \ -x 'badsyntax|site-packages' /usr/local/lib/python2.3 ./python: error while loading shared libraries: libstdc++.so.6: cannot open sha red object file: No such file or directory make: *** [libinstall] Error 127
The problem can be caused by the compiler being installed in /usr/local and the root user not having /usr/local/lib in his LD_LIBRARY_PATH. Just do
export LD_LIBRARY_PATH=/usr/local/lib
and try again.
/bin/sh ../libtool --mode=link g++ -g -O2 -Wall -o hippodraw \ -R /usr/local/lib -R /usr/lib main.o libhippoqt.la libtool: link: cannot find the library `'
then libtool is not handling the Mac OS X frameworks correctly. There is a patch for libtool 1.5 available from http://ranger.befunk.com/patches/libtool-framework.patch which I have not tested. Alternatively, after the qt/libhippoqt.la has been created, edit the line
dependency_libs=' -R/Users/pfkeb/qt/lib -L/Users/pfkeb/qt/lib /Users/pfkeb/qt/ lib/libqt-mt.la -lz Carbon QuickTime OpenGL -framework AGL '
so that it looks like
dependency_libs=' -R/Users/pfkeb/qt/lib -L/Users/pfkeb/qt/lib /Users/pfkeb/qt/ lib/libqt-mt.la '
> python setup.py install >
> cp pyfits /usr/local/lib/python2.4/site-packages/. > chmod 755 /usr/local/lib/python2.4/site-packages/pyfits.py >
Change the above to your version of Python as appropriate.