File: README.WIN32

package info (click to toggle)
gmt 5.3.1%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 150,460 kB
  • ctags: 18,539
  • sloc: ansic: 194,217; sh: 7,349; xml: 149; makefile: 72; fortran: 49; lisp: 41; csh: 5
file content (240 lines) | stat: -rw-r--r-- 7,011 bytes parent folder | download | duplicates (2)
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
236
237
238
239
240
////
$Id: README.WIN32 15178 2015-11-06 10:45:03Z fwobbe $
////

** HOWTO install GMT5 on Windows using CMake **

== Runtime dependencies

Ghostscript
===========

Install a recent Ghostscript version. We recommend the 32 bit version from
http://www.ghostscript.com/download/gsdnld.html

== Build dependencies

Microsoft Windows SDK
=====================

Note: You don't need Visual Studio 2010. Be aware, that Visual Studio 2010
Express cannot compile x64 binaries. You need the Windows SDK for that.

Download and install Microsofts free SDK for Windows, e.g. v7.1:
http://www.microsoft.com/download/en/details.aspx?id=8279

CMake
=====

Install CMake and select option to add CMake to the system PATH.
http://www.cmake.org/cmake/resources/software.html

Subversion
==========

You need to install Subversion in order to fetch the sources. Make sure svn is
in the PATH. A Windows version is available here: http://alagazam.net/

netCDF
======

Update: Unidata officially provides CMake support since netCDF 4.3.0
(http://www.unidata.ucar.edu/software/netcdf/docs/netCDF-CMake.html).

Compiling netCDF from scratch on Windows is not an easy task since you need a
lot of dependencies. You could either install a prepackaged development build
from http://www.gfd-dennou.org/arch/ucar/netcdf/contrib/win32/. For instance
netcdf-4.1.1-win32-bin.zip, and hope that it works. Most certainly it will
just not. Hence, we suggest you build netCDF yourself.

Note: In the following examples we assume that dependent libraries are
installed in sudirectories of z:\software\ any other directory is fine
though.

Obtain the CMake bundled sources of netCDF via subversion from
svn://gmtserver.soest.hawaii.edu/gmt5/sandbox/win32-dev/netcdf-4.1.3 and follow
the instructions in README.CMake in the netcdf-4.1.3 directory.

[...]

OK, well done. You successfully finished installing all required dependencies
for GMT. If you don't need PCRE and GDAL than you are all ready to build GMT!


PCRE (optional)
===============

Get PCRE from http://www.pcre.org/ and extract pcre-8.30.zip in
z:\software\src\pcre-8.30\

- Open the SDK Command Prompt:

  cd z:\software\src\pcre-8.30\
  mkdir build
  cd build
  cmake -G "NMake Makefiles" -DCMAKE_INSTALL_PREFIX=z:\software -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON ..
  nmake install

- Check if you can run 'pcregrep' from the command prompt.


GDAL (optional)
===============

We assume that you already installed HDF4, HDF5, cURL, netCDF to z:\software.
If that is not the case get the sources of netCDF for Windows from
svn://gmtserver.soest.hawaii.edu/gmt5/sandbox/win32-dev/netcdf-4.1.3
and follow the instructions in README.CMake in the source directory.

Now that all dependent libraries are available we can proceed with GDAL. In
the following we assume that the target install directory for GDAL is
z:\software as well.

- Get the GDAL sources from http://trac.osgeo.org/gdal/wiki/DownloadSource

- Extract gdal190.zip in z:\software\src\gdal-1.9.0

- Create a file z:\software\src\gdal-1.9.0\nmake.local with the following
  content:


LAPACK (optional)
=================

You need to install MinGW/MSYS and run the cmake from within the MSYS shell.
Path to the gfortran compiler must also be adapted to ones particular case.
Note also that the liblapack.dll will introduce by itself new dependencies on:
libblas.dll, libgfortran-3.dll, libgcc_s_seh-1.dll and libquadmath-0.dll
It's up to the user to make all these dependecies available to the system at runtime.

Get LAPACK from http://netlib.org/lapack/lapack.tgz and extract lapack.tgz in
z:\software\lapack-3.5.0\

  cd z:\software\lapack-3.5.0\
  mkdir build
  cd build
  cmake -G "NMake Makefiles" -DCMAKE_INSTALL_PREFIX=z:\software -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DCMAKE_GNUtoMS=ON -DCMAKE_Fortran_COMPILER=C:/MinGW64/mingw64/bin/gfortran.exe ..
  nmake install

--------8<-------------------------------------------------------

MSVC_VER       = 1600
WARNFLAGS      = /w
WIN64          = YES

GDAL_HOME      = z:\software

HDF4_PLUGIN    = NO
HDF4_DIR       = "c:\Program Files\HDF Group\HDF4\4.2.7"
HDF4_LIB       = /LIBPATH:$(HDF4_DIR)\lib hdfdll.lib mfhdfdll.lib

HDF5_PLUGIN    = NO
HDF5_DIR       = "c:\Program Files\HDF Group\HDF5\1.8.8"
HDF5_LIB       = /LIBPATH:$(HDF5_DIR)\lib hdf5dll.lib

PCIDSK_SETTING = OLD

NETCDF_PLUGIN  = NO
NETCDF_SETTING = yes
NETCDF_LIB     = z:\software\lib\netcdf.lib
NETCDF_INC_DIR = z:\software\include
NETCDF_HAS_NC4 = yes

CURL_DIR       = z:\software
CURL_INC       = -I$(CURL_DIR)\include
CURL_LIB       = $(CURL_DIR)\lib\libcurl_imp.lib Ws2_32.lib

------------------------------------------------------->8--------

Change the options according to your local setup. If unsure check the defaults
in nmake.opt.

- Open Windows SDK Command Prompt

  cd z:\software\src\gdal-1.9.0\
  nmake /f makefile.vc
  nmake /f makefile.vc devinstall

- Make sure z:\software\bin is in the PATH and type 'ogr2ogr'.
  It should greet you with usage information if everything is fine.


NSIS  (optional)
================

You also need to install NSIS (Nullsoft Scriptable Install System) if you want
to bundle GMT with all dependent DLLs and create a Windows intaller.

Download from http://nsis.sourceforge.net/


== Building GMT5

Finally we are ready to compile GMT5.

- Get GMT and GSHHG (Shoreline Database) from http://gmt.soest.hawaii.edu/

- In the source tree copy cmake/ConfigUserTemplate.cmake to
  cmake/ConfigUser.cmake and edit the file according to your demands. This is
  an example:

  set (CMAKE_INSTALL_PREFIX z:/software/gmt5msc)
  set (GSHHG_ROOT z:/software/src/gshhg-gmt)
  set (NETCDF_ROOT z:/software)
  set (GDAL_ROOT z:/software)
  set (PCRE_ROOT z:/software)

- Open Windows SDK Command Prompt

  set PATH=%PATH%;z:\software\bin
  mkdir build
  cd build

  cmake -G "NMake Makefiles" ..

  nmake
  nmake docs_html
  nmake install

- Typing 'gmt' should get you with a short message. You need to set your PATH
  to the directory specified in CMAKE_INSTALL_PREFIX:

  set PATH=%PATH%;z:\software\gmt5msc\bin

Congratulations you managed to install GMT5 on your machine!


Packaging with NSIS (optional)
==============================

Note: If you just want to create a GMT package you do not need to 'nmake
install' above.

CPack supports stand-alone ZIP archives and NSIS installers on Windows. After
building GMT run:

  nmake package

This will create both a ZIP archive and NSIS installer. If there are no issues
then you will obtain three files, e.g.:

GMT-5.x.x-win64-Documentation.zip
GMT-5.x.x-win64-Runtime.zip
GMT-5.x.x-win64.exe

Dependency walking takes a long time so be patient. You can save some time if
you are only interested in one of the two package options. Invoke CPack
instead:

  cpack -G <ZIP|NSIS>

The software packages are self contained and already include all dependent
DLLs (netCDF, GDAL, PCRE, ...).

Enjoy!

The GMT Team

////
vim: ft=asciidoc tw=78 et ts=2 sts=2 sw=2 autoindent smartindent
////