Skip to content

Commit

Permalink
update windows install page
Browse files Browse the repository at this point in the history
  • Loading branch information
sloriot committed Nov 1, 2019
1 parent 456a359 commit c7f4617
Showing 1 changed file with 91 additions and 146 deletions.
237 changes: 91 additions & 146 deletions download/windows.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,176 +6,121 @@
---
{% include JB/setup %}

<h2>Build from Source</h2>
<h2>With a Package Manager</h2>

<p>
To build CGAL from source on Windows you have to <a href="/download/last" target="_blank">download an installer or tarball</a> or you can clone the current development version of CGAL from <a href="https://github.com/CGAL/cgal" target="_blank">GitHub</a>. Below are the installation instructions for the installer.
We recommand to use <a href="https://github.com/microsoft/vcpkg" target="_blank">vcpkg</a>:

<pre>
vcpkg install cgal
</pre>

<h2>Build from Source</h2>

<p>To build CGAL from source on Windows you have to <a href="/download/last" target="_blank">download an installer or tarball</a> or you can clone the current development version of CGAL from <a href="https://github.com/CGAL/cgal" target="_blank">GitHub</a>. Below are the installation instructions for the installer.</p>
<p>Please note that the directory layout and build process of the development version on GitHub are different from the release version.</p>

<h2>Installing CGAL</h2>

<p><hr><p>

<table id="toc" class="toc">
<ul>
<li class="toclevel-1 tocsection-1"><a href="#GeneralPrerequisites"><span class="tocnumber">1</span> <span class="toctext">General Prerequisites</span></a></li>
<li class="toclevel-1 tocsection-2"><a href="#PrerequisitesforBuildingthe32-bitCGALLibraryusingMicrosoftVisualStudio"><span class="tocnumber">2</span> <span class="toctext">Prerequisites for Building the 32-bit CGAL Library using Microsoft Visual Studio 2013</span></a>
<ul>
<li class="toclevel-2 tocsection-3"><a href="#Boost"><span class="tocnumber">2.1</span> <span class="toctext">Boost</span></a>
</li>
<li class="toclevel-2 tocsection-6"><a href="#Qt5"><span class="tocnumber">2.2</span> <span class="toctext">Qt 5</span></a></li>
</ul>
</li>
<li class="toclevel-1 tocsection-8"><a href="#PrerequisitesforBuildingthe64-bitCGALLibraryUsingMicrosoftVisualStudio"><span class="tocnumber">3</span> <span class="toctext">Prerequisites for Building the 64-bit CGAL Library Using Microsoft Visual Studio 2013</span></a>
<ul>
<li class="toclevel-2 tocsection-9"><a href="#Boost2"><span class="tocnumber">3.1</span> <span class="toctext">Boost</span></a></li>
<li class="toclevel-2 tocsection-10"><a href="#Qt52"><span class="tocnumber">3.2</span> <span class="toctext">Qt 5</span></a></li>
</ul>
</li>
<li class="toclevel-1 tocsection-12"><a href="#BuildingCGAL"><span class="tocnumber">4</span> <span class="toctext">Building CGAL</span></a></li>
<li class="toclevel-1 tocsection-13"><a href="#BuildinganExample"><span class="tocnumber">5</span> <span class="toctext">Building an Example</span></a></li>
<li class="toclevel-1 tocsection-14"><a href="#BuildingaDemo"><span class="tocnumber">6</span> <span class="toctext">Building a Demo</span></a></li>
<li class="toclevel-1 tocsection-15"><a href="#Appendix"><span class="tocnumber">7</span> <span class="toctext">Appendix: How to Set the PATH Variable or Other Environment Variables on Windows Systems</span></a></li>
</ul>
</table>

<p><hr><p>
<h2>Step by Step Instructions for Installing and Using CGAL from the Installer</h2>

<h3 id="GeneralPrerequisites">General Prerequisites</h3>
<ul><li> Download and install <a rel="nofollow" class="external free" href="https://cmake.org">CMake</a>.
</li><li> <a rel="nofollow" class="external free" href="/download/last">Download the CGAL installer</a>.
</li><li> Read <a href="#Appendix">the appendix</a> if you don't know how to set/modify an environment variable.
</li><li> <b>Qt 5 is only needed if you want to run CGAL demos.</b>
</li><li> Identify what is the <i>Visual Studio Command Prompt</i> corresponding to the correct version (32- or 64-bit) of the compiler. Look in the start menu under the <i>Visual Studio</i> or <i>Microsoft Windows SDK</i> folders. At the command prompt, type <code>cl.exe</code> to check the version.
<hr>

<ul>
<li class="toclevel-1 tocsection-1"><a href="#GeneralPrerequisites"><span class="tocnumber">1</span> <span class="toctext">General Prerequisites</span></a></li>
<li class="toclevel-1 tocsection-2"><a href="#InstallingDependencies"><span class="tocnumber">2</span> <span class="toctext">Installing Dependencies</span></a>
<ul>
<li class="toclevel-2 tocsection-3"><a href="#Boost"><span class="tocnumber">2.1</span> <span class="toctext">Boost</span></a>
</li>
<li class="toclevel-2 tocsection-6"><a href="#Qt5"><span class="tocnumber">2.2</span> <span class="toctext">Qt 5</span></a></li>
</ul>
</li>
<li class="toclevel-1 tocsection-12"><a href="#InstallingCGAL"><span class="tocnumber">4</span> <span class="toctext">Installing CGAL</span></a></li>
<li class="toclevel-1 tocsection-13"><a href="#BuildinganExample"><span class="tocnumber">5</span> <span class="toctext">Building an Example</span></a></li>
<li class="toclevel-1 tocsection-14"><a href="#BuildingaDemo"><span class="tocnumber">6</span> <span class="toctext">Building a Demo</span></a></li>
<li class="toclevel-1 tocsection-15"><a href="#Appendix"><span class="tocnumber">7</span> <span class="toctext">Appendix: How to Set the PATH Variable or Other Environment Variables on Windows Systems</span></a></li>
</ul>

</li></ul>
<h3 id="PrerequisitesforBuildingthe32-bitCGALLibraryusingMicrosoftVisualStudio">Prerequisites for Building the <i>32-bit</i> CGAL Library using Microsoft Visual Studio 2013</h3>
<h4 id="Boost">Boost</h4>
<p>The 32-bit and 64-bits binary versions of Boost are available on <a rel="nofollow" class="external free" href="https://sourceforge.net/projects/boost/files/boost-binaries/" target="_blank">SourceForge</a>.
<hr>

Instructions here are given assuming the user will select the 64-bit version of Visual C++.

</p><p>The installers install both boost headers and precompiled libraries.
Please note that the CGAL project is not responsible for the files provided on this web site.
At the moment these lines were written, the latest version was 1.67.
<h3 id="GeneralPrerequisites">General Prerequisites</h3>
<ul>
<li> Download and install <a rel="nofollow" class="external free" href="https://cmake.org">CMake</a>.</li>
<li> <a rel="nofollow" class="external free" href="/download/last">Download the CGAL installer</a>.</li>
<li> Read <a href="#Appendix">the appendix</a> if you don't know how to set/modify an environment variable.</li>
<li> <b>Qt 5 is only needed if you want to run CGAL demos.</b></li>
<li> Identify what is the <i>Visual Studio Command Prompt</i> corresponding to the 64-bit version of the compiler. Look in the start menu under the <i>Visual Studio</i> or <i>Microsoft Windows SDK</i> folders. At the command prompt, type <code>cl.exe</code> to check the version.</li>
</ul>
<h3 id="InstallingDependencies">Installing Dependencies</h3>
<h4 id="Boost">Boost</h4>
<p>Binary versions of Boost are available on <a rel="nofollow" class="external free" href="https://sourceforge.net/projects/boost/files/boost-binaries/" target="_blank">SourceForge</a>.</p>
<p>
The installers install both boost headers and precompiled libraries.
Please note that the CGAL project is not responsible for the files provided on this web site.
At the moment these lines were written, the latest version was 1.71.
</p>

<pre> I download and run the file boost_1_67_0-msvc-xx.0-32.exe (where xx = 12 for 2013)</pre>
<p><pre> I choose to extract the files to a new directory c:\dev\libboost_1_67_0</pre>
<p>I download and run the file <code>boost_1_71_0-msvc-xx.0-64.exe</code> (where <code>xx</code> = 12 for 2013 for example).</p>
<p>I choose to extract the files to a new directory: <code>c:\dev\libboost_1_71_0</code>.</p>

<p>You then need to set the following two environment variables to point respectively to the path of the libraries and the headers
<p>
I then need to set the following two environment variables to point respectively to the path of the libraries and the headers
</p>
<pre>
BOOST_LIBRARYDIR=C:\dev\libboost_1_67_0\lib32-msvc-xx.0
BOOST_INCLUDEDIR=C:\dev\libboost_1_67_0
BOOST_LIBRARYDIR=C:\dev\libboost_1_71_0\lib64-msvc-xx.0
BOOST_INCLUDEDIR=C:\dev\libboost_1_71_0
</pre>
<p>You also need to add the path to the Boost dll files in your PATH environment variable:
<p>
I also need to add the path to the Boost dll (<code>C:\dev\libboost_1_71_0\lib64-msvc-xx.0</code>)files in my <code>PATH</code> environment variable.
</p>
<pre> I add to my PATH environment variable C:\dev\libboost_1_67_0\lib32-msvc-xx.0
</pre>

<h4 id="Qt5">Qt 5</h4>
<ul><li>Download and install the <i>Qt library for open source development package for 32-bit Visual Studio 2013</i> at <a rel="nofollow" class="external free" href="https://www.qt.io/download/" target="_blank">https://www.qt.io/download/</a> (<a rel="nofollow" class="external free" href="https://www1.qt.io/offline-installers/" target="_blank">here is the direct link to the offline installers</a>).

</li><li>Add the environment variable QTDIR pointing to the place you installed Qt.
</li></ul>
<pre> I select C:\Qt\Qt5.5.1 so QTDIR is set to C:\Qt\Qt5.5.1
</pre>
<ul><li>Add to the path the bin directory of Qt
</li></ul>
<pre> I add C:\Qt\Qt5.5.1\5.5\msvcXXXX_XX\bin to my PATH
</pre>
<p>To avoid any conflict with another dll with the same name from another folder, add this path as the first in the list.
</p>
<h4 id="Qt5">Qt 5 (Only needed for building demos)</h4>

<h3 id="PrerequisitesforBuildingthe64-bitCGALLibraryUsingMicrosoftVisualStudio">Prerequisites for Building the <i>64-bit</i> CGAL Library Using Microsoft Visual Studio 2013</h3>
<h4 id="Boost2">Boost</h4>
<p>The procedure for getting Boost is the same as described for the <a href="#Boost">32-bit version</a>, but all "32" must be replaced by "64".
</p>
<h4 id="Qt52">Qt 5</h4>
For the 64-bit version of Qt 5, the only available installer is for Visual Studio 2013, and the instructions
are the same as described for <a href="#Qt5">32-bit version</a>. For other versions of Visual Studio, please refer to these instructions:
<a rel="nofollow" class="external free" href="https://doc.qt.io/qt-5/build-sources.html" target="_blank">https://doc.qt.io/qt-5/build-sources.html</a>.
<ul>
<li>Download and install the <i>Qt library for open source development package for your Visual Studio version</i> at <a rel="nofollow" class="external free" href="https://www.qt.io/download/" target="_blank">https://www.qt.io/download/</a> (<a rel="nofollow" class="external free" href="https://www1.qt.io/offline-installers/" target="_blank">here is the direct link to the offline installers</a>).</li>
<li>Add the environment variable QTDIR pointing to the place you installed Qt: I select <code>C:\Qt\Qt5.13.1</code> so <code>QTDIR</code> is set to <code>C:\Qt\Qt5.13.1</code>.</li>
<li>Add to the path the bin directory of Qt: I add <code>C:\Qt\Qt5.13.1\msvcXXXX_XX\bin</code> to my <code>PATH</code>. To avoid any conflict with another dll with the same name from another folder, add this path as the first in the list.</li>
</ul>

<h3 id="InstallingCGAL">Installing CGAL</h3>
<p>
Run the installer and select the version you want to install (this is only used to download the precompiled GMP and MPFR):
</p>
<h3 id="BuildingCGAL">Building CGAL</h3>
<p>Run the installer and select the version you want to install (this is only used to download the precompiled GMP and MPFR):
</p>
<pre> I choose C:\dev\CGAL-4.12 as installation directory
</pre>
<p>You now need to compile CGAL.
</p>
<ul><li> Open cmake-gui
</li><li> For both "Where is the source code" and "Where to build the binaries", specify the CGAL Installation folder:
I choose <code>C:\dev\CGAL-5.0</code> as installation directory.

</li></ul>
<pre> I set C:\dev\CGAL-4.12 for source and C:\dev\CGAL-4.12\build as binaries
</pre>
<ul><li> Click on <code>Configure</code>.
</li><li> Choose <code>Visual Studio xx xxxx</code> for the 32-bit version and <code>Visual Studio xx xxxx Win64</code> for the 64-bit version.
</li><li> Click on <code>Generate</code>. a solution file named <code>CGAL.sln</code> has been created in the directory <code>C:\dev\CGAL-4.12\build</code>.
</li><li> Run Visual Studio and compile <code>ALL_BUILD</code> project both in Debug and Release.
</li><li> Add to your path the bin directory of the build:

</li></ul>
<pre> I add to my PATH C:\dev\CGAL-4.12\build\bin
</pre>

<p>You can choose not to build CGAL libraries, but use it in header-only mode by checking <code>CGAL_HEADER_ONLY</code> while configuring CGAL with cmake-gui.
<p>
CGAL being a header-only library, I do not need to compile it. I then set the environment variable <code>CGAL_DIR</code> to <code>C:\dev\CGAL-5.0</code>.
</p>

<h3 id="BuildinganExample">Building an Example</h3>
<p>Examples do not need Qt 5.
<p>
Examples do not need Qt 5.
</p>
<ul><li> Open cmake-gui.
</li><li> Choose "Where is the source code:" to be, for example, the Convex_hull_2 examples directory under the CGAL installation:
</li></ul>
<pre> I set it to C:\dev\CGAL-4.12\example\Convex_hull_2

</pre>
<ul><li> Choose "Where to build the binaries:" to be a build directory:
</li></ul>
<pre> I set it to "C:\dev\CGAL-4.12\build-example\Convex_hull_2"
</pre>
<ul><li> Click <code>Configure</code> and then <code>Generate</code>.
</li><li> A solution file has been created in the build directory. Open it can compile and run it:
</li></ul>
<pre> I open the file C:\dev\CGAL-4.12\build-examples\Convex_hull_2\Convex_hull_2_example.sln with Visual Studio
</pre>
<ul><li> Once the compilation is complete, you can run the executable (directly in Visual or by running the <code>.exe</code> created in the Debug or Release folder):
</li></ul>

<pre> I open the C:\dev\CGAL-4.12\build-examples\Convex_hull_2\ch_timing.exe (the window automatically closes if not run from the console).
</pre>
<ul>
<li> Open cmake-gui.</li>
<li> Choose "Where is the source code:" to be, for example, the Convex_hull_2 examples directory under the CGAL installation. I set it to <code> C:\dev\CGAL-5.0\example\Convex_hull_2</code>.</li>
<li> Choose "Where to build the binaries:" to be a build directory. I set it to <code>"C:\dev\CGAL-5.0\build-example\Convex_hull_2"</code></li>
<li> Click <code>Configure</code> and then <code>Generate</code>.</li>
<li> A solution file has been created in the build directory. Open it can compile and run it. I open with Visual Studio the file <code>C:\dev\CGAL-5.0\build-examples\Convex_hull_2\Convex_hull_2_example.sln</code></li>
<li> Once the compilation is complete, you can run the executable (directly in Visual or by running the <code>.exe</code> created in the Debug or Release folder), I open the file <code>C:\dev\CGAL-5.0\build-examples\Convex_hull_2\ch_timing.exe (the window automatically closes if not run from the console).</code></li>
</ul>
<h3 id="BuildingaDemo">Building a Demo</h3>
<p>All demos need Qt 5.
</p>
<ul><li> Open cmake-gui.
</li><li> Choose "Where is the source code:" to be, for example, the Triangulation_3 demo directory under the CGAL installation:
</li></ul>
<pre> I set it to C:\dev\CGAL-4.12\demo\Triangulation_3</pre>
<ul><li> Choose "Where to build the binaries:" to be a build directory:
</li></ul>
<pre> I set it to "C:\dev\CGAL-4.12\build-demo\Triangulation_3"</pre>
<ul><li> Click <code>Configure</code> and then <code>Generate</code>.
</li><li> A solution file has been created in the build directory. Open it, build it, and run it:
</li></ul>
<pre> I open the file C:\dev\CGAL-4.12\build-demo\Triangulation_3\Triangulation_3.sln with Visual Studio
</pre>
<ul><li> Once the compilation is complete, you can run the executable (directly in Visual or by running the .exe created in the Debug or Release folder).
</li></ul>
<p>All demos need Qt 5.</p>
<ul>
<li> Open cmake-gui.</li>
<li> Choose "Where is the source code:" to be, for example, the Triangulation_3 demo directory under the CGAL installation. I set it to <code>C:\dev\CGAL-5.0\demo\Triangulation_3</code>.</li>
<li> Choose "Where to build the binaries:" to be a build directory. I set it to <code>"C:\dev\CGAL-5.0\build-demo\Triangulation_3"</code>.</li>
<li> Click <code>Configure</code> and then <code>Generate</code>.</li>
<li> A solution file has been created in the build directory. Open it, build it, and run it. I open the file <code>C:\dev\CGAL-5.0\build-demo\Triangulation_3\Triangulation_3.sln</code> with Visual Studio.</li>
<li> Once the compilation is complete, you can run the executable (directly in Visual or by running the .exe created in the Debug or Release folder).</li>
</ul>

<h3 id="Appendix">Appendix: How to Set the PATH Variable or Other Environment Variables on Windows Systems</h3>
<p>From the desktop, right-click My Computer and click properties (on Vista/Win7 click Advanced system settings on the left side).
</p>
<ul><li>In the System Properties window, click on the Advanced tab.
</li><li>In the Advanced section, click the Environment Variables button.
</li><li>Finally, in the <i>User Variables</i> area, you can add or edit variables.
</li><li>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 <i>;</i>.

</li><li>To modify one, select it and click on <i>Edit...</i>
</li></ul>
<pre> C:\Program Files;C:\Winnt;C:\Winnt\System32
</pre>
<ul><li>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.
</li></ul>
<p>From the desktop, right-click My Computer and click properties (on Vista/Win7 click Advanced system settings on the left side).</p>
<ul>
<li>In the System Properties window, click on the Advanced tab.</li>
<li>In the Advanced section, click the Environment Variables button.</li>
<li>Finally, in the <i>User Variables</i> area, you can add or edit variables.</li>
<li>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 <i>;</i>.</li>
<li>To modify one, select it and click on <i>Edit...</i> <code>C:\Program Files;C:\Winnt;C:\Winnt\System32</code></li>
<li>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.</li>
</ul>

0 comments on commit c7f4617

Please sign in to comment.