This page is a quick guide to help Windows users to install CGAL. For more information please refer to the installation manual.

Installing CGAL on Windows

General Prerequisites

  • Download and install cmake (www.cmake.org)
  • Download CGAL installer (http://gforge.inria.fr/frs/?group_id=52)
  • Read the appendix if you don't know how to set/modify an environment variable
  • Qt 4 is only needed if you want to run CGAL demos. libQGLViewer is only needed for 3D CGAL demos.
  • Identify what is the Visual Studio Command Prompt corresponding to the correct version (32- or 64-bit) of the compiler. Look in the start menu under the Visual Studio or Microsoft Windows SDK folders. At the command prompt, type cl.exe to check the version.

Prerequisites for Compiling the 32-bit CGAL Library using Microsoft Visual Studio 2010

Boost

The 32-bit and 64-bits binary versions of Boost are kindly provided by Tom Kent at http://boost.teeks99.com.

Please note that the CGAL project is not responsible for the files provided on this web site. At the moment these lines were written, Tom provided binaries up to the release 1.54 of boost.

Since boost version 1.54, Tom provides installers that install both boost headers and precompiled libraries.

   I download and run the file boost_1_54_0-msvc-10.0-32.exe

   I choose to extract the files to a new directory c:\dev\libboost_1_54_0

You then need to set the following two environment variables to point respectively to the path of the libraries and the headers

   BOOST_LIBRARYDIR=C:\dev\libboost_1_54_0\lib32-msvc-10.0
   BOOST_INCLUDEDIR=C:\dev\libboost_1_54_0

You also need to add in your PATH environment variable, the path to the Boost dll's:

   I add to my PATH environment variable C:\dev\libboost_1_54_0\lib32-msvc-10.0

With other versions of Tom installers, the path to libraries may end with lib32 instead of lib32-msvc-10.0.

Qt 4

  • Download and install the Qt library for open source development package for Visual Studio 2010 at http://qt-project.org/
  • Add the environment variable QTDIR pointing to the place you installed Qt.
   I selected C:\Qt\4.8.2 so QTDIR is set to C:\Qt\4.8.2
  • Add to the path the bin directory of Qt
   I add C:\Qt\4.8.2\bin to my PATH

To avoid any conflict with another dll with the same name from another folder, add this path as the first in the list.

libQGLViewer

   I extract the sources in C:\dev, a new directory is created C:\dev\libQGLViewer-2.3.17
  • Start the Visual Studio Command Prompt
  • Go to the QGLviewer directory
   I do cd C:\dev\libQGLViewer-2.3.17\QGLViewer
  • Run qmake and then nmake
   I do:
   qmake.exe
   nmake
  • Add the release and debug directory to the PATH
   I add C:\dev\libQGLViewer-2.3.17\QGLViewer\release;C:\dev\libQGLViewer-2.3.17\QGLViewer\debug to my PATH
  • Define the following environment variables:
   I set the environment variable QGLVIEWERROOT to C:\dev\libQGLViewer-2.3.17
  • Type exit to leave the command prompt

Prerequisites for Compiling the 64-bit CGAL Library Using Microsoft Visual Studio 2010

Boost

The procedure for getting Boost is the same as described for the 32-bit version, but all "32" must be replaced by "64".

Qt 4

  • There is no installer for the 64-bit version of QT4. You need to download the sources of the open-source version and to compile them.
   I download qt-everywhere-opensource-src-4.8.2.tar.gz
  • Extract it
   I extract it to c:\dev. The directory c:\dev\qt-everywhere-opensource-src-4.8.2 has been created
  • Open the Visual Studio Command Prompt
  • Go to the QT directory, configure and compile. If you build only the libraries and the tools (without the examples), it should not take too much time.
   cd c:\dev\qt-everywhere-opensource-src-4.8.2
   configure.exe
   nmake sub-src
   nmake sub-tools
  • You can free some disk space by running nmake clean which brings the disk space down to 2.7GB
   nmake clean
  • Then you need to set the QTDIR environment variable
   I set QTDIR=c:\dev\qt-everywhere-opensource-src-4.8.2
  • Add the bin directory to the PATH
   I add c:\dev\libraries\qt-everywhere-opensource-src-4.8.2\bin to the PATH

libQGLViewer

The procedure is the same as for the 32-bit version.

Building CGAL

Run the installer and select the version you want to install (this is only used to download the precompiled GMP and MPFR). In the "Setting Environment Variables" screen, uncheck CGAL_DIR.

   I choose C:\dev\CGAL-4.0 as installation directory

You now need to compile CGAL

  • Open CMake-GUI
  • For both "Where is the source code" and "Where to build the binaries" specify the CGAL Installation folder
   I set C:\dev\CGAL-4.0 for source and C:\dev\CGAL-4.0\build as binaries
  • Click on Configure
  • Choose "Visual Studio 10 2010" for the 32-bit version and "Visual Studio 10 2010 Win64" for the 64-bit version
  • Click on Generate
   In the directory C:\dev\CGAL-4.0\build a solution file named CGAL.sln has been created
  • Run Visual Studio 10 and compile ALL_BUILD project both in Debug and Release.
  • Add to your path the bin directory of the build
   I add to my PATH C:\dev\CGAL-4.0\build\bin

Compiling an Example

Examples need neither Qt 4, nor libQGLViewer

  • Open CMake-GUI
  • Choose "Where is the source code:" to be the Convex_hull_2 examples directory under the CGAL installation.
   I set it to C:\dev\CGAL-4.0\example\Convex_hull_2

  • Choose "Where to build the binaries:" to be a build directory
   I set it to "C:\dev\CGAL-4.0\build-example\Convex_hull_2"
  • Click Configure and then Generate
  • A solution file has been created in the build directory. Open it can compile and run it.
   I open the file C:\dev\CGAL-4.0\build-examples\Convex_hull_2\Convex_hull_2_example.sln with Visual Studio 10
  • Once the compilation is complete, you can run the executable (directly in Visual or click on the .exe created in the Debug or Release folder).
   I open the C:\dev\CGAL-4.0\build-examples\Convex_hull_2\ch_timing.exe (the windows automatically close if not run from the console).

Compiling a Demo

Demos need Qt 4 and the 3D demos libQGLViewer.

  • Open CMake
  • Choose "Where is the source code:" to be the Triangulation_3 demo directory under the CGAL installation.
   I set it to C:\dev\CGAL-4.0\demo\Triangulation_3

  • Choose "Where to build the binaries:" to be a build directory
   I set it to "C:\dev\CGAL-4.0\build-demo\Triangulation_3"
  • Click Configure and then Generate
  • A solution file has been created in the build directory. Open it, build and run it.
   I open the file C:\dev\CGAL-4.0\build-demo\Triangulation_3\Triangulation_3.sln with Visual Studio 10
  • Once the compilation is complete, you can run the executable (directly in Visual or click on the .exe created in the Debug or Release folder).

Appendix: How to Set the PATH Variable or Other Environment Variables on Windows Systems

From the desktop, right-click My Computer and click properties (on Vista/Win7 click Advanced system settings on the left side).

  • In the System Properties window, click on the Advanced tab.
  • In the Advanced section, click the Environment Variables button.
  • Finally, in the User Variables area, you can add or edit variables.
  • To add a new one click on New, the first line is the name of the variable (PATH for example), the second the value. If several values are added, they must be separated by a ;.
  • To modify one, select it and click on Edit...
   C:\Program Files;C:\Winnt;C:\Winnt\System32
  • Add or modify the path lines with the paths you wish the computer to access. Each different directory is separated with a semicolon as shown above.

Last modified on Friday, 13-Feb-2015 11:41:07 CET. contact information