Install 3rd party libraries

From PLplotWiki
Revision as of 15:22, 23 December 2006 by Smekal (Talk | contribs) (added instructions for cd library)

Jump to: navigation, search

In opposition to Linux, where installing development files for certain 3rd party libraries is only a matter of seconds (depending on the distribution), in Windows much more work needs to be done. In the following we provide extensive instructions how to install 3rd party libraries with the corresponding development files so that the plplot library can use them.

You actually need none of these libraries to get PLplot compiled - they are needed for drivers or some features which are not available than.

QHull Library

Description

QHull is a library/program to determine the convex hull of a set of points in n dimensions. The CSIRO library that is part of PLplot uses this for certain interpolation methods (convex hulls in n dimensions are related to Voronoi diagrams and Delaunay triangulations in n-1 dimensions). For further information visi http://www.qhull.org/ .

Instructions

  • Download QHull for windows
  • Unzip qhull-2003.1.zip package in a suitable place
  • Copy the custom CMakeLists.txt from plplot\cmake\external\libqhull into the new directory (qhull-2003.1)
  • Cd into the new directory
  • Than (e.g. for MSVC):
mkdir build
cd build
cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=local ..
nmake install
  • a static library will be built and the library and the include files will copied into build\local\lib and build\local\include respectively - a shared library can only be build with MinGW or Cygwin
  • set environment variables
set QHULLDIR=path-to\qhull-2003.1\build\local
set CMAKE_INCLUDE_PATH=%QHULLDIR%\include
set CMAKE_LIBRARY_PATH=%QHULLDIR%\lib

CMake is now able to find the qhull library and headers.

AGG Library

Description

The AGG (Anti-Grain Graphics) Library is used by the wxWidgets driver (so there is no need for this library, if you don't use this driver) to display the plots nicely antialized. Note that from Version 2.5 on, the AGG library is now GPL, so for the time being Version 2.4 should be used for binary packages of PLplot, which is free also for commercial applications. Visit http://www.antigrain.com for further information.

Instructions

  • Download AGG v2.4 Windows
  • Unzip agg-2.4.zip package in a suitable place
  • Copy the custom CMakeLists.txt from plplot\cmake\external\libagg into the new directory (agg-2.4)
  • Cd into the new directory
  • Than (e.g. for MSVC):
mkdir build
cd build
cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=local ..
nmake install
  • a static library will be built and the library and the include files will copied into build\local\lib and build\local\include respectively - a shared library can only be build with MinGW or Cygwin
  • set environment variables
set AGGDIR=path-to\agg-2.4\build\local
set CMAKE_INCLUDE_PATH=%AGGDIR%\include
set CMAKE_LIBRARY_PATH=%AGGDIR%\lib

CMake is now able to find the agg library and headers.

CD Library

Description

The CD library is needed for the cgm driver. The CGM format is vector-based and is widely used as an interchange format between drawing and plotting programs.

Instructions

  • Download CD library
  • Untar cd1.3.tar.gz package in a suitable place
  • Copy the custom CMakeLists.txt from plplot\cmake\external\libcd into the new directory (cd1.3)
  • Cd into the new directory
  • Than (e.g. for MSVC):
mkdir build
cd build
cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=local ..
nmake install
  • a static library will be built and the library and the include files will copied into build\local\lib and build\local\include respectively - a shared library can only be build with MinGW or Cygwin
  • set environment variables
set CDDIR=path-to\cd1.3\build\local
set CMAKE_INCLUDE_PATH=%CDDIR%\include
set CMAKE_LIBRARY_PATH=%CDDIR%\lib

CMake is now able to find the cd library and headers.

GD Libary

Description

The gd library is needed my the gd driver of PLplot to produce png, jpeg or gif files.

Instructions

  • Download the gd library for Windows from http://www.boutell.com/gd/ . The latest version is 2.0.33 (Windows dll).
  • Unzip the archive to a suitable place.
  • The package provides a dll and an import library for the MinGW compiler. To obtain an import library for the MSVC compiler run the makemsvcimport.bat batch file in a CLI with the correct environment settings for MSVC.
  • In order to let cmake find the gd library files you need to set environment variables (best in batch file - see above), e.g.
set GDLIBDIR=C:\DevZone\gdwin32
set CMAKE_INCLUDE_PATH=%GDLIBDIR%;%CMAKE_INCLUDE_PATH%
set CMAKE_LIBRARY_PATH=%GDLIBDIR%;%CMAKE_LIBRARY_PATH%

CMake should than be able to find the gd library and headers and the gd driver (png, gif, jpeg) will be automatically compiled into the library.

Freetype Library

MinGW:

  • download and unzip freetype 2.2.1 (ft221.zip)
  • mingw32-make (compiler is detected)
  • mingw32-make (to compile the library)
  • copy objs\freetype.a objs\libfreetype.a
  • set FREETYPEDIR=C:\DevZone\freetype-2.2.1
  • set PATH=%FREETYPEDIR%\objs;%PATH%
  • set CMAKE_INCLUDE_PATH=%FREETYPEDIR%\include

Visual C++ 2005

  • download and unzip freetype 2.2.1 (ft221.zip)
  • change line 69 of freetype-2.2.1\builds\compiler\visualc.mk to
   CFLAGS ?= /nologo /c /Ox /W3 /WX /D_CRT_SECURE_NO_DEPRECATE
  • path_to_gnu_make\mingw32-make setup visualc
  • path_to_gnu_make\mingw32-make
  • set FREETYPEDIR=C:\DevZone\freetype-2.2.1
  • set PATH=%FREETYPEDIR%\objs;%PATH%
  • set CMAKE_INCLUDE_PATH=%FREETYPEDIR%\include