Personal tools
You are here: Home CGAL at TAU Installing CGAL and related programs on Windows operating system

Installing CGAL and related programs on Windows operating system

This page explains how to install CGAL 4.3 with Boost 1.55.0 and QT4.8.5 on Windows 8 using Visual Studio 2010 generating 32 bit binaries. The same procedure should apply to earlier versions of Windows.

Note that during the entire setup you need internet connection!

Note that the installation requires significant disk space. Make sure to free enough disk space before the installation.

Instructions on adding Environment Variables in Windows are at the end.

DOWNLOADS:

IMPORTANT: make sure that you install everything in 32-bit, even if your operating system is 64-bit.

  1. Visual Studio 2010 Professional (recommended) or Express.
    Professional - Students can get a free version from https://www.dreamspark.com
  2. Boost 1.55.0: http://www.boost.org/doc/libs/1_55_0/more/getting_started/windows.html
  3. CMake 2.8.12.2: http://www.cmake.org/files/v2.8/cmake-2.8.12.2-win32-x86.exe
  4. CGAL 4.3.0 - https://gforge.inria.fr/frs/download.php/32993/CGAL-4.3-Setup.exe
  5. QT 4.8.5 -  http://download.qt-project.org/official_releases/qt/4.8/4.8.5/qt-win-opensource-4.8.5-vs2010.exe
    QT Visual Studio 2010 Professional addin - http://download.qt-project.org/official_releases/vsaddin/qt-vs-addin-1.1.11-opensource.exe
INSTALLATION:
In parentheses are the paths on my computer.
 
1) Visual C++ 2010:
  •  If you use the offline version, choose to install Visual C++.
  •  Accept the license terms.
  •  You may select a custom installation (instead of full) and select only Visual C++ (unselect other features).
  •  You don't need to install "SQL Server" & "Silverlight Runtime" although you may.
  •  There is a chance that it is recommended to reboot now.
 
2) Boost
Versions earlier than 1.55 used to include a binary installer. Such an installer is no longer available. However, the procedure is fairly simple. There are several ways to build boost; the following is referred to as "build from source".
  • Open a command-line terminal, such as 'cmd'.
  • Make the compiler known by running the following batch file:
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\vcvars32.bat
  • Download the boost archive, unpack it to a target directory of your choice (e.g., C:\boost\boost_1_55_0), and change directory to target directory.
  • Run:
.\bootstrap
  • Then, build the static, shared, single and multi threaded boost libraries:
.\b2 link=static,shared threading=single,multi variant=debug,release
  • Make sure the subdirectory stage\lib\ has been populated with the compiled libraries (both .lib and .dll files).
3) CMake
  •  -Agree to the license.
  •  Check "Add CMake to the system PATH for all users".
  • Check "create desktop icon".
  •  Next, Next, Next.
  •  Finish
 
4) QT
  •  Agree to the license.
  •  Next, Next, Next, Install.
  •  Add QTDIR variable with the value C:\Qt\4.8.5 to the environment variables (if it's not already there).
  •  Add <QT>\bin to the system PATH. (C:\Qt\4.8.5\bin)
 
4.1) QT Visual Studio 2010 addin:
  •  install the addin (works only in VS2010 Professional edition)
 
5) CGAL
  •  CGAL installation will need to connect to the internet for GMP and MPFR.
  •  Be amazed by the splash screen.
  •  Agree to the license.
  •  Just choose the default: with GMP and MPFR, and with examples and demos.
  •  32-bit (for me).
  •  In the "Setting Environment Variables" screen, choose all users and make sure that CGAL_DIR is checked.
  •  Install.
  •  Add <CGAL_DIR >\auxiliary\gmp\lib to the system PATH. (C:\Program Files\CGAL-4.2-beta1\auxiliary\gmp\lib)
 
Now you need to compile CGAL
  •  Open CMake - cmake-gui (on the Desktop) - if you are using win7 make sure you open the program in administrator mode - right click on the icon and click on "run as administrator".
  •  For both "Where is the source code" and "Where to build the binaries" specify the CGAL Installation folder (C:\Program Files\CGAL-4.2-beta1)
  •  Click Configure.
  •  Choose "Visual Studio 10 2010" and click "Finish"
  •  Click Generate
  •  A solution named CGAL was created in the directory.
  •  Compile ALL_BUILD project both in Debug and Release (ignore the compilation error in CGAL_imageIO).
  •  All CGAL libraries should be under the lib directory.
 
6) Sanity check (optional)
  •  Open CMake (cmake-gui, can be found on the desktop) - (for win7 users, use "Run as admin")
  •  Choose "Where is the source code:" to be the Triangulation_2 demo directory under the CGAL installation. Namely, <CGAL>/demo/Triangulation_2 (C:\Program Files\CGAL-4.2-beta1/demo/Triangulation_2).
  •  Choose "Where to build the binaries:" to the same directory.
  •  Click Configure
  •  Click Generate
  •  Go to the directory (C:\Program Files\CGAL-4.2-beta1) and open the solution and compile. Run the Delaunay_triangulation project for check (in debug and release)
 
7) Customizing env - If you are not using CMake to create new VS projects

 Note: the following operations should be repeated for the Debug and Release modes
  •  Right-click on the selected project and select "Properties".
   
   Go to C/C++ -> General . Add the following to "Additional Include Directories" (include) 
   * include: <Boost> (C:\Program Files\boost\boost_1_50)
   * include: <CGAL>\include (C:\Program Files\CGAL-4.2-beta1\include)
   * include: <CGAL>\auxiliary\gmp\include (C:\Program Files\CGAL-4.2-beta1\auxiliary\gmp\include)
   * include: <QT>\include\Qt (C:\Qt\4.8.4\include\Qt)
   * include: <QT>\include\QtCore (C:\Qt\4.8.4\include\QtCore)
   * include: <QT>\include\QtGui (C:\Qt\4.8.4\include\QtGui)
 
  Go to Linker -> General. Add the following to "Additional Dependencies" (include) 
   * library: <CGAL>\lib (C:\Program Files\CGAL-4.2-beta1\lib)
   * library: <QT>\lib (C:\Qt\4.8.4\lib)
   * library: <Boost>\lib (C:\Program Files\boost\boost_1_50\lib)
   * library: <CGAL>\auxiliary\gmp\lib (C:\Program Files\CGAL-4.2-beta1\auxiliary\gmp\lib)
   
For a specific project using CGAL you need to ignore the auto-link of gmp and mpfr. The names below are for Debug
 - Linker -> Input
   * Add libgmp-10.lib and libmpfr-4.lib to "Additional Dependencies"
   * Add gmp-vc100-mt-gd.lib and mpfr-vc100-mt-gd.lib to "Ignore Specific Library" (gmp-vc100-mt.lib and mpfr-vc100-mt.lib in release mode).
 
For a specific project using QT:
 - Linker -> Input
   * Add qtmaind.lib, QtGuid4.lib, and QtCored4.lib to "Additional Dependencies" (qtmain.lib;QtCore4.lib;QtGui4.lib in release).
 
Important: In case that the compilation succeeds but the linker is unable to find cgal-related dlls ("the program can't start because cgal-vc100-mt-gd-4.2.dl is missing")
find these files in the CGAL directory and copy them either to the system32 folder of windows, or the folder of the visual studio project.
 
Try to compile this programs:
Hello CGAL: http://www.cgal.org/Manual/latest/doc_html/cgal_manual/Introduction/Chapter_main.html
 

Setting up PATH variable or other Environment variables on windows systems

    1. From the desktop, right-click My Computer and click properties.
    2. (on Vista/Win7/Win8 click Advanced system settings on the left side)
    3. In the System Properties window, click on the Advanced tab.
    4. In the Advanced section, click the Environment Variables button. 
    5. Finally, in the Environment Variables window, highlight the path variable in the Systems Variable section and click edit. 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 below.

      C:\Program Files;C:\Winnt;C:\Winnt\System32
If you were looking for the previous version of this page (CGAL 3.7, Boost 1.44, QT 4.7.1) please follow this link.
Document Actions
Log in


Forgot your password?