This file is indexed.

/usr/share/doc/geographiclib/html/install.html is in geographiclib-doc 1.49-2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>GeographicLib: Installing GeographicLib</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    extensions: ["tex2jax.js"],
    jax: ["input/TeX","output/HTML-CSS"],
});
</script><script type="text/javascript" src="/usr/share/javascript/mathjax/MathJax.js/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">GeographicLib
   &#160;<span id="projectnumber">1.49</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',false,false,'search.php','Search');
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">Installing <a class="el" href="namespaceGeographicLib.html" title="Namespace for GeographicLib. ">GeographicLib</a> </div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><center> Back to <a class="el" href="intro.html">Introduction</a>. Forward to <a class="el" href="start.html">Getting started</a>. Up to <a class="el" href="index.html#contents">Contents</a>. </center><p><a class="el" href="namespaceGeographicLib.html" title="Namespace for GeographicLib. ">GeographicLib</a> has been developed under Linux with the g++ compiler (versions 4.0 and later), under Mac OS X with Xcode (version 8.2), and under Windows with Visual Studio 2010 and later. Earlier versions were tested also under Visual Studio 2005 and 2008 and under Solaris. It should compile on a wide range of other systems. First download either <a href="https://sourceforge.net/projects/geographiclib/files/distrib/GeographicLib-1.49.tar.gz">GeographicLib-1.49.tar.gz</a> or <a href="https://sourceforge.net/projects/geographiclib/files/distrib/GeographicLib-1.49.zip">GeographicLib-1.49.zip</a> (or <a href="https://sourceforge.net/projects/geographiclib/files/distrib/GeographicLib-1.49-win32.exe">GeographicLib-1.49-win32.exe</a> or <a href="https://sourceforge.net/projects/geographiclib/files/distrib/GeographicLib-1.49-win64.exe">GeographicLib-1.49-win64.exe</a> for binary installation under Windows). Then pick one of the first five options below:</p><ul>
<li><a class="el" href="install.html#cmake">Installation with cmake</a>. This is the preferred installation method as it will work on the widest range of platforms. However it requires that you have <a href="https://www.cmake.org">cmake</a> installed.</li>
<li><a class="el" href="install.html#autoconf">Installation using the autoconfigure tools</a>. This method works for most Unix-like systems, including Linux and Mac OS X.</li>
<li><a class="el" href="install.html#gnu">Installation with GNU compiler and Make</a>. This is a simple installation method that works with g++ and GNU make on Linux and many Unix platforms.</li>
<li><a class="el" href="install.html#windows">Installation on Windows</a>. This is a simple installation method that works with Visual Studio 2008 and 2010 under Windows.</li>
<li><a class="el" href="install.html#binaryinst">Using a binary installer</a>. Use this installation method if you only need to use the <a class="el" href="utilities.html">Utility programs</a> supplied with <a class="el" href="namespaceGeographicLib.html" title="Namespace for GeographicLib. ">GeographicLib</a>. (This method also installs the header files and the library for use by Visual Studio 14 2015.)</li>
<li><a class="el" href="install.html#qt">Building the library for use with Qt</a>. How to compile <a class="el" href="namespaceGeographicLib.html" title="Namespace for GeographicLib. ">GeographicLib</a> so that it can be used by Qt programs.</li>
<li><a class="el" href="install.html#maintainer">Maintainer tasks</a>. This describes addition tasks of interest only to the maintainers of this code.</li>
</ul>
<p>This section documents only how to install the <em>software</em>. If you wish to use <a class="el" href="namespaceGeographicLib.html" title="Namespace for GeographicLib. ">GeographicLib</a> to evaluate geoid heights or the earth's gravitational or magnetic fields, then you must also install the relevant data files. See <a class="el" href="geoid.html#geoidinst">Installing the geoid datasets</a>, <a class="el" href="gravity.html#gravityinst">Installing the gravity models</a>, and <a class="el" href="magnetic.html#magneticinst">Installing the magnetic field models</a> for instructions.</p>
<p>The first two installation methods use two important techniques which make software maintenance simpler</p><ul>
<li><b>Out-of-source builds:</b> This means that you create a separate directory for compiling the code. In the description here the directories are called BUILD and are located in the top-level of the source tree. You might want to use a suffix to denote the type of build, e.g., BUILD-vc11 for Visual Studio 11, or BUILD-shared for a build which creates a shared library. The advantages of out-of-source builds are:<ul>
<li>You don't mess up the source tree, so it's easy to "clean up". Indeed the source tree might be on a read-only file system.</li>
<li>Builds for multiple platforms or compilers don't interfere with each other.</li>
</ul>
</li>
<li><b>The library is installed:</b> After compilation, there is a separate <em>install</em> step which copies the headers, libraries, tools, and documentation to a "central" location. You may at this point delete the source and build directories. If you have administrative privileges, you can install <a class="el" href="namespaceGeographicLib.html" title="Namespace for GeographicLib. ">GeographicLib</a> for the use of all users (e.g., in /usr/local). Otherwise, you can install it for your personal use (e.g., in $HOME/packages).</li>
</ul>
<h1><a class="anchor" id="cmake"></a>
Installation with cmake</h1>
<p>This is the recommended method of installation; however it requires that <a href="https://www.cmake.org">cmake</a> be installed on your system. This permits <a class="el" href="namespaceGeographicLib.html" title="Namespace for GeographicLib. ">GeographicLib</a> to be built either as a shared or a static library on a wide variety of systems. cmake can also determine the capabilities of your system and adjust the compilation of the libraries and examples appropriately.</p>
<p>cmake is available for most computer platforms. On Linux systems cmake will typically one of the standard packages and can be installed by a command like </p><pre class="fragment">  yum install cmake </pre><p> (executed as root). The minimum version of cmake supported for building <a class="el" href="namespaceGeographicLib.html" title="Namespace for GeographicLib. ">GeographicLib</a> is 2.8.4 (which was released on 2011-02-16). (Actually, a few earlier versions will also work for non-Windows platforms.)</p>
<p>On other systems, download a binary installer from <a href="https://www.cmake.org">https://www.cmake.org</a> click on download, and save and run the appropriate installer. Run the cmake command with no arguments to get help. Other useful tools are ccmake and cmake-gui which offer curses and graphical interfaces to cmake. Building under cmake depends on whether it is targeting an IDE (interactive development environment) or generating Unix-style makefiles. The instructions below have been tested with makefiles and g++ on Linux and with the Visual Studio IDE on Windows. It is known to work also for Visual Studio 2017 Build Tools.</p>
<p>Here are the steps to compile and install <a class="el" href="namespaceGeographicLib.html" title="Namespace for GeographicLib. ">GeographicLib</a>:</p><ul>
<li>Unpack the source, running one of<pre class="fragment">  tar xfpz GeographicLib-1.49.tar.gz
  unzip -q GeographicLib-1.49.zip </pre> then enter the directory created with<pre class="fragment">  cd GeographicLib-1.49 </pre></li>
<li>Create a separate build directory and enter it, for example,<pre class="fragment">  mkdir BUILD
  cd BUILD </pre></li>
<li>Run cmake, pointing it to the source directory (..). On Linux, Unix, and MacOSX systems, the command is<pre class="fragment">  cmake .. </pre> For Windows, the command is typically something like<pre class="fragment">  cmake -G "Visual Studio 11" -D CMAKE_INSTALL_PREFIX=C:/pkg-vc10/GeographicLib-1.49 ..
  cmake -G "Visual Studio 12" -A x64 -D CMAKE_INSTALL_PREFIX=C:/pkg-vc11-x64/GeographicLib-1.49 ..</pre> The definitions of CMAKE_INSTALL_PREFIX are optional (see below). The settings given above are recommended to ensure that packages that use <a class="el" href="namespaceGeographicLib.html" title="Namespace for GeographicLib. ">GeographicLib</a> use the version compiled with the right compiler. If you need to rerun cmake, use<pre class="fragment">  cmake . </pre> possibly including some options via <code>-D</code> (see the next step).</li>
<li>cmake allows you to configure how <a class="el" href="namespaceGeographicLib.html" title="Namespace for GeographicLib. ">GeographicLib</a> is built and installed by supplying options, for example<pre class="fragment">  cmake -D CMAKE_INSTALL_PREFIX=/tmp/geographic . </pre> The options you might need to change are<ul>
<li><code>COMMON_INSTALL_PATH</code> governs the installation convention. If it is on ON (the Linux default), the installation is to a common directory, e.g., /usr/local. If it is OFF (the Windows default), the installation directory contains the package name, e.g., C:/pkg/GeographicLib-1.49. The installation directories for the documentation, cmake configuration, Python and MATLAB interfaces all depend on the variable with deeper paths relative to CMAKE_INSTALL_PREFIX being used when it's ON:<ul>
<li>cmake configuration: OFF cmake; ON: lib/cmake/GeographicLib;</li>
<li>documentation: OFF: doc/html; ON: share/doc/GeographicLib/html;</li>
<li>JavaScript interface: OFF: node_modules; ON: lib/node_modules;</li>
<li>Python interface: OFF: python; ON: lib/python/site-packages;</li>
<li>MATLAB interface: OFF: matlab; ON: share/matlab.</li>
</ul>
</li>
<li><code>CMAKE_INSTALL_PREFIX</code> (default: <code>/usr/local</code> on non-Windows systems, <code>C:/Program Files/GeographicLib</code> on Windows systems) specifies where the library will be installed. For windows systems, it is recommended to use a prefix which includes the compiler version, as shown above. If you just want to try the library to see if it suits your needs, pick, for example, <code>CMAKE_INSTALL_PREFIX</code>=/tmp/geographic.</li>
<li><code>GEOGRAPHICLIB_DATA</code> (default: /usr/local/share/GeographicLib for non-Windows systems, C:/ProgramData/GeographicLib for Windows systems) specifies the default location for the various datasets for use by <a class="el" href="classGeographicLib_1_1Geoid.html" title="Looking up the height of the geoid above the ellipsoid. ">Geoid</a>, <a class="el" href="classGeographicLib_1_1GravityModel.html" title="Model of the earth&#39;s gravity field. ">GravityModel</a>, and <a class="el" href="classGeographicLib_1_1MagneticModel.html" title="Model of the earth&#39;s magnetic field. ">MagneticModel</a>. See <a class="el" href="geoid.html#geoidinst">Installing the geoid datasets</a>, <a class="el" href="gravity.html#gravityinst">Installing the gravity models</a>, and <a class="el" href="magnetic.html#magneticinst">Installing the magnetic field models</a> for more information.</li>
<li><code>GEOGRAPHICLIB_LIB_TYPE</code> (allowed values: SHARED, STATIC, or BOTH), specifies the types of libraries build. The default is STATIC for Windows and SHARED otherwise. If building <a class="el" href="namespaceGeographicLib.html" title="Namespace for GeographicLib. ">GeographicLib</a> for system-wide use, BOTH is recommended, because this provides users with the choice of which library to use.</li>
<li><code>CMAKE_BUILD_TYPE</code> (default: Release). This flags only affects non-IDE compile environments (like make + g++). The default is actually blank, but this is treated as Release. Choose one of <pre class="fragment">  Debug
  Release
  RelWithDebInfo
  MinSizeRel
</pre> (With IDE compile environments, you get to select the build type in the IDE.)</li>
<li><code>GEOGRAPHICLIB_DOCUMENTATION</code> (default: OFF). If set to ON, then html documentation is created from the source files, provided a sufficiently recent version of doxygen can be found. Otherwise, the html documentation will redirect to the appropriate version of the online documentation.</li>
<li><code>BUILD_NETGEOGRAPHICLIB</code> (default: OFF). If set to ON, build the managed C++ wrapper library <a href="NET/index.html">NETGeographicLib</a>. This only makes sense for Windows systems.</li>
<li><code>GEOGRAPHICLIB_PRECISION</code> specifies the precision to be used for "real" (i.e., floating point) numbers. Here are the possible values<ol type="1">
<li>float (24-bit precision); typically this is far to inaccurate for geodetic applications.</li>
<li>double precision (53-bit precision, the default).</li>
<li>long double (64-bit precision); this does not apply for Visual Studio (long double is the same as double with that compiler).</li>
<li>quad precision (113-bit precision).</li>
<li>arbitrary precision.</li>
</ol>
See <a class="el" href="highprec.html">Support for high precision arithmetic</a> for addition information about the last two values. Nearly all the testing has been carried out with doubles and that's the recommended configuration. In particular you should avoid "installing" the library with a precision different from double.</li>
<li><code>USE_BOOST_FOR_EXAMPLES</code> (default: OFF). If set to ON, then the Boost library is searched for in order to build the <a class="el" href="classGeographicLib_1_1NearestNeighbor.html" title="Nearest-neighbor calculations. ">NearestNeighbor</a> example.</li>
<li><code>APPLE_MULTIPLE_ARCHITECTURES</code> (default: OFF). If set to ON, build for i386 and x86_64 and Mac OS X systems. Otherwise, build for the default architecture.</li>
<li><code>CONVERT_WARNINGS_TO_ERRORS</code> (default: OFF). If set to ON, then compiler warnings are treated as errors. (This happens also if you are a "developer", i.e., if the file <code>tests/CMakeLists.txt</code> is present.)</li>
</ul>
</li>
<li>Build and install the software. In non-IDE environments, run <pre class="fragment">  make         # compile the library and utilities
  make test    # run some tests
  make install # as root, if CMAKE_INSTALL_PREFIX is a system directory
</pre> Possible additional targets are<pre class="fragment">  make dist
  make exampleprograms
  make netexamples (supported only for Release configuration) </pre> On IDE environments, run your IDE (e.g., Visual Studio), load GeographicLib.sln, pick the build type (e.g., Release), and select "Build Solution". If this succeeds, select "RUN_TESTS" to build; finally, select "INSTALL" to install (RUN_TESTS and INSTALL are in the CMakePredefinedTargets folder). Alternatively (for example, if you are using the Visual Studio 2017 Build Tools), you run the Visual Studio compiler from the command line with<pre class="fragment">  cmake --build . --config Release --target ALL_BUILD
  cmake --build . --config Release --target RUN_TESTS
  cmake --build . --config Release --target INSTALL </pre> For maximum flexibility, it's a good idea to build and install both the Debug and Release versions of the library (in that order). The installation directories will then contain the release versions of the tools and <em>both</em> versions (debug and release) of the libraries. If you use cmake to configure and build your programs, then the right version of the library (debug vs. release) will automatically be used.</li>
<li>The headers, library, and utilities are installed in the include/GeographicLib, lib, and bin directories under <code>CMAKE_INSTALL_PREFIX</code>. (dll dynamic libraries are installed in bin.) For documentation, open in a web browser <a href="index.html">PREFIX/share/doc/GeographicLib/html/index.html</a>, if COMMON_INSTALL_PATH is ON, or <a href="index.html">PREFIX/doc/index.html</a>, otherwise.</li>
</ul>
<h1><a class="anchor" id="autoconf"></a>
Installation using the autoconfigure tools</h1>
<p>The method works on most Unix-like systems including Linux and Mac OS X. Here are the steps to compile and install <a class="el" href="namespaceGeographicLib.html" title="Namespace for GeographicLib. ">GeographicLib</a>:</p><ul>
<li>Unpack the source, running<pre class="fragment">  tar xfpz GeographicLib-1.49.tar.gz </pre> then enter the directory created<pre class="fragment">  cd GeographicLib-1.49 </pre></li>
<li>Create a separate build directory and enter it, for example,<pre class="fragment">  mkdir BUILD
  cd BUILD </pre></li>
<li>Configure the software, specifying the path of the source directory, with<pre class="fragment">  ../configure </pre></li>
<li>By default <a class="el" href="namespaceGeographicLib.html" title="Namespace for GeographicLib. ">GeographicLib</a> will be installed under /usr/local. You can change this with, for example<pre class="fragment">  ../configure --prefix=/tmp/geographic </pre></li>
<li>Compile and install the software with<pre class="fragment">  make
  make install </pre></li>
<li>The headers, library, and utilities are installed in the include/GeographicLib, lib, and bin directories under <code>prefix</code>. For documentation, open <a href="index.html">share/doc/GeographicLib/html/index.html</a> in a web browser.</li>
</ul>
<h1><a class="anchor" id="gnu"></a>
Installation with GNU compiler and Make</h1>
<p>This method requires the standard GNU suite of tools, in particular make and g++. This builds a static library and the examples.</p>
<p>Here are the steps to compile and install <a class="el" href="namespaceGeographicLib.html" title="Namespace for GeographicLib. ">GeographicLib</a>:</p><ul>
<li>Unpack the source, running<pre class="fragment">  tar xfpz GeographicLib-1.49.tar.gz </pre> then enter the directory created<pre class="fragment">  cd GeographicLib-1.49 </pre></li>
<li>Edit<pre class="fragment">  include/GeographicLib/Config.h </pre> If your C++ compiler does not recognize the long double type (unlikely), insert<div class="fragment"><div class="line"><span class="preprocessor">#undef GEOGRAPHICLIB_HAVE_LONG_DOUBLE </span></div></div><!-- fragment --> If your machine using big endian ordering, then insert<div class="fragment"><div class="line"><span class="preprocessor">#define GEOGRAPHICLIB_WORDS_BIGENDIAN 1 </span></div></div><!-- fragment --></li>
<li>Build and install the software:<pre class="fragment">  make             # compile the library and the examples
  make install     # as root </pre> The installation is in directories under /usr/local. You can specify a different installation directory with, for example, <pre class="fragment">  make PREFIX=/tmp/geographic install </pre></li>
<li>The headers, library, and utilities are installed in the include/GeographicLib, lib, and bin directories under <code>PREFIX</code>. For documentation, open <a href="index.html">share/doc/GeographicLib/html/index.html</a> in a web browser.</li>
</ul>
<h1><a class="anchor" id="windows"></a>
Installation on Windows</h1>
<p>This method requires Visual Studio 2008 or 2010. This builds a static library and the utilities. If you have some other version of Visual Studio, use cmake to create the necessary solution file, see <a class="el" href="install.html#cmake">Installation with cmake</a>. (cmake is needed to run the tests.)</p><ul>
<li>Unpack the source, running<pre class="fragment">  unzip -q GeographicLib-1.49.zip </pre></li>
<li>Open GeographicLib-1.49/windows/GeographicLib-vc10.sln in Visual Studio 2010 (for Visual Studio 2008, replace -vc10 by -vc9; for Visual Studio Express 2010, replace -vc10 by -vc10x).</li>
<li>Pick the build type (e.g., Release), and select "Build Solution".</li>
<li>The library and the compiled examples are in the windows/Release.</li>
<li>Copy the library windows/Release/GeographicLib.lib and the headers in include/GeographicLib somewhere convenient. The headers should remain in a directory named <a class="el" href="namespaceGeographicLib.html" title="Namespace for GeographicLib. ">GeographicLib</a>. For documentation, open <a href="index.html">doc/html/index.html</a> in a web browser.</li>
</ul>
<p>The Visual Studio 10 solution also contains projects to build <a href="NET/index.html">NETGeographicLib</a> and the C# example project.</p>
<h1><a class="anchor" id="binaryinst"></a>
Using a binary installer</h1>
<p>Binary installers are available for some platforms</p>
<h2><a class="anchor" id="binaryinstwin"></a>
Windows</h2>
<p>Use this method if you only need to use the <a class="el" href="namespaceGeographicLib.html" title="Namespace for GeographicLib. ">GeographicLib</a> utilities. The header files and static and shared versions of library are also provided; these can only be used by Visual Studio 14 2015 (in either release or debug mode). However, if you plan to use the library, it may be advisable to build it with the compiler you are using for your own code using either <a class="el" href="install.html#cmake">Installation with cmake</a> or <a class="el" href="install.html#windows">Installation on Windows</a>.</p>
<p>Download and run <a href="https://sourceforge.net/projects/geographiclib/files/distrib/GeographicLib-1.49-win32.exe">GeographicLib-1.49-win32.exe</a> or <a href="https://sourceforge.net/projects/geographiclib/files/distrib/GeographicLib-1.49-win64.exe">GeographicLib-1.49-win64.exe</a>:</p><ul>
<li>read the MIT/X11 License agreement,</li>
<li>select whether you want your PATH modified,</li>
<li>select the installation folder, by default C:\pkg-vc12-win32\GeographicLib-1.49 or C:\pkg-vc12-x64\GeographicLib-1.49,</li>
<li>select the start menu folder,</li>
<li>and install.</li>
</ul>
<p>(Note that the default installation folder adheres the the convention given in <a class="el" href="install.html#cmake">Installation with cmake</a>.) The start menu will now include links to the documentation for the library and for the utilities (and a link for uninstalling the library). If you ask for your PATH to be modified, it will include C:/pkg-vc12-{win32,x64}/GeographicLib-1.49/bin where the utilities are installed. The headers and library are installed in the include/GeographicLib and lib folders. The libraries were built using using Visual Studio 14 2015 in release and debug modes. The utilities were linked against the release-mode shared library.</p>
<p><a href="NET/index.html">NETGeographicLib</a> library dlls (release and debug) are included with the binary installers; these are linked against the shared library for <a class="el" href="namespaceGeographicLib.html" title="Namespace for GeographicLib. ">GeographicLib</a>.</p>
<h2><a class="anchor" id="binaryinstosx"></a>
MacOSX</h2>
<p>You can install using Homebrew. Follow the directions on <a href="https://brew.sh/">https://brew.sh/</a> for installing this package manager. Then type </p><pre class="fragment">brew install geographiclib </pre><p> Now links to <a class="el" href="namespaceGeographicLib.html" title="Namespace for GeographicLib. ">GeographicLib</a> are installed under /usr/local.</p>
<h2><a class="anchor" id="binaryinstlin"></a>
Linux</h2>
<p>Some Linux distributions, Fedora, Debian, and Ubuntu, offer <a class="el" href="namespaceGeographicLib.html" title="Namespace for GeographicLib. ">GeographicLib</a> as a standard package. Typically these will be one or two versions behind the latest.</p>
<h1><a class="anchor" id="qt"></a>
Building the library for use with Qt</h1>
<p>If Qt is using a standard compiler, then build <a class="el" href="namespaceGeographicLib.html" title="Namespace for GeographicLib. ">GeographicLib</a> with that same compiler (and optimization flags) as Qt.</p>
<p>If you are using the mingw compiler on Windows for Qt, then you need to build <a class="el" href="namespaceGeographicLib.html" title="Namespace for GeographicLib. ">GeographicLib</a> with mingw. You can accomplish this with cmake under cygwin with, for example,</p><pre class="fragment">  export PATH="`cygpath -m c:/QtSDK/mingw/bin`:$PATH"
  mkdir BUILD
  cd BUILD
  cmake -G "MinGW Makefiles" -D CMAKE_INSTALL_PREFIX=C:/pkg-mingw/GeographicLib ..
  mingw32-make
  mingw32-make install </pre><p> If cmake complains that sh mustn't be in your path, invoke cmake with </p><pre class="fragment">  env PATH="$( echo $PATH | tr : '\n' |
  while read d; do test -f "$d/sh.exe" || echo -n "$d:"; done |
  sed 's/:$//' )" \
  cmake -G "MinGW Makefiles" -D CMAKE_INSTALL_PREFIX=C:/pkg-mingw/GeographicLib ..
</pre><h1><a class="anchor" id="maintainer"></a>
Maintainer tasks</h1>
<p>Check the code out of git with</p><pre class="fragment">  git clone -b master git://git.code.sourceforge.net/p/geographiclib/code geographiclib
</pre><p> Here the "master" branch is checked out. There are three branches in the git repository:</p><ul>
<li><b>master</b>: the main branch for code maintenance. Releases are tagged on this branch as, e.g., v1.49.</li>
<li><b>devel</b>: the development branch; changes made here are merged into master.</li>
<li><b>release</b>: the release branch created by unpacking the source releases (git is <em>not</em> used to merge changes from the other branches into this branch). This is the <em>default</em> branch of the repository (the branch you get if cloning the repository without specifying a branch). This differs from the master branch in that some administrative files are excluded while some intermediate files are included (in order to aid building on as many platforms as possible). Releases are tagged on this branch as, e.g., r1.49.</li>
</ul>
<p>The autoconf configuration script and the formatted man pages are not checked into master branch of the repository. In order to create the autoconf configuration script, run</p><pre class="fragment">  sh autogen.sh </pre><p> in the top level directory. Provided you are running on a system with doxygen, pod2man, and pod2html installed, then you can create the documentation and the man pages by building the system using cmake or configure.</p>
<p>In the case of cmake, you then run</p><pre class="fragment">  make dist </pre><p> which will copy the man pages from the build directory back into the source tree and package the resulting source tree for distribution as </p><pre class="fragment">  GeographicLib-1.49.tar.gz
  GeographicLib-1.49.zip </pre><p> Finally,</p><pre class="fragment">  make package </pre><p> or building PACKAGE in Visual Studio will create a binary installer for <a class="el" href="namespaceGeographicLib.html" title="Namespace for GeographicLib. ">GeographicLib</a>. For Windows, this requires in the installation of <a href="http://nsis.sourceforge.net">NSIS</a>. On Windows, you should configure <a class="el" href="namespaceGeographicLib.html" title="Namespace for GeographicLib. ">GeographicLib</a> with <code>PACKAGE_DEBUG_LIBS</code>=ON, build both Release and Debug versions of the library and finally build PACKAGE in Release mode. This will get the release and debug versions of the library included in the package. For example, the 64-bit binary installer is created with</p><pre class="fragment">  cmake -G "Visual Studio 12" -A x64 \
    -D GEOGRAPHICLIB_LIB_TYPE=BOTH \
    -D PACKAGE_DEBUG_LIBS=ON \
    -D BUILD_NETGEOGRAPHICLIB=ON \
    ..
  cmake --build . --config Debug --target ALL_BUILD
  cmake --build . --config Release --target ALL_BUILD
  cmake --build . --config Release --target matlabinterface
  cmake --build . --config Release --target PACKAGE </pre><p>With configure, run</p><pre class="fragment">  make dist-gzip </pre><p> which will create the additional files and packages the results ready for distribution as</p><pre class="fragment">  geographiclib-1.49.tar.gz </pre><p>Prior to making a release, the script <code>tests/test-distribution.sh</code> is run on a Fedora system. This checked that the library compiles correctly is multiple configurations. In addition it creates a directory and scripts for checking the compilation on Windows.</p>
<p>The following Fedora packages are required by <code>tests/test-distribution.sh</code></p><ul>
<li>cmake</li>
<li>automake</li>
<li>autoconf-archive</li>
<li>libtool</li>
<li>gcc-c++</li>
<li>gcc-gfortran</li>
<li>ccache</li>
<li>doxygen</li>
<li>boost-devel</li>
<li>octave</li>
<li>python2-sphinx</li>
<li>nodejs</li>
<li>maven</li>
</ul>
<p>The following npm packages need to be installed</p><pre class="fragment">  npm install -g mocha jsdoc </pre><p> A recent version of mpreal.h needs to be downloaded from <a href="https://bitbucket.org/advanpix/mpreal">https://bitbucket.org/advanpix/mpreal</a> and installed in the <code>include/</code> directory. For all the tests to be run, the following datasets need to be installed</p><ul>
<li>geoid models: egm96-5</li>
<li>magnetic models: wmm2010 emm2015</li>
<li>gravity models: egm2008 grs80</li>
</ul>
<center> Back to <a class="el" href="intro.html">Introduction</a>. Forward to <a class="el" href="start.html">Getting started</a>. Up to <a class="el" href="index.html#contents">Contents</a>. </center> </div></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>