cgal/Installation/doc_tex/Installation/installation.tex

1162 lines
56 KiB
TeX

%%
%% *** CGAL Installation Guide ***
%%
%% file: installation.tex
%%
%% authors: Michael Hoffmann, Dima Pasechnik and Wieger Wesselink
%%
%% $Id$
%%
\newcommand{\cmake}{CMake}
\newcommand{\cpack}{CPack}
\newcommand{\nsis}{NullSoft Scriptable Installer}
%% macro for Windows-specific installation
\newcommand{\MSInst}{Windows-specific Installation}
%% macro for g++
\newcommand{\Gcc}[1]{\gnu~\texttt{g++}~{\rm #1}}
\newcommand{\gccurl}{\path'http://gcc.gnu.org/'}
%% macro for SUNPRO CC
\newcommand{\sunprocc}[1]{\textsc{Sunpro}~\texttt{CC}~{\rm #1}}
\newcommand{\sunproccurl}{\path'http://developers.sun.com/sunstudio/'}
%% macro for Borland C++
\newcommand{\bcc}[1]{\textsc{Borland}~\texttt{C++}~{\rm #1}}
\newcommand{\bccurl}{\path'http://www.inprise.com/bcppbuilder/'}
%% macro for Microsoft Visual C++
\newcommand{\msvc}[1]{\textsc{MS}~Visual~\texttt{C++}~{\rm #1}}
\newcommand{\msvcurl}{\path'http://msdn.microsoft.com/visualc/'}
%% macro for Intel C++ Compiler
\newcommand{\icl}[1]{\textsc{Intel}~\texttt{C++}~{\rm #1}}
\newcommand{\iclurl}{\path'http://software.intel.com/en-us/intel-compilers/'}
%% macro for Microsoft Windows
\newcommand{\mswin}{\textsc{MS}~Windows}
%% macro for CGAL directory
\newcommand{\cgaldir}{\texttt{CGAL-\cgalversionnumber}}
%% macro for YOUR CGAL directory :)
\newcommand{\yourcgaldir}{$<$\textit{insert your \cgaldir\ dir}$>$}
%% macro for CGAL install config directory
\newcommand{\cgalinstconfdir}{\cgaldir\texttt{/config/install}\index{directories!config/install@\texttt{config/install}}}
%% macros for WWW pages
% Now in cgal_manual.sty -- Laurent Rineau, 2010/02/20
%% write index in typewriter type. (c) Susan :-)
\newcommand{\TTindex}[1]{\index{#1@{\tt #1}}}
\newcommand{\TTsubindex}[2]{\index{#1@{\tt #1}!{#2}}}
\newcommand{\TTsubindextwo}[2]{\index{#1!#2@{\tt #2} }}
\section{Introduction}
The goal of \cgal, the \textit{Computational Geometry Algorithms Library},
is to provide {\em easy access to efficient and reliable
geometric algorithms} in the form of \CC\ libraries.
This document describes how to install \cgal\ on Windows, Unix-like systems and MacOS X.
Ideally, installing \cgal amounts to:
\begin{verbatim}
cd CGAL-3.6 # go to CGAL directory
cmake . # configure CGAL
make # build the CGAL libraries
cd examples/Straight_skeleton_2 # go to an example directory
cmake -DCGAL_DIR=$HOME/CGAL-3.6 . # configure the examples
make # build the examples
\end{verbatim}
%% $ This dollar is there to trick syntax highlighting in emacs
In a less ideal world, you probably have to install \cmake, a makefile
generator, and third party libraries. That's what this manual is about.
\section{Prerequisites\label{sec:prerequisites}}
The focus of \cgal\ is at geometry, and we rely on other
highly specialized libraries and software for non-geometric issues,
e.g. for numeric solvers, or visualization.
\subsection{Compilers}
In order to build the \cgal\ libraries, you need a \CC\ compiler.
\cgal~3.6 is supported for the following compilers/operating systems:
\begin{center}\index{compilers!supported}\index{supported compilers}
\renewcommand{\arraystretch}{1.3}
\gdef\lcTabularBorder{2}
\begin{tabular}{|l|l|} \hline
\textbf{compiler} & \textbf{operating system}\\\hline\hline
\Gcc{3.4 or later} \footnotemark[10]
& Linux / MacOS X
\\ & \mswin\ 95/98/2000/XP/NT4\footnotemark[11]\\\hline
\msvc{8.0, 9.0} (\textsc{Visual Studio 2005 and 2008}) \footnotemark[12]
& \mswin\ 95/98/2000/XP/NT4/Vista\footnotemark[11]\\\hline
\end{tabular}
\end{center}
\footnotetext[10]{\gccurl}\addtocounter{footnote}{1}
\footnotetext[11]{\msvcurl}\addtocounter{footnote}{1}
\footnotetext[12]{\iclurl}\addtocounter{footnote}{1}
\subsection{cmake}
In order to configure, build and install the \cgal\ libraries, examples and
demos, you need \cmake, a cross-platform ``makefile generator''.
If \cmake\ is not installed already you can obtain it from \cmakepage.
\cmake\ version~2.6.0 or higher is required.
\subsection{boost}
\cgal\ requires a working installation of the \boost\
libraries. In particular the header files and the threading library
binaries. Version 1.34.1 (or higher) is needed. In case
the \boost\ libraries are not installed on your system already, you
can obtain them from \boostpage. For Windows you can download an
installer from \path'http://www.boostpro.com/products/free'.
Since \texttt{Boost.Thread} is required, make sure to either install the precompiled
{\em static} binaries for your compiler or to build \texttt{libboost-thread}.
Some demos depend on \texttt{Boost.Program\_options}.
\subsection{Exact Arithmetic}
\cgal\ combines floating point arithmetic with exact arithmetic,
in order to be efficient and reliable. \cgal\ offers support for
\gmp+\mpfr, \mpfi\ and \leda\ number types, as well as a built-in
exact number type used when none of the above is installed on your
system.
Having \gmp\ version 4.2 or higher and \mpfr\ version 2.2.1 or higher
installed is highly recommended. These libraries can be obtained from
\gmppage\ and \mpfrpage, respectively. As Visual \CC\ is not properly
support by the \gmp\ and \mpfr\ projects, we provide precompiled versions
of \gmp\ and \mpfr.
\mpfi\ can be downloaded from \mpfipage. Version 1.4 or higher is
recommended.
\leda\ can be found at \ledapage. There is a free and a commercial
edition for this library.
\subsection{Visualization}
Most demos use Nokia's cross-plaform GUI toolkits Qt3 or Qt4.
In case Qt is not yet installed on your system, you can download
it from \qtpage. Qt4 is only supported for versions greater or equal to
4.2.1.
Some 3D demos use the libQGLViewer, which is a 3D widget for Qt4.
It can be downloaded from \path'http://www.libqglviewer.com'
\subsection{Miscellaneous}
The Surface Mesh Generator demo can read compressed image files
if {\em zlib} is installed. {\em zlib} can be downloaded from
\path'http://www.zlib.net'.
The Approximation of Ridges and Umbilics on Triangulated Surface Meshes
package as well as the Estimation of Local Differential Properties package
depend on the BLAS and LAPACK libraries. Implementations can be found at
\blaspage\ and \lapackpage. We provides precompiled versions of BLAS and
LAPACK for Visual~\CC.
The Surface parametrization package can be accelerated by using the sparse matrix solver \taucs.
This library can be downloaded from \taucspage. As Visual~\CC\ is not properly
supported by the \taucs\ project, we provide a precompiled version of
\taucs.
The Algebraic Kernel package uses the library \rs\ to perform real solving
on univariate polynomials. It can be downloaded from \rspage.
\section{Downloading \cgal\label{sec:gettingcgal}}
\index{CGAL@\cgal!getting}\index{getting \cgal}
The \cgal\ library can be downloaded from \path'http://www.cgal.org/download.html'.
After you have downloaded the file \texttt{CGAL-3.6.tar.gz} containing the
\cgal\ sources, you have to unpack it. Under a Unix-like shell, use the
command:
\begin{verbatim}
tar xzf CGAL-3.6.tar.gz
\end{verbatim}
When you are on Windows you may download and run the \texttt{CGAL-3.6-Setup.exe}. It is a
self extracting executable that installs the \cgal\ source, and that allows
you to select and download some precompiled third party libraries.
In both cases the directory \cgaldir\ will be created. This directory
contains the following subdirectories:\index{directories!structure}
\begin{center}
\renewcommand{\arraystretch}{1.3}
\gdef\lcTabularBorder{2}
\begin{tabular}{|l|l|} \hline
\textbf{directory} & \textbf{contents}\\\hline\hline
\texttt{auxiliary} & precompiled GMP, MPFR and TAUCS for Windows\\\hline
\texttt{config} & configuration files for install script\\\hline
\texttt{cmake/modules} & modules for finding and using libraries\\\hline
\texttt{demo} & demo programs (most of them need \qt, geomview or other third-party products)\\\hline
\texttt{doc\_html} & documentation (HTML)\\\hline
\texttt{doc\_pdf} & documentation (PDF)\\\hline
\texttt{examples} & example programs\\\hline
\texttt{include} & header files\\\hline
\texttt{scripts} & some useful scripts (e.g. for creating CMakeLists.txt files)\\\hline
\texttt{src} & source files\\\hline
\end{tabular}
\end{center}
The directories \texttt{include/CGAL/CORE} and \texttt{src/CGALCore} contain a
distribution of the \core\ library\footnote{\corepage} version~1.7 for
dealing with algebraic numbers. \core\ is not part of \cgal\ and has its
own license.
The only documentation shipped with \cgal{} sources is the present
installation manual. The \cgal{} manual must be downloaded separately from
\path'http://www.cgal.org/download.html'.
The directory \texttt{include/CGAL/OpenNL} contains a distribution of the
Open Numerical Library which provides solvers for sparse linear systems, especially designed
for the Computer Graphics community. OpenNL is not part of \cgal\ and has its own license.
\section{Configuring \cgal}
Before building \cgal\ you have to choose the compiler/linker,
set compiler and linker flags, specify which
third-party libraries you want to use and where they can be found, and
which \cgal\ libraries you want to build. Gathering
all this information is called {\em configuration}.
For CGAL-3.6, the configuration is generated with \cmake, a
cross-platform build system. This manual explains only those features of
\cmake\ which are needed in order to build \cgal. Please refer to the \cmake\
documentation at \cmakepage\ for further details.
The \cmake\ configuration process generates a makefile or a Visual \CC\
solution and project file that you can use to build \cgal.
\subsection{Configuring \cgal{} with the \cmake{} {\sc Gui} }
The simplest way to start the configuration is to run the graphical
user interface of \cmake. We recommend to use \texttt{cmake-gui}. It
is available on all platforms since \cmake\ version~2.6. You must pass as
argument the root directory of \cgal. For example:
{\ccTexHtml{\scriptsize}{}
\begin{verbatim}
cd CGAL-3.6
cmake-gui . # Notice the dot to indicate the current directory.
\end{verbatim}
}
Once \texttt{cmake-gui} has started up, you must press 'Configure'.
A dialog will pop up and you will have to choose what shall get generated.
After you have made your choice and pressed 'ok', you will see
the output of configuration tests in the lower window of the application.
When these tests are done, you will see many
red entries in the upper window. Just ignore them and press once again 'Configure'.
By now \cmake\ should have found many libraries and have initialized variables.
If you still find red entries you have to provide the necessary information.
This typically happens if you have installed software at non-standard locations.
Providing information and pressing 'Configure' goes on until
all entries are grayed. You are now ready to press 'Generate'. Once this is
done, you can quit \texttt{cmake-gui}.
\subsection{Configuring \cgal{} with the cmake command-line tool }
Alternatively, you can run the command-line tool called
\texttt{cmake}. You pass as argument the root directory of
\cgal. For example:
{\ccTexHtml{\scriptsize}{}
\begin{verbatim}
cd CGAL-3.6
cmake . # Notice the dot to indicate the current directory.
\end{verbatim}
}
The very first thing \cmake\ does is to detect the compiler to use. This
detection is performed by a special \cmake\ module called a {\em
generator}. A \cmake\ generator understands the build requirements for a
particular compiler/linker and generates the necessary files for that. For
example, the {\em UNIX Makefiles} generator understands the GNU toolchain
(g++, gcc, ld etc.) and produces makefiles, which can be used to build a
target by a simple call to \texttt{make}. Likewise, the {\em Visual Studio
2005} generator produces solution and project files and can be manually
launched in the VS IDE to build the target.
Each platform has a default generator, so you only need to select one when
the default is not what you want. For example, under Windows, it is
possible to generate {\em NMakefiles} instead of Visual Studio project
files in order to build the library with \texttt{nmake}. Running
\texttt{cmake} with no parameters in a command-line prints the list of
available generators supported by your platform and \cmake\ version. If the
generator you need is not listed there, you can try a newer \cmake\
version, as generators are hardcoded into \cmake, and additional
generators are added with each release.
Since the choice of the generator determines the type of build files to generate, in some cases
you choose a particular generator as a mean to choose a specific compiler (because they use different
build files). For example, the following generates solution files for use in Visual \CC\ 9.0:
{\ccTexHtml{\scriptsize}{}
\begin{verbatim}
cd CGAL-3.6
cmake -G"Visual Studio 9 2008" .
\end{verbatim}
}
In other cases, however, the generator doesn't directly identify a specific compiler but a tool chain.
For example, the \texttt{UNIX Makefiles} generator produces \texttt{makefiles} that call some auto-detected
command-line compiler, like \texttt{gcc}. If you need the makefiles to use a different compiler, you need to
specify the desired compiler in the call to \cmake{}, as in this example:
{\ccTexHtml{\scriptsize}{}
\begin{verbatim}
cd CGAL-3.6
cmake -DCMAKE_CXX_COMPILER:FILEPATH=g++-3.4 .
\end{verbatim}
}
\cmake\ maintains configuration parameters in so-called {\em cmake variables}, like the \texttt{CMAKE\_CXX\_COMPILER}
in the example above. These variables {\em are not environment variables} but {\em \cmake\ variables}. Some of the \cmake{}
variables represent user choices, such as \texttt{WITH\_examples} or \texttt{CMAKE\_BUILD\_TYPE=Release}, while others
indicate the details of a third-party library, such as \texttt{Boost\_INCLUDE\_DIR} or the compiler flags to use,
such as \texttt{CMAKE\_CXX\_FLAGS}.
The command line tool \texttt{cmake} accepts \cmake\ variables as arguments of the form \texttt{-D<VAR>:<TYPE>=<VALUE>}, as
in the example above, but this is only useful if you already know which variables need to be explicitly defined.
\begin{ccAdvanced}
\cmake\ keeps the variables that a user can manipulate in a so-called {\em \cmake\ cache}, a simple text file
named \texttt{CMakeCache.txt}, whose entries are of the form VARIABLE:TYPE=VALUE. Advanced users can manually edit this
file, instead of going through the interactive configuration session.
\end{ccAdvanced}
The configuration process not only determines the location of the required dependencies, it also dynamically generates a
\texttt{compiler\_config.h} file, which encodes the properties of your system and a special file named
\texttt{CGALConfig.cmake}, which is used to build programs using \cgal. The
purpose of this file is explained below.
\subsection{\cgal\ Libraries}
\cgal\ is split into six libraries. During configuration, you can select the libraries that
you would like to build by setting a \cmake\ variable of the form {\tt WITH\_<library>}. By default all
are switched \texttt{ON}.
\begin{center}\index{cgal!libraries}\index{cgal libraries}
\renewcommand{\arraystretch}{1.3}
\gdef\lcTabularBorder{2}
\begin{tabular}{|l|l|l|l|} \hline
\textbf{library} & \textbf{\cmake\ variable} & \textbf{functionality} & \textbf{dependencies}\\\hline\hline
\texttt{CGAL} & {\em none} & Main library & GMP, MPFR, Boost (headers)\\
& & & and Boost.Thread (library)\\\hline
\texttt{CGAL\_Core} & \texttt{WITH\_CGAL\_Core} & The CORE library for algebraic numbers.\footnotemark[15] & GMP and MPFR\\\hline
\texttt{CGAL\_Qt3} & \texttt{WITH\_CGAL\_Qt3} & \ccc{CGAL::Qt_widget} used by Qt3-based demos & Qt3 and OpenGL\\\hline
\texttt{CGAL\_Qt4} & \texttt{WITH\_CGAL\_Qt4} & \ccc{QGraphicsView} support for Qt4-based demos & Qt4 and OpenGL\\\hline
\texttt{CGAL\_ImageIO} & \texttt{WITH\_CGAL\_ImageIO} & Utilities to read and write image files & OpenGL, ZLib, VTK (optional)\\\hline
\end{tabular}
\end{center}
\footnotetext[15]{CGAL-core++ is not part of \cgal, it is a custom version the CORE library distributed
by \cgal\ for the user convenience and it has it's own license.}\addtocounter{footnote}{1}
If you turn off the configuration of a library, you can still configure it manually from the source directory:
{\ccTexHtml{\scriptsize}{}
\begin{verbatim}
cd CGAL-3.6/src/CGALQt4
cmake . # configures only the CGAL_Qt4 library
\end{verbatim}
}
\subsection{Examples and Demos}
\cgal\ is distributed with a large collection of examples and demos. By default, these are NOT configured along with
the \cgal\ libraries, unless you set the variables {\tt WITH\_examples=ON} and/or {\tt WITH\_demos=ON}.
Nevertheless, even when configured with \cgal, they are not automatically built along with the libraries.
You must build the \texttt{examples} or \texttt{demos} make targets (or IDE projects) explicitly.
\subsection{Debug vs.\ Release}
The \cmake\ variable \texttt{CMAKE\_BUILD\_TYPE} to indicate how to build
the libraries. It accepts the values \texttt{Release} or
\texttt{Debug}. The default depends on the platform, so it is recommended
that you always indicate the build type explicitly. For performance
reasons, you should always use \texttt{Release}, unless you want to debug
your program.
This is not an issue for solution/project files, as there the user selects the build type from within the IDE.
\subsection{Static vs.\ Dynamic Libraries }
Under Windows we only support the static versions of the \cgal\ libraries.On other platforms
the shared version ({\tt .so}) are build by default.
You can choose to produce static libraries instead by setting the \cmake\ variable {\tt BUILD\_SHARED\_LIBS=FALSE}
These setting affect the variants of third-party libraries selected whenever the choice is available.
\subsection{Multiple Variants of makefiles}\label{sec:cmake-out-of-source}
While you can choose between release or debug builds, and shared or static libraries,
it is not possible to generate different variants during a single configuration. You need to run \cmake\ in a
different directory for each variant you are interested in, each with its own selection of configuration parameters.
\cmake\ stores the resulting makefiles and project files, along with several temporary and auxiliary files such
as the variables cache, in the directory where it is executed, called \texttt{CMAKE\_BINARY\_DIR}, but it
takes the source files and configuration scripts from
\texttt{CMAKE\_SOURCE\_DIR}.
The binary and source directories do not need to be the same. Thus, you can configure multiple variants by creating a
distinct directory for each configuration and by running \cmake\ from there. This is known in \cmake\ terminology
as {\em out-of-source configuration}, as opposite to an {\em in-source
configuration}, as showed in the previous sections.
You can, for example, generate subdirectories \cgaldir{}\texttt{/cmake/platforms/debug} and
\cgaldir{}\texttt{/cmake/platforms/release} for two configurations, respectively:
{\ccTexHtml{\scriptsize}{}
\begin{verbatim}
mkdir CGAL-3.6/cmake/platforms/debug
cd CGAL-3.6/cmake/platforms/debug
cmake -DCMAKE_BUILD_TYPE=Debug ../../..
mkdir CGAL-3.6/cmake/platforms/release
cd CGAL-3.6/cmake/platforms/release
cmake -DCMAKE_BUILD_TYPE=Release ../../..
\end{verbatim}
}
\section{Building \cgal\ Libraries}
%If configuration succeeded there will be certain {\em build files} ready
%to build the libraries.
The results of a successful configuration are build file that control the build step.
The nature of the build files depends on the generator used during configuration, but in all cases they
contain several {\em targets}, one per library, and a default global target corresponding
to all the libraries.
For example, in a UNIX-like environment the default generator produces
makefiles. You can use the \texttt{make} command-line tool for the
succeeding build step as follows:
{\ccTexHtml{\scriptsize}{}
\begin{verbatim}
cd CGAL-3.6
# build all the selected libraries at once
make
# build just the libraries needed for the Surface mesher demo
make CGAL CGAL_ImageIO CGAL_Qt4
\end{verbatim}
}
The resulting are placed in the subdirectory {\tt lib} under {\tt <CMAKE\_BINARY\_DIR>}
(which is \cgaldir\ in case you run an in-source-configuration).
With generators other than {\tt UNIX Makefiles} the resulting build files
are solution and project files which
should be launched in an {\sc Ide}, such as Visual Studio or KDevelop3. They will contain the targets described
above, which you can manually build as with any other solution/project within your {\sc Ide}.
Alternatively, you can build it with the command line version of the
{\sc Visual Studio Ide}:
{\ccTexHtml{\scriptsize}{}
\begin{verbatim}
devenv CGAL.sln /Build Debug
\end{verbatim}
}
The "Debug" argument is needed because \cmake\ creates solution files for
all four configurations, and you need to explicitly choose one when building
(the other choices are Release, RelWithDebInfo and MinSizeRel).
\begin{ccAdvanced}
The build files produced by \cmake\ are autoconfigured. That is, if you change any
of the dependencies, the build step automatically goes all the way back to
the configuration step. This way, once the target has been configured the
very first time by
invoking cmake, you don't necessarily need to invoke \texttt{cmake} again. Rebuilding will call
itself \texttt{cmake} and re-generate the build file whenever needed. Keep this in mind if you
configure \cgal\ for the Visual Studio IDE since a build could then change the solution/project
file in-place and VS will prompt you to reload it.
\end{ccAdvanced}
If you have turned on the configuration of examples and/or demos, there will be additional
targets named \texttt{examples} and \texttt{demos}, plus one target for
each example and each demo in the build files.
None of these targets are included by default, so you need to build them explicitly
{\em after} the \cgal\ libraries have been successfully built.
The targets \texttt{examples} and \texttt{demos} include themselves all the targets
for examples and demos respectively.
{\ccTexHtml{\scriptsize}{}
\begin{verbatim}
# build all examples at once
make examples
# build all demos at once
make demos
# build only the Straight Skeleton demo
make Straight_skeleton_2_demo
\end{verbatim}
}
\begin{ccAdvanced}
When using \texttt{UNIX Makefiles} you can find out the exact name of the example or demo target
of a particular package by typing \texttt{make help | grep <package>}.
\end{ccAdvanced}
\section{Installing \cgal\ Libraries}
% prevent links to /usr/include and /usr/lib (\path commands)
\ccHtmlLinksOff%
On many platforms, library pieces such as headers, docs and binaries
are expected to be placed in specific locations. A~typical example
being \path'/usr/include' and \path'/usr/lib' on {\sc Unix}-like
operating systems or \path'C:/Program Files/' on Windows. The process
of placing or copying the library elements into its standard location
is sometimes referred to as {\em Installation} and it is a
postprocessing step after the build step.
\ccHtmlLinksOn%
\cmake\ carries out the installation by producing a build target named {\em install}.
The following example shows a typical session from configuration to
installation in a {\sc Unix}-like environment:
{\ccTexHtml{\scriptsize}{}
\begin{verbatim}
cd CGAL-3.6
cmake . # configure
make # compile
make install # install
\end{verbatim}
}
If you use a generator that produces IDE files (for Visual Studio for instance) there will be an optional
\texttt{INSTALL} project, which you will be able to {\em ``build''} to execute the installation step.
\begin{ccAdvanced}
The files are copied into a directory tree relative to the {\em installation directory} determined by the
\cmake\ variable \texttt{CMAKE\_INSTALL\_PREFIX}. This variable defaults to {\tt /usr/local} under UNIX-like operating systems
and \path'C:\Program Files' under Windows. If you want to install to a different location, you must override that \cmake{}
variable explicitly {\em at the configuration time} and not when executing the install step.
\end{ccAdvanced}
The file \texttt{CGALConfig.cmake} is installed by default in
\texttt{\$CMAKE\_INSTALLED\_PREFIX/lib/CGAL-3.6}.
\section{Configuring and Building Programs Using \cgal}
\cmake\ can be used to configure and build user programs as well via a \cmake\
script ({\tt CMakeLists.txt}). All the examples and
demos contain such \cmake\ scripts.
During configuration of the \cgal\ libraries a file named {\tt
CGALConfig.cmake} is generated in the binary directory. This file
contains the definitions of several \cmake\ variable that summarize the
configuration of \cgal. In order to configure a user program, you need
to indicate the location of that config file in the \cmake\ variable
\texttt{CGAL\_DIR}:
{\ccTexHtml{\scriptsize}{}
\begin{verbatim}
cd CGAL-3.6/examples/Straight_skeleton_2
cmake -DCGAL_DIR=$HOME/CGAL-3.6 .
make
\end{verbatim}
}
\texttt{CGAL\_DIR} can also be an environment variable.
If you have installed CGAL, \texttt{CGAL\_DIR} must afterward be set to
\texttt{\$CMAKE\_INSTALLED\_PREFIX/lib/CGAL}.
\subsection{Custom flags in the programs using \cgal}
Normally, programs linked with \cgal\ must be compiled with the same flags
used by the compilation of \cgal\
libraries. For this reason, the {\em very first} time
a program is configured, all the flags given by the \cmake\ variables \texttt{CMAKE\_*\_FLAGS}
are {\em locked} in the sense that the values recorded in \texttt{CGALConfig.cmake}
are used to override any values given by \cmake\ itself or yourself.
This does not apply to the additional flags that can be given via \texttt{CGAL\_*\_FLAGS}.
Such {\em inherited} values are then recorded in the current \cmake\ cache for the program.
The flags are then {\em unlocked} in the sense that at any subsequent configuration you can
provide your own flags and this time they will not be overridden.
When using the interactive \texttt{cmake-gui} the first press on \texttt{Configure} unlocks
the flags, so that you can edit them as needed.
\begin{ccAdvanced}
The locking of flags is controlled by the variable {\tt CGAL\_DONT\_OVERRIDE\_CMAKE\_FLAGS}
which starts out FALSE and is toggled right after the flags have been loaded from
\texttt{CGALConfig.cmake}.
If you use the command line tool you can specify flags {\em directly} by setting the
controlling variable right up front:
{\ccTexHtml{\scriptsize}{}
\begin{verbatim}
cd CGAL-3.6
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS=-g .
cd CGAL-3.6/examples/Straight_skeleton_2
cmake -DCGAL_DIR=CGAL-3.6 -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS=-O2 -DCGAL_DONT_OVERRIDE_CMAKE_FLAGS=TRUE .
\end{verbatim}
}
\end{ccAdvanced}
\section{Summary of Configuration Variables}
Most configuration variables are not environment variables but {\em \cmake\ variables}. They are given in the command line to \cmake\ via the \texttt{-D} option,
or passed from the interactive interface of \texttt{cmake-gui}. Unless
indicated differently, all the variables summarized below are \cmake\ variables.
\index{cgal!cmake-vars-components}\index{cgal configuration variables - components }
\subsection{Component selection}
The following boolean variables indicate which \cgal\ components to configure and build. Their values can be ON or OFF.
{\ccTexHtml{\small}{}
\renewcommand{\arraystretch}{1.3}
\gdef\lcTabularBorder{2}
\begin{tabular}{|l|l|} \hline
\textbf{Variable} & \textbf{Default value}\\\hline\hline
\texttt{WITH\_examples} & OFF\\\hline
\texttt{WITH\_demos} & OFF\\\hline
\texttt{WITH\_CGAL\_Core} & ON\\\hline
\texttt{WITH\_CGAL\_Qt3} & ON\\\hline
\texttt{WITH\_CGAL\_Qt4} & ON\\\hline
\texttt{WITH\_CGAL\_ImageIO} & ON\\\hline
\end{tabular}
}
\index{cgal!general-config-cmake-flags}\index{cgal configuration cmake variables - flags}
\subsection{Compiler and Linker Flags}
The following variables specify compiler and linker flags. Each variable holds a
space-separated list of command-line switches for the compiler and linker and
their default values are automatically defined by \cmake\ based on the target platform.
Have in mind that these variables specify a list of flags, not just one
single flag. If you provide your own definition for a variable, you will {\em entirely} override
the list of flags chosen by \cmake\ for that particular variable.
The variables that correspond to both debug and release builds are always
used in conjunction with those for the specific build type.
{\ccTexHtml{\small}{}
\renewcommand{\arraystretch}{1.3}
\gdef\lcTabularBorder{2}
\begin{tabular}{|l|l|l|l|} \hline
\textbf{Program} & \textbf{Both Debug and Release} & \textbf{Release only} & \textbf{Debug Only}\\\hline\hline
C++ Compiler & \texttt{CMAKE\_CXX\_FLAGS} & \texttt{CMAKE\_CXX\_FLAGS\_RELEASE} & \texttt{CMAKE\_CXX\_FLAGS\_DEBUG}\\\hline
Linker (shared libs) & \texttt{CMAKE\_SHARED\_LINKER\_FLAGS} & \texttt{CMAKE\_SHARED\_LINKER\_FLAGS\_RELEASE} & \texttt{CMAKE\_SHARED\_LINKER\_FLAGS\_DEBUG}\\\hline
Linker (static libs) & \texttt{CMAKE\_MODULE\_LINKER\_FLAGS} & \texttt{CMAKE\_MODULE\_LINKER\_FLAGS\_RELEASE} & \texttt{CMAKE\_MODULE\_LINKER\_FLAGS\_DEBUG}\\\hline
Linker (programs) & \texttt{CMAKE\_EXE\_LINKER\_FLAGS} & \texttt{CMAKE\_EXE\_LINKER\_FLAGS\_RELEASE} & \texttt{CMAKE\_EXE\_LINKER\_FLAGS\_DEBUG}\\\hline
\end{tabular}
}
\index{cgal!general-config-cmake-extra-flags}\index{cgal configuration cmake variables - additional flags}
\subsubsection{Additional Compiler and Linker Flags}
The following variables can be used to {\em add} flags without overriding the ones
defined by cmake.
{\ccTexHtml{\small}{}
\renewcommand{\arraystretch}{1.3}
\gdef\lcTabularBorder{2}
\begin{tabular}{|l|l|l|l|}\hline
\textbf{Program} & \textbf{Both Debug and Release} & \textbf{Release only} & \textbf{Debug Only}\\\hline\hline
C++ Compiler & \texttt{CGAL\_CXX\_FLAGS} & \texttt{CGAL\_CXX\_FLAGS\_RELEASE} & \texttt{CGAL\_CXX\_FLAGS\_DEBUG}\\\hline
Linker (shared libs) & \texttt{CGAL\_SHARED\_LINKER\_FLAGS} & \texttt{CGAL\_SHARED\_LINKER\_FLAGS\_RELEASE} & \texttt{CGAL\_SHARED\_LINKER\_FLAGS\_DEBUG}\\\hline
Linker (static libs) & \texttt{CGAL\_MODULE\_LINKER\_FLAGS} & \texttt{CGAL\_MODULE\_LINKER\_FLAGS\_RELEASE} & \texttt{CGAL\_MODULE\_LINKER\_FLAGS\_DEBUG}\\\hline
Linker (programs) & \texttt{CGAL\_EXE\_LINKER\_FLAGS} & \texttt{CGAL\_EXE\_LINKER\_FLAGS\_RELEASE} & \texttt{CGAL\_EXE\_LINKER\_FLAGS\_DEBUG}\\\hline
\end{tabular}
}
\index{cgal!general-config-cmake-vars-misc}\index{cgal configuration cmake variables - miscellaneous}
\subsection{Miscellaneous Variables}
{\ccTexHtml{\small}{}
\renewcommand{\arraystretch}{1.3}
\gdef\lcTabularBorder{2}
\begin{tabular}{|l|l|l|l|} \hline
\textbf{Variable} & \textbf{Description} & \textbf{Type} & \textbf{Default value}\\\hline\hline
\texttt{CMAKE\_BUILD\_TYPE} & Indicates type of build. Possible values are 'Debug' or 'Release' & CMake & Release\\\hline
\texttt{CMAKE\_CXX\_COMPILER} & Full-path to the executable corresponding to the C++ compiler to use. & CMake & platform-dependent\\\hline
\texttt{CXX} & Idem & Environment & Idem\\\hline
\end{tabular}
}
\index{cgal!general-config-cmake-vars-exe}\index{cgal configuration cmake variables - for programs only}
\subsubsection{Variables used only when building programs (such as demos or examples)}
{\ccTexHtml{\small}{}
\renewcommand{\arraystretch}{1.3}
\gdef\lcTabularBorder{2}
\begin{tabular}{|l|l|l|l|} \hline
\textbf{Variable} & \textbf{Description} & \textbf{Type} & \textbf{Default value}\\\hline\hline
\texttt{CGAL\_DIR} & Full-path to the binary directory where \cgal\ was configured & Either CMake or Environment & {\em none}\\\hline
\end{tabular}
}
\index{cgal!general-config-cmake-vars-dep}\index{cgal configuration cmake variables - dependencies}
\subsection{Variables providing information about 3rd-party libraries}
The following variables provide information about the availability and
location of the 3rd party libraries used by \cgal. \cmake\ automatically
searches for dependencies so you need to specify these variables if \cmake\
was unable to locate something. This is indicated by a value ending in
\texttt{NOTFOUND}.
Since 3rd-party libraries are system wide, many of the \cmake\ variables listed below can alternatively
be given as similarly-named environment variables instead. Keep in mind that you must provide one or the
other but never both.
\index{cgal!general-config-cmake-vars-dep-boost}\index{cgal configuration cmake variables - dependencies - boost}
\subsubsection{Boost libraries}
In most cases, if boost is not automatically found, setting the \texttt{BOOST\_ROOT}
variable is enough. If it is not, you can specify the header and library
directories individually. You can also provide the full pathname to a specific compiled library
if it cannot be found in the library directory or its name is non-standard.
{\ccTexHtml{\small}{}
\renewcommand{\arraystretch}{1.3}
\gdef\lcTabularBorder{2}
\begin{tabular}{|l|l|l|} \hline
\textbf{Variable} & \textbf{Description} & \textbf{Type}\\\hline\hline
\texttt{BOOST\_ROOT}\footnotemark[16] & Root directory of your boost installation & Either CMake or Environment\\\hline
\texttt{Boost\_INCLUDE\_DIR} & Directory containing the \texttt{boost/version.hpp} file & CMake\\\hline
\texttt{BOOST\_INCLUDEDIR} & Idem & Environment\\\hline
\texttt{Boost\_LIBRARY\_DIRS} & Directory containing the compiled boost libraries & CMake\\\hline
\texttt{BOOST\_LIBRARYDIR} & Idem & Environment\\\hline
\texttt{Boost\_{\em (xyz)}\_LIBRARY\_RELEASE} & Full pathname to a release build of the compiled 'xyz' boost library & CMake\\\hline
\texttt{Boost\_{\em (xyz)}\_LIBRARY\_DEBUG} & Full pathname to a debug build of the compiled 'xyz' boost library & CMake\\\hline
\end{tabular}
}
\footnotetext[16]{The environment variable can be spelled either \texttt{BOOST\_ROOT} or \texttt{BOOSTROOT}}\addtocounter{footnote}{1}
\index{cgal!general-config-cmake-vars-dep-gmp-mpfr}\index{cgal configuration cmake variables - dependencies - gmp, mpfr}
\subsubsection{GMP and MPFR libraries}
Under Windows, auto-linking is used, so only the {\em directory}
containing the libraries is needed and you would specify \texttt{GMP|MPFR\_LIBRARY\_DIR} rather than
\texttt{GMP|MPFR\_LIBRARIES}. On the other hand, under Linux the actual library filename is needed.
Thus you would specify \texttt{GMP|MPFR\_LIBRARIES}. In no case you need to specify both.
\cgal\ uses both gmp and mpfr, so both need to be supported. If either of them is unavailable the
usage of gmp and of mpfr will be disabled.
{\ccTexHtml{\small}{}
\renewcommand{\arraystretch}{1.3}
\gdef\lcTabularBorder{2}
\begin{tabular}{|l|l|l|} \hline
\textbf{Variable} & \textbf{Description} & \textbf{Type}\\\hline\hline
\texttt{WITH\_GMP} & Indicates whether to search and use gmp/mpfr or not & CMake\\\hline
\texttt{GMP\_INCLUDE\_DIR} & Directory containing the \texttt{gmp.h} file & CMake\\\hline
\texttt{GMP\_INC\_DIR} & Idem & Environment\\\hline
\texttt{GMP\_LIBRARIES\_DIR} & Directory containing the compiled gmp library & CMake\\\hline
\texttt{GMP\_LIB\_DIR} & Idem & Environment\\\hline
\texttt{GMP\_LIBRARIES} & Full pathname of the compiled gmp library & CMake\\\hline
\texttt{MPFR\_INCLUDE\_DIR} & Directory containing the \texttt{mpfr.h} file & CMake\\\hline
\texttt{MPFR\_INC\_DIR} & Idem & Environment\\\hline
\texttt{MPFR\_LIBRARIES\_DIR} & Directory containing the compiled mpfr library & CMake\\\hline
\texttt{MPFR\_LIB\_DIR} & Idem & Environment\\\hline
\texttt{MPFR\_LIBRARIES} & Full pathname of the compiled mpfr library & CMake\\\hline
\end{tabular}
}
Under Linux, the GMPXX is also searched for, and you may specify the following variables:
{\ccTexHtml{\small}{}
\renewcommand{\arraystretch}{1.3}
\gdef\lcTabularBorder{2}
\begin{tabular}{|l|l|l|} \hline
\textbf{Variable} & \textbf{Description} & \textbf{Type}\\\hline\hline
\texttt{GMPXX\_INCLUDE\_DIR} & Directory containing the \texttt{gmpxx.h} file & CMake\\\hline
\texttt{GMPXX\_LIBRARIES} & Full pathname of the compiled gmpxx library & CMake\\\hline
\end{tabular}
}
\index{cgal!general-config-cmake-vars-dep-mpfi}\index{cgal configuration cmake variables - dependencies - mpfi}
\subsubsection{MPFI library}
CGAL provides a number type based on this library, but the CGAL library
itself does not depend on MPFI. This means that this library must be
configured when compiling an application that uses the above number type.
When MPFI files are not on the standard path, the locations of the headers
and library files must be specified by using environment variables.
{\ccTexHtml{\small}{}
\renewcommand{\arraystretch}{1.3}
\gdef\lcTabularBorder{2}
\begin{tabular}{|l|l|l|} \hline
\textbf{Variable} & \textbf{Description} & \textbf{Type}\\\hline\hline
\texttt{MPFI\_INCLUDE\_DIR} & Directory containing the \texttt{mpfi.h} file & CMake\\\hline
\texttt{MPFI\_INC\_DIR} & Idem & Environment\\\hline
\texttt{MPFI\_LIBRARIES\_DIR} & Directory containing the compiled mpfi library & CMake\\\hline
\texttt{MPFI\_LIB\_DIR} & Idem & Environment\\\hline
\texttt{MPFI\_LIBRARIES} & Full pathname of the compiled mpfi library & CMake\\\hline
\end{tabular}
}
\index{cgal!general-config-cmake-vars-dep-leda}\index{cgal configuration cmake variables - dependencies - leda}
\subsubsection{LEDA library}
When the LEDA libraries are not automatically found, yet they are installed on the system
with base names 'leda' and 'ledaD' (for the release and debug versions resp.), it might
be sufficient to just indicate the library directory via the \texttt{LEDA\_LIBRARY\_DIRS} variable.
If that doesn't work because, for example, the names are different, you can provide the full pathnames of each variant
via \texttt{LEDA\_LIBRARY\_RELEASE} and \texttt{LEDA\_LIBRARY\_DEBUG}.
The variables specifying definitions and flags can be left undefined if they are not needed by LEDA.
{\ccTexHtml{\small}{}
\renewcommand{\arraystretch}{1.3}
\gdef\lcTabularBorder{2}
\begin{tabular}{|l|l|l|} \hline
\textbf{Variable} & \textbf{Description} & \textbf{Type}\\\hline\hline
\texttt{WITH\_LEDA} & Indicates whether to search and use LEDA or not & CMake\\\hline
\texttt{LEDA\_INCLUDE\_DIR} & Directory containing the file \texttt{LEDA/system/basic.h} & Either CMake or Environment\\\hline
\texttt{LEDA\_LIBRARY\_DIRS} & Directory containing the compiled LEDA libraries & Either CMake or Environment\\\hline
\texttt{LEDA\_LIBRARY\_RELEASE} & Full pathname to a release build of the LEDA library & Either CMake or Environment\\\hline
\texttt{LEDA\_LIBRARY\_DEBUG} & Full pathname to a debug build of the LEDA library & Either CMake or Environment\\\hline
\texttt{LEDA\_DEFINITIONS} & Preprocessor definitions & Either CMake or Environment\\\hline
\texttt{LEDA\_CXX\_FLAGS} & Compiler flags & Either CMake or Environment\\\hline
\texttt{LEDA\_LINKER\_FLAGS} & Linker flags & Either CMake or Environment\\\hline
\end{tabular}
}
\index{cgal!general-config-cmake-vars-dep-qt3}\index{cgal configuration cmake variables - dependencies - qt3}
\subsubsection{Qt3 library}
In most cases, if Qt3 is not automatically found, setting the \texttt{QTDIR}
environment variable is sufficient. If it is not, you can specify the directory containing
the header files and the full pathnames of the Qt3 libraries.
{\ccTexHtml{\small}{}
\renewcommand{\arraystretch}{1.3}
\gdef\lcTabularBorder{2}
\begin{tabular}{|l|l|l|} \hline
\textbf{Variable} & \textbf{Description} & \textbf{Type}\\\hline\hline
\texttt{QTDIR} & Root directory of the Qt3 library & Environment\\\hline
\texttt{QT3\_INCLUDE\_DIR} & Directory containing the \texttt{qt.h} file & CMake\\\hline
\texttt{QT3\_QT\_LIBRARY} & Full pathname to the qt library of Qt3 & CMake\\\hline
\texttt{QT3\_QTMAIN\_LIBRARY} & Full pathname to the qtmain library of Qt3 & CMake\\\hline
\texttt{QT3\_QASSISTANTCLIENT\_LIBRARY} & Full pathname to the qassistantclient library of Qt3 & CMake\\\hline
\texttt{QT3\_MOC\_LIBRARY} & Full pathname to the moc executable of Qt3 & CMake\\\hline
\texttt{QT3\_UIC\_LIBRARY} & Full pathname to the uic executable of Qt3 & CMake\\\hline
\end{tabular}
}
\index{cgal!general-config-cmake-vars-dep-qt4}\index{cgal configuration cmake variables - dependencies - qt4}
\subsubsection{Qt4 library}
The \cmake\ scripts that search for Qt4 can use the introspection feature
of the tool \texttt{qmake} included in Qt4 distributions. If Qt4 is not
automatically found, it is sufficient to set the \texttt{PATH}
environment variable, so that Qt4 \texttt{qmake} tool is in the path, and
before Qt3 \texttt{qmake} if that one exists. One can alternatively set the
\cmake\ variable \texttt{QT\_QMAKE\_EXECUTABLE}. The following variables
should be then assigned automatically by \cmake{}.
{\ccTexHtml{\small}{}
\renewcommand{\arraystretch}{1.3}
\gdef\lcTabularBorder{2}
\begin{tabular}{|l|l|l|} \hline
\textbf{Variable} & \textbf{Description} & \textbf{Type}\\\hline\hline
\texttt{QT\_INCLUDE\_DIR} & Directory containing the \texttt{QtCore/qglobal.h} file & CMake\\\hline
\texttt{QT\_LIBRARY\_DIR} & Directory containing the compiled Qt4 libraries & CMake\\\hline
\texttt{QT\_{\em (xyz)}\_LIBRARY} & Full pathname to the compiled 'xyz' Qt4 library\footnotemark[17] & CMake\\\hline
\texttt{QT\_QMAKE\_EXECUTABLE} & Full pathname to the qmake executable of Qt4 & CMake\\\hline
\texttt{QT\_MOC\_LIBRARY} & Full pathname to the moc executable of Qt4 & CMake\\\hline
\texttt{QT\_UIC\_LIBRARY} & Full pathname to the uic executable of Qt4 & CMake\\\hline
\end{tabular}
}
\footnotetext[17]{If both release and debug versions are available, this variable contains a list
of the following form: '\texttt{optimized;<fullpath-to-release-lib>;debug;<fullpath-to-debug-lib>}', where
the '\texttt{optimized}' and '\texttt{debug}' tags should appear verbatim.}\addtocounter{footnote}{1}
\index{cgal!general-config-cmake-vars-dep-qglviewer}\index{cgal configuration cmake variables - dependencies - qglviewer}
\subsubsection{QGLViewer library}
Some demos require the GLViewer library.
In most cases, if QGLViewer is not automatically found, setting the \texttt{QGLVIEWERROOT}
environment variable is sufficient. If it is not, you can specify the directory containing
the header files and the full pathnames of the release and debug libraries
{\ccTexHtml{\small}{}
\renewcommand{\arraystretch}{1.3}
\gdef\lcTabularBorder{2}
\begin{tabular}{|l|l|l|} \hline
\textbf{Variable} & \textbf{Description} & \textbf{Type}\\\hline\hline
\texttt{QGLVIEWERROOT} & Root directory of the QGViewer library & Environment\\\hline
\texttt{QGLVIEWER\_INCLUDE\_DIR} & Directory containing the \texttt{QGLViewer/qglviewer.h} file & CMake\\\hline
\texttt{QGLVIEWER\_LIBRARY\_RELEASE} & Full pathname to a release build of the QGLViewer library & CMake\\\hline
\texttt{QGLVIEWER\_LIBRARY\_DEBUG} & Full pathname to a debug build of the QGLViewer library & CMake\\\hline
\end{tabular}
}
\index{cgal!general-config-cmake-vars-dep-taucs}\index{cgal configuration cmake variables - dependencies - taucs}
\subsubsection{TAUCS and METIS libraries}
Some demos require the TAUCS and METIS libraries. If any of the two is not
found, the TAUCS support is disabled.
Under Windows, auto-linking is used, so only the {\em directory}
containing the libraries is needed, and you would specify \texttt{TAUCS\_LIBRARY\_DIR} rather than
\texttt{TAUCS\_LIBRARIES}. On the other hand, under Linux the actual library filename is needed.
Thus you would specify \texttt{TAUCS\_LIBRARIES}. In no case you need to specify both.
\cgal\ uses both TAUCS and METIS so both need to be supported. If either of them is unavailable the
usage of TAUCS-METIS will be disabled.
{\ccTexHtml{\small}{}
\renewcommand{\arraystretch}{1.3}
\gdef\lcTabularBorder{2}
\begin{tabular}{|l|l|l|} \hline
\textbf{Variable} & \textbf{Description} & \textbf{Type}\\\hline\hline
\texttt{TAUCS\_INCLUDE\_DIR} & Directory containing the \texttt{taucs.h} file & CMake\\\hline
\texttt{TAUCS\_INC\_DIR} & Idem & Environment\\\hline
\texttt{TAUCS\_LIBRARIES\_DIR} & Directory containing the compiled taucs library & CMake\\\hline
\texttt{TAUCS\_LIB\_DIR} & Idem & Environment\\\hline
\texttt{TAUCS\_LIBRARY} & Full pathname of the compiled taucs library & CMake\\\hline
\texttt{METIS\_LIBRARY} & Full pathname of the compiled metis library & CMake\\\hline
\end{tabular}
}
\index{cgal!general-config-cmake-vars-dep-blas}\index{cgal configuration cmake variables - dependencies - blas}
\subsubsection{BLAS and LAPACK libraries}
A few demos require some BLAS and LAPACK functions. There are several
implementations by different vendors that contains the required functions,
and \cmake\ searches for most of them.
If they are not found, you can indicate the directory containing the libraries, or provide a
semi-colon separated list of pathnames to the libraries which collectively implement the functions.
Many of the libraries implementing BLAS and LAPACK require the F2C library for Fortran-to-C convertion.
If this is needed and not found, you may specify the fullpath of the library in the \texttt{F2C\_LIBRARIES}
variable. You do not need to provide this, if the BLAS|LAPACK libraries do not need f2c.
{\ccTexHtml{\small}{}
\renewcommand{\arraystretch}{1.3}
\gdef\lcTabularBorder{2}
\begin{tabular}{|l|l|l|} \hline
\textbf{Variable} & \textbf{Description} & \textbf{Type}\\\hline\hline
\texttt{BLAS\_INCLUDE\_DIR} & Directory containing blas header files & CMake\\\hline
\texttt{BLAS\_LIBRARIES\_DIR} & Directory containing the compiled libraries implementing BLAS & Environment\\\hline
\texttt{BLAS\_LIB\_DIR} & Idem & Environment\\\hline
\texttt{BLAS\_LIBRARIES} & Semi-colon separated list of library pathnames implementing the BLAS functions & CMake\\\hline
\texttt{BLAS\_LINKER\_FLAGS} & Linker flags & CMake\\\hline
\texttt{BLAS\_DEFINITIONS} & Preprocessor definitions & CMake\\\hline
\texttt{LAPACK\_INCLUDE\_DIR} & Directory containing blas header files & CMake\\\hline
\texttt{LAPACK\_LIBRARIES\_DIR} & Directory containing the compiled libraries implementing LAPACK & Environment\\\hline
\texttt{LAPACK\_LIB\_DIR} & Idem & Environment\\\hline
\texttt{LAPACK\_LIBRARIES} & Semi-colon separated list of library pathnames implementing the LAPACK functions & CMake\\\hline
\texttt{LAPACK\_LINKER\_FLAGS} & Linker flags & CMake\\\hline
\texttt{LAPACK\_DEFINITIONS} & Preprocessor definitions & CMake\\\hline
\texttt{F2C\_LIBRARIES} & Full pathname to the f2c library & CMake\\\hline
\end{tabular}
}
\index{cgal!general-config-cmake-vars-dep-rs}\index{cgal configuration cmake variables - dependencies - rs}
\subsubsection{RS library}
As said before, only the \cgal{} univariate algebraic kernel depends on the
library \rs. As the algebraic kernel is not compiled as a part of the \cgal{}
library, this library is not detected nor configured at installation time.
\cmake{} will try to find \rs{} in the standard header and library
directories. When it is not automatically detected, the locations of the
headers and library files must be specified using environment variables.
\rs{} needs \gmp~4.2 or later and \mpfi~1.3.4 or later. The variables
related to the latter library may also need to be defined.
{\ccTexHtml{\small}{}
\renewcommand{\arraystretch}{1.3}
\gdef\lcTabularBorder{2}
\begin{tabular}{|l|l|l|} \hline
\textbf{Variable} & \textbf{Description} & \textbf{Type}\\\hline\hline
\texttt{RS\_INCLUDE\_DIR} & Directory containing the \texttt{rs\_exports.h} file & CMake\\\hline
\texttt{RS\_INC\_DIR} & Idem & Environment\\\hline
\texttt{RS\_LIBRARIES\_DIR} & Directory containing the compiled rs library & CMake\\\hline
\texttt{RS\_LIB\_DIR} & Idem & Environment\\\hline
\texttt{RS\_LIBRARIES} & Full pathname of the compiled rs library & CMake\\\hline
\end{tabular}
}
\section{Example}
Below is an example output on a Windows machine with VC8 installed, using \cmake\ 2.6,
and the following command-line call to \texttt{cmake}:
{\ccTexHtml{\scriptsize}{}
\begin{verbatim}
cmake -DWITH_examples=false
-DWITH_demos=false
-DCMAKE_BUILD_TYPE=Release
../../..
\end{verbatim}
}
{\ccTexHtml{\scriptsize}{}
\begin{verbatim}
-- Check for working C compiler: cl
-- Check for working C compiler: cl -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: cl
-- Check for working CXX compiler: cl -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- CGAL_REFERENCE_CACHE_DIR=
-- Building static libraries
-- Targetting Visual Studio 8 2005
-- Target build environment supports auto-linking
-- Using VC80 compiler.
-- Build type: Release
-- Generator uses intermediate configuration directory: $(OutDir)
-- CMake version: 2.6.1
-- System: Windows
-- CGAL_MAJOR_VERSION=3
-- CGAL_MINOR_VERSION=4
-- CGAL_BUILD_VERSION=442
-- CGAL_SONAME_VERSION=3
-- CGAL_SOVERSION =3.0.0
-- Boost version: 1.35.0
-- Found the following Boost libraries:
-- thread
-- Boost include: C:/Program Files/boost/boost_1_35_0
-- Boost libraries:
-- Boost definitions:
-- USING BOOST_VERSION = '1.35.0'
-- Could NOT find GMP
-- Could NOT find MPFR
-- Performing Test CGAL_CFG_DENORMALS_COMPILE_BUG - Success
-- Performing Test CGAL_CFG_IEEE_754_BUG - Success
-- Performing Test CGAL_CFG_ISTREAM_INT_BUG - Success
-- Performing Test CGAL_CFG_LONGNAME_BUG - Failed
-- Performing Test CGAL_CFG_MATCHING_BUG_5 - Success
-- Performing Test CGAL_CFG_MATCHING_BUG_6 - Failed
-- Performing Test CGAL_CFG_NESTED_CLASS_FRIEND_DECLARATION_BUG - Failed
-- Performing Test CGAL_CFG_NET2003_MATCHING_BUG - Failed
-- Performing Test CGAL_CFG_NO_CPP0X_ARRAY - Failed
-- Performing Test CGAL_CFG_NO_CPP0X_DECLTYPE - Failed
-- Performing Test CGAL_CFG_NO_CPP0X_DEFAULT_TEMPLATE_ARGUMENTS_FOR_FUNCTION_TEMPLATES - Failed
-- Performing Test CGAL_CFG_NO_CPP0X_DELEGATING_CONSTRUCTORS - Failed
-- Performing Test CGAL_CFG_NO_CPP0X_ISFINITE - Failed
-- Performing Test CGAL_CFG_NO_CPP0X_LONG_LONG - Success
-- Performing Test CGAL_CFG_NO_CPP0X_RVALUE_REFERENCE - Failed
-- Performing Test CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES - Failed
-- Performing Test CGAL_CFG_NO_LIMITS - Success
-- Performing Test CGAL_CFG_NO_NEXTAFTER - Failed
-- Performing Test CGAL_CFG_NO_STATEMENT_EXPRESSIONS - Failed
-- Performing Test CGAL_CFG_NO_STL - Success
-- Performing Test CGAL_CFG_NO_TMPL_IN_TMPL_PARAM - Success
-- Performing Test CGAL_CFG_NO_TR1_ARRAY - Failed
-- Performing Test CGAL_CFG_NUMERIC_LIMITS_BUG - Success
-- Performing Test CGAL_CFG_OUTOFLINE_MEMBER_DEFINITION_BUG - Success
-- Performing Test CGAL_CFG_TYPENAME_BEFORE_DEFAULT_ARGUMENT_BUG - Failed
-- Performing Test CGAL_CFG_USING_BASE_MEMBER_BUG_2 - Success
-- CMAKE_INSTALL_PREFIX=C:/Program Files/CGAL
-- USING CUSTOM_CXXFLAGS = ' -D_CRT_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS -D_SECURE_SCL=0'
-- USING CXXFLAGS = ' /DWIN32 /D_WINDOWS /W3 /Zm1000 /EHsc /GR /MD /O2 /Ob2 /D NDEBUG'
-- USING CUSTOM_LDFLAGS = ' '
-- USING LDFLAGS = ' '
-- USING CUSTOM_EXEFLAGS = ' '
-- USING EXEFLAGS = ' /MANIFEST /STACK:10000000 /machine:I386 /INCREMENTAL:NO'
-- Configuring CGALCore. Set WITH_CGALCore to FALSE to unselect it.
-- CGAL-core++ needs GMP and MPFR, cannot be configured.
-- Configuring CGALimageIO. Set WITH_CGALimageIO to FALSE to unselect it.
-- Could NOT find ZLIB
-- CGAL-ImageIO needs ZLib and OpenGL, cannot be configured.
-- Configuring CGALQt. Set WITH_CGALQt to FALSE to unselect it.
-- CGAL-Qt3 needs Qt3, cannot be configured.
-- Configuring CGALQt4. Set WITH_CGALQt4 to FALSE to unselect it.
-- Looking for Q_WS_X11
-- Looking for Q_WS_X11 - not found.
-- Looking for Q_WS_WIN
-- Looking for Q_WS_WIN - found
-- Looking for Q_WS_QWS
-- Looking for Q_WS_QWS - not found.
-- Looking for Q_WS_MAC
-- Looking for Q_WS_MAC - not found.
-- OpenGL include:
-- OpenGL libraries: glu32;opengl32
-- OpenGL definitions:
-- Qt4 include: C:/Work/Downloaded/Libraries/qt-win-opensource-src-4.4.1/include
-- Qt4 libraries: optimized;C:/Work/Downloaded/Libraries/qt-win-opensource-src-4.4.1/lib/qtmain.lib;debug;C:/Work/Downloaded/Libraries/qt-win-opensource-src-4.4.1/lib/qtmaind.lib;optimized;C:/Work/Downloaded/Libraries/qt-win-opensource-src-4.4.1/lib/QtOpenGL4.lib;debug;C:/Work/Downloaded/Libraries/qt-win-opensource-src-4.4.1/lib/QtOpenGLd4.lib;opengl32.lib glu32.lib gdi32.lib user32.lib;optimized;C:/Work/Downloaded/Libraries/qt-win-opensource-src-4.4.1/lib/QtGui4.lib;debug;C:/Work/Downloaded/Libraries/qt-win-opensource-src-4.4.1/lib/QtGuid4.lib;imm32;winmm;optimized;C:/Work/Downloaded/Libraries/qt-win-opensource-src-4.4.1/lib/QtCore4.lib;debug;C:/Work/Downloaded/Libraries/qt-win-opensource-src-4.4.1/lib/QtCored4.lib;ws2_32
-- Qt4 definitions: -DQT_DLL
-- moc executable: C:/Work/Downloaded/Libraries/qt-win-opensource-src-4.4.1/bin/moc.exe
-- uic executable: C:/Work/Downloaded/Libraries/qt-win-opensource-src-4.4.1/bin/uic.exe
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Work/Active/GeometryFactory/CGAL/Autotest/CGAL-3.6/cmake/platforms/a
\end{verbatim}
}
%%
%% EOF
%%